-
Notifications
You must be signed in to change notification settings - Fork 447
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(PlatformCardMenu): ghost variant
- Loading branch information
1 parent
171dc87
commit 273b64d
Showing
1 changed file
with
17 additions
and
32 deletions.
There are no files selected for viewing
49 changes: 17 additions & 32 deletions
49
src/components/[guild]/RolePlatforms/components/PlatformCard/components/PlatformCardMenu.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 |
---|---|---|
@@ -1,38 +1,23 @@ | ||
import { | ||
ButtonProps, | ||
IconButton, | ||
Menu, | ||
MenuButton, | ||
MenuList, | ||
Portal, | ||
useColorModeValue, | ||
} from "@chakra-ui/react" | ||
import { IconButton, Menu, MenuButton, MenuList, Portal } from "@chakra-ui/react" | ||
import { DotsThree } from "@phosphor-icons/react" | ||
import { PropsWithChildren } from "react" | ||
|
||
const PlatformCardMenu = ({ children }: PropsWithChildren<unknown>) => { | ||
const colorScheme = useColorModeValue< | ||
ButtonProps["colorScheme"], | ||
ButtonProps["colorScheme"] | ||
>(undefined, "alpha") | ||
const PlatformCardMenu = ({ children }: PropsWithChildren<unknown>) => ( | ||
<Menu placement="bottom-end" closeOnSelect={false}> | ||
<MenuButton | ||
as={IconButton} | ||
icon={<DotsThree />} | ||
aria-label="Reward menu" | ||
boxSize={8} | ||
minW={8} | ||
rounded="full" | ||
variant="ghost" | ||
/> | ||
|
||
return ( | ||
<Menu placement="bottom-end" closeOnSelect={false}> | ||
<MenuButton | ||
as={IconButton} | ||
icon={<DotsThree />} | ||
aria-label="Reward menu" | ||
boxSize={8} | ||
minW={8} | ||
rounded="full" | ||
colorScheme={colorScheme} | ||
/> | ||
|
||
<Portal> | ||
<MenuList>{children}</MenuList> | ||
</Portal> | ||
</Menu> | ||
) | ||
} | ||
<Portal> | ||
<MenuList>{children}</MenuList> | ||
</Portal> | ||
</Menu> | ||
) | ||
|
||
export default PlatformCardMenu |