Skip to content

Commit

Permalink
fix: user list item overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
paring-chan committed Sep 25, 2024
1 parent 6d0d798 commit 06dd5cb
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/lib/components/Avatar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
width: var(--avatar-size);
height: var(--avatar-size);
border-radius: calc(var(--avatar-size) / 2);
flex-shrink: 0;
overflow: hidden;
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/nav/NavUserArea.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<section class="nav-user-area">
<Avatar size={24} src={user.avatarURL} />
<span class="username-text">{user.displayName || user.username}</span>
<span class="username-text">{user.displayName}</span>
</section>

<style lang="scss">
Expand Down
5 changes: 4 additions & 1 deletion src/lib/components/user/UserTree.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
})}
>
<Avatar size={20} src={user.avatarURL} />
<div class="username">{user.displayName || user.username}</div>
<div class="username">{user.displayName}</div>
{#if user.isAdmin}
<div class="admin-sign">
<Icon icon="wrench" alt="admin" size={18} />
Expand Down Expand Up @@ -81,6 +81,9 @@
font-weight: 400;
font-size: 16px;
line-height: 140%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.admin-sign {
Expand Down
3 changes: 1 addition & 2 deletions src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ export type UserListItemModel =
}

export interface User {
username: string
displayName: string | null
displayName: string
avatarURL: string | null
isAdmin: boolean
}
Expand Down
1 change: 0 additions & 1 deletion src/stories/dummyData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import GanjangFactory from './assets/ganjangfactory.png'

export const dummyUser: User = {
avatarURL: GanjangFactory,
username: 'GanjangFactory',
isAdmin: false,
displayName: 'GanjangFactory'
}
Expand Down

0 comments on commit 06dd5cb

Please sign in to comment.