Skip to content

Commit

Permalink
add followers and following
Browse files Browse the repository at this point in the history
  • Loading branch information
GuiTavs7 committed Oct 27, 2024
1 parent 0766cad commit 1fc1b5a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/scripts/objects/screen.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@ const screen = {
// Usuário

this.userProfile.innerHTML = `<div class = "info">
<img src = "${user.avatarUrl}" alt = "Foto do perfil usuário" />
<div class = "data">
<h1>${user.name ?? "Não possui nome cadastrado 😢"}</h1>
<p>${user.bio ?? "Não possui bio cadastrada 😢"}</p>
</div>
</div>`
<img src = "${user.avatarUrl}" alt = "Foto do perfil usuário" />
<div class = "data">
<h1>${user.name ?? "Não possui nome cadastrado 😢"}</h1>
<p>${user.bio ?? "Não possui bio cadastrada 😢"}</p>
</div>
<p>Seguidores ${user.followers ?? "Não possui seguidores 😢"}</p>
<p>Seguindo ${user.following ?? "Não segue ninguém ainda 😢"}</p>
</div>`

// Repositórios

Expand Down
4 changes: 4 additions & 0 deletions src/scripts/objects/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ const user = {
bio: '',
userName: '',
repositories: [],
followers: '',
following: '',
setInfo(gitHubUser){
this.avatarUrl = gitHubUser.avatar_url;
this.name = gitHubUser.name;
this.bio = gitHubUser.bio;
this.userName = gitHubUser.login;
this.followers = gitHubUser.followers;
this.following = gitHubUser.following;
},
setRepositories(repositories){
this.repositories = repositories;
Expand Down

0 comments on commit 1fc1b5a

Please sign in to comment.