-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add handle network item menu, closes #5124
- Loading branch information
1 parent
967f7b1
commit cc67f22
Showing
9 changed files
with
227 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
src/app/features/settings/network/components/network-list-item-menu.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { SettingsSelectors } from '@tests/selectors/settings.selectors'; | ||
import { css } from 'leather-styles/css'; | ||
import { HStack, styled } from 'leather-styles/jsx'; | ||
|
||
import { DotsVerticalIcon, DropdownMenu, PenIcon, TrashIcon } from '@leather.io/ui'; | ||
|
||
interface Props { | ||
onEditNetwork(): void; | ||
onClickDeleteNetwork(): void; | ||
} | ||
|
||
export function NetworkItemMenu({ onClickDeleteNetwork, onEditNetwork }: Props) { | ||
return ( | ||
<DropdownMenu.Root> | ||
<DropdownMenu.IconButton> | ||
<DotsVerticalIcon | ||
color="ink.text-primary" | ||
data-testid={SettingsSelectors.SettingsMenuBtn} | ||
/> | ||
</DropdownMenu.IconButton> | ||
<DropdownMenu.Portal> | ||
<DropdownMenu.Content | ||
align="end" | ||
side="bottom" | ||
sideOffset={8} | ||
className={css({ | ||
width: 'settingsMenuWidth', | ||
})} | ||
> | ||
<DropdownMenu.Group> | ||
<DropdownMenu.Item | ||
onClick={e => { | ||
e.stopPropagation(); | ||
onEditNetwork(); | ||
}} | ||
> | ||
<HStack> | ||
<PenIcon /> | ||
<styled.span textStyle="label.02">Edit</styled.span> | ||
</HStack> | ||
</DropdownMenu.Item> | ||
<DropdownMenu.Item | ||
onClick={e => { | ||
e.stopPropagation(); | ||
onClickDeleteNetwork(); | ||
}} | ||
> | ||
<HStack color="red.action-primary-default"> | ||
<TrashIcon /> | ||
<styled.span textStyle="label.02">Delete</styled.span> | ||
</HStack> | ||
</DropdownMenu.Item> | ||
</DropdownMenu.Group> | ||
</DropdownMenu.Content> | ||
</DropdownMenu.Portal> | ||
</DropdownMenu.Root> | ||
); | ||
} |
Oops, something went wrong.