Skip to content

Commit

Permalink
Merge pull request #56 from jordan-ae/feat/placeholder-avatar
Browse files Browse the repository at this point in the history
  • Loading branch information
0x4007 authored Jun 5, 2024
2 parents 92be3a6 + 3b16b30 commit 3e75bcc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/home/rendering/display-github-user-information.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ export async function displayGitHubUserInformation(gitHubUser: GitHubUser) {
if (!toolbar) throw new Error("toolbar not found");

const img = document.createElement("img");
img.src = gitHubUser.avatar_url;
if (gitHubUser.avatar_url) {
img.src = gitHubUser.avatar_url;
} else {
img.classList.add("github-avatar-default");
}
img.alt = gitHubUser.login;
authenticatedDivElement.appendChild(img);

Expand Down
5 changes: 5 additions & 0 deletions static/style/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -674,4 +674,9 @@
align-items: center;
margin-right: 8px;
}
.github-avatar-default {
width: 48px;
height: 48px;
background-color: #808080;
}
}

0 comments on commit 3e75bcc

Please sign in to comment.