Skip to content

Commit

Permalink
feat(sdk/dappkit): fix styles in the dropdown (#4374)
Browse files Browse the repository at this point in the history
* feat: fix styels

* feat: add scrollable content

* add item height
  • Loading branch information
evavirseda authored Dec 12, 2024
1 parent 2b73ad7 commit 882cbc4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
9 changes: 8 additions & 1 deletion sdk/dapp-kit/src/components/AccountDropdownMenu.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,23 @@ export const menuContent = style({
display: 'flex',
flexDirection: 'column',
width: 180,
maxHeight: 200,
maxHeight: 300,
marginTop: 4,
padding: 8,
gap: 8,
borderRadius: themeVars.radii.large,
backgroundColor: themeVars.backgroundColors.dropdownMenu,
});

export const scrollableContent = style({
overflowY: 'auto',
maxHeight: 300,
flexGrow: 1,
});

export const menuItem = style({
padding: 8,
height: 40,
userSelect: 'none',
outline: 'none',
display: 'flex',
Expand Down
16 changes: 9 additions & 7 deletions sdk/dapp-kit/src/components/AccountDropdownMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,15 @@ export function AccountDropdownMenu({ currentAccount, size = 'lg' }: AccountDrop
<DropdownMenu.Portal>
<StyleMarker className={styles.menuContainer}>
<DropdownMenu.Content className={styles.menuContent}>
{accounts.map((account) => (
<AccountDropdownMenuItem
key={account.address}
account={account}
active={currentAccount.address === account.address}
/>
))}
<div className={styles.scrollableContent}>
{accounts.map((account) => (
<AccountDropdownMenuItem
key={account.address}
account={account}
active={currentAccount.address === account.address}
/>
))}
</div>
<DropdownMenu.Separator className={styles.separator} />
<DropdownMenu.Item
className={clsx(styles.menuItem)}
Expand Down

0 comments on commit 882cbc4

Please sign in to comment.