Skip to content

Commit

Permalink
feat(PlatformCardMenu): ghost variant
Browse files Browse the repository at this point in the history
  • Loading branch information
BrickheadJohnny committed Aug 12, 2024
1 parent 171dc87 commit 273b64d
Showing 1 changed file with 17 additions and 32 deletions.
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

0 comments on commit 273b64d

Please sign in to comment.