Skip to content

Commit

Permalink
Implement CardButton component
Browse files Browse the repository at this point in the history
  • Loading branch information
kpyszkowski committed Apr 18, 2024
1 parent 25a0d69 commit 36bb9e6
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
27 changes: 27 additions & 0 deletions dapp/src/pages/LandingPage/CardButton.tsx
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>
)
}
7 changes: 7 additions & 0 deletions dapp/src/pages/LandingPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import IconCard from "./IconCard"
import ValueCard from "./ValueCard"
import TVLCard from "./TVLCard"
import ContentCard from "./ContentCard"
import CardButton from "./CardButton"

const MOCK_SEASON_DUE_TIMESTAMP = new Date(2024, 3, 20).getTime() / 1000
const PARTNER_LOGOS = [baseLogo, thresholdLogo, ledgerLogo, wormholeLogo]
Expand Down Expand Up @@ -76,6 +77,12 @@ export default function LandingPage() {
/>
))}
</ContentCard>
<CardButton href="#" isExternal>
Docs
</CardButton>
<CardButton href="#" isExternal>
FAQ
</CardButton>
</VStack>
</Flex>
)
Expand Down

0 comments on commit 36bb9e6

Please sign in to comment.