-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
25a0d69
commit 36bb9e6
Showing
2 changed files
with
34 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React from "react" | ||
import { Link, Button, ButtonProps, LinkProps, Icon } from "@chakra-ui/react" | ||
import { IconArrowUpRight } from "@tabler/icons-react" | ||
|
||
type CardButtonProps = ButtonProps & Pick<LinkProps, "isExternal" | "href"> | ||
|
||
export default function CardButton(props: CardButtonProps) { | ||
const { children, isExternal, ...restProps } = props | ||
return ( | ||
<Button | ||
as={Link} | ||
variant="card" | ||
isExternal={isExternal} | ||
{...restProps} | ||
_hover={{ bg: "gold.100" }} | ||
leftIcon={ | ||
isExternal ? ( | ||
<Icon as={IconArrowUpRight} color="brand.400" w={4} h={4} /> | ||
) : undefined | ||
} | ||
iconSpacing={1} | ||
fontWeight="semibold" | ||
> | ||
{children} | ||
</Button> | ||
) | ||
} |
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