Skip to content

Commit

Permalink
feat: set default avatar variant to filled
Browse files Browse the repository at this point in the history
  • Loading branch information
beeman committed Aug 6, 2024
1 parent 04a3beb commit e865a42
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions libs/web/core/feature/src/lib/web-core.feature.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ const theme = createTheme({
brand: DEFAULT_THEME.colors.blue,
},
primaryColor: 'brand',
components: {
Avatar: {
defaultProps: {
variant: 'filled',
},
},
},
})

export function WebCoreFeature() {
Expand Down
2 changes: 1 addition & 1 deletion libs/web/core/ui/src/lib/ui-header-profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function UiHeaderProfile({ user, logout }: { user?: User | null; logout:
const isAdmin = user?.role === UserRole.Admin
const isDeveloper = user?.developer ?? false

return user ? (
return user?.username ? (
<Menu
width={260}
position="bottom-end"
Expand Down
2 changes: 1 addition & 1 deletion libs/web/user/ui/src/lib/user-ui-avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ export type UserUiAvatarProps = UiAvatarProps & {
}

export function UserUiAvatar({ user, ...props }: UserUiAvatarProps) {
return <UiAvatar url={user?.avatarUrl} name={user?.username} {...props} />
return <UiAvatar url={user?.avatarUrl} name={user?.username ?? undefined} {...props} />
}

0 comments on commit e865a42

Please sign in to comment.