Skip to content

Commit ea946fa

Browse files
committed
switched default profile picture
1 parent d0b1da6 commit ea946fa

2 files changed

Lines changed: 10 additions & 45 deletions

File tree

src/icons/emptyProfileAvatar.png

417 KB
Loading

src/v2/components/header/Header.ts

Lines changed: 10 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { ifDefined } from 'lit/directives/if-defined.js'
88
const DEFAULT_HELP_MENU_ICON = icons.iconBase + 'noun_help.svg'
99
const DEFAULT_SOLID_ICON_URL = 'https://solidproject.org/assets/img/solid-emblem.svg'
1010
const DEFAULT_SIGNUP_URL = 'https://solidproject.org/get_a_pod'
11-
const DEFAULT_LOGGEDIN_MENU_BUTTON_AVATAR_LABEL = 'Accounts'
11+
const DEFAULT_LOGGEDIN_MENU_BUTTON_AVATAR = icons.iconBase + 'emptyProfileAvatar.png'
1212

1313
export type HeaderAuthState = 'logged-out' | 'logged-in'
1414

@@ -247,34 +247,12 @@ export class Header extends LitElement {
247247
border: 1.5px solid var(--header-border);
248248
}
249249
250-
.account-avatar-text {
251-
width: auto;
252-
min-width: auto;
253-
height: auto;
254-
padding: 0.25rem 0.75rem;
255-
border-radius: 999px;
256-
white-space: nowrap;
257-
border: 1px solid var(--header-border);
258-
}
259-
260250
.account-menu-avatar {
261251
width: 2rem;
262252
height: 2rem;
263253
border-radius: 0.5rem;
264254
}
265255
266-
.account-menu-avatar.account-avatar-text {
267-
width: 2rem;
268-
height: 2rem;
269-
padding: 0.25rem;
270-
border-radius: 0.5rem;
271-
white-space: normal;
272-
line-height: 1;
273-
text-align: center;
274-
overflow: hidden;
275-
text-overflow: ellipsis;
276-
}
277-
278256
.account-avatar img,
279257
.account-menu-avatar img {
280258
width: 100%;
@@ -616,31 +594,18 @@ export class Header extends LitElement {
616594
return this.layout !== 'mobile' && this.hasHelpMenuItems()
617595
}
618596

619-
private renderLoggedInAvatar (avatar?: string) {
597+
private renderLoggedInAvatar (avatar?: string, wrapperClass = 'account-avatar') {
620598
const hasAvatar = Boolean(avatar)
621-
const avatarContent = hasAvatar
622-
? html`<img src="${avatar}" alt="" />`
623-
: DEFAULT_LOGGEDIN_MENU_BUTTON_AVATAR_LABEL
624-
625-
if (this.layout === 'mobile') {
626-
return hasAvatar
627-
? html`<img class="account-avatar-img" src="${avatar}" alt="" />`
628-
: html`<span class="account-avatar account-avatar-text">${DEFAULT_LOGGEDIN_MENU_BUTTON_AVATAR_LABEL}</span>`
629-
}
599+
const imageSrc = hasAvatar ? avatar : DEFAULT_LOGGEDIN_MENU_BUTTON_AVATAR
600+
const imageAlt = hasAvatar ? 'Profile Avatar' : 'Default Avatar'
630601

631-
return html`
632-
<span class="account-avatar ${hasAvatar ? '' : 'account-avatar-text'}" aria-hidden="true">
633-
${avatarContent}
634-
</span>
635-
`
636-
}
602+
if (this.layout === 'mobile' && wrapperClass === 'account-avatar') {
603+
return html`<img class="account-avatar-img" src="${imageSrc}" alt="${imageAlt}" />`
604+
}
637605

638-
private renderAccountsMenuAvatar (avatar?: string) {
639606
return html`
640-
<span class="account-menu-avatar ${avatar ? '' : 'account-avatar-text'}" aria-hidden="true">
641-
${avatar
642-
? html`<img src="${avatar}" alt="" />`
643-
: '?'}
607+
<span class="${wrapperClass}" aria-hidden="true">
608+
<img src="${imageSrc}" alt="${imageAlt}" />
644609
</span>
645610
`
646611
}
@@ -694,7 +659,7 @@ export class Header extends LitElement {
694659

695660
private renderAccountMenuItem (item: HeaderAccountMenuItem) {
696661
const content = html`
697-
${this.renderAccountsMenuAvatar(item.avatar)}
662+
${this.renderLoggedInAvatar(item.avatar, 'account-menu-avatar')}
698663
<span class="account-menu-copy">
699664
<span class="account-menu-label">${item.label}</span>
700665
${item.webid ? html`<span class="account-menu-webid">${item.webid}</span>` : ''}

0 commit comments

Comments
 (0)