Skip to content

Commit

Permalink
add secondary action menu for safe list
Browse files Browse the repository at this point in the history
  • Loading branch information
jmealy committed Feb 9, 2024
1 parent 38cbf49 commit 33acfcb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/components/welcome/MyAccounts/AccountItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import ChainIndicator from '@/components/common/ChainIndicator'
import css from './styles.module.css'
import { selectAllAddressBooks } from '@/store/addressBookSlice'
import { shortenAddress } from '@/utils/formatters'
import SafeListContextMenu from '@/components/sidebar/SafeListContextMenu'

type AccountItemProps = {
chainId: string
Expand All @@ -34,9 +35,9 @@ const AccountItem = ({ chainId, address, ...rest }: AccountItemProps) => {
const name = useAppSelector(selectAllAddressBooks)[chainId]?.[address]

return (
<Track {...OVERVIEW_EVENTS.OPEN_SAFE} label={OPEN_SAFE_LABELS.login_page}>
<Link href={href}>
<ListItemButton className={css.listItem}>
<ListItemButton className={css.listItem}>
<Track {...OVERVIEW_EVENTS.OPEN_SAFE} label={OPEN_SAFE_LABELS.login_page}>
<Link href={href} className={css.safeLink}>
<SafeIcon address={address} {...rest} />

<Typography variant="body2" component="div">
Expand All @@ -54,9 +55,10 @@ const AccountItem = ({ chainId, address, ...rest }: AccountItemProps) => {
<Box flex={1} />

<ChainIndicator chainId={chainId} />
</ListItemButton>
</Link>
</Track>
</Link>
</Track>
<SafeListContextMenu name={name} address={address} chainId={chainId} />
</ListItemButton>
)
}

Expand Down
11 changes: 11 additions & 0 deletions src/components/welcome/MyAccounts/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,14 @@
padding-top: var(--space-2);
padding-bottom: var(--space-2);
}

.listItem> :first-child {
display: block;
flex: 1;
}

.safeLink {
display: flex;
gap: var(--space-2);
align-items: center;
}

0 comments on commit 33acfcb

Please sign in to comment.