-
Notifications
You must be signed in to change notification settings - Fork 10
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
ce60212
commit 95718f3
Showing
10 changed files
with
545 additions
and
9 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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
import { FC } from "react" | ||
import { Flex, GridItem, SimpleGrid, Stack } from "@chakra-ui/react" | ||
import Card from "../../components/Card" | ||
import ExternalButtonLink from "../../components/Buttons/ExternalButtonLink" | ||
import { ExternalLinkHref } from "../../components/Navbar/types" | ||
import { BodyLg, H3, H5, Image, ImageProps } from "../../components" | ||
import { CardButton } from "./ProjectsAndToolsCard" | ||
import backgroundResources from "../../static/images/background-resources.svg" | ||
|
||
export interface ResourcesCardProps { | ||
image: ImageProps | ||
title: string | ||
description: string | ||
buttons: CardButton[] | ||
isBigSize?: boolean | ||
} | ||
|
||
const ResourcesCard: FC<ResourcesCardProps> = ({ | ||
image, | ||
title, | ||
description, | ||
buttons, | ||
}) => { | ||
return ( | ||
<Card m="auto" display="flex" flexDirection="column" w="100%" p={10}> | ||
<Stack spacing={6}> | ||
<Stack direction="row" alignItems="center" gap={4}> | ||
<Image h="42px" w="42px" {...image} /> | ||
<H5 noOfLines={2}>{title}</H5> | ||
</Stack> | ||
|
||
<BodyLg as="div" color="gray.400" noOfLines={2}> | ||
{description} | ||
</BodyLg> | ||
{buttons.map((button: CardButton, i) => ( | ||
<ExternalButtonLink | ||
key={i} | ||
mt={6} | ||
href={button.url as ExternalLinkHref} | ||
size="lg" | ||
variant="outline" | ||
> | ||
{button.label} | ||
</ExternalButtonLink> | ||
))} | ||
</Stack> | ||
</Card> | ||
) | ||
} | ||
|
||
const ResourcesExtendedCard: FC<ResourcesCardProps> = ({ | ||
image, | ||
title, | ||
description, | ||
buttons, | ||
}) => { | ||
return ( | ||
<GridItem | ||
m="auto" | ||
display="flex" | ||
flexDirection="column" | ||
w="100%" | ||
colSpan={{ base: 1, md: 2 }} | ||
> | ||
<Card p={0} m={0}> | ||
<SimpleGrid columns={{ base: 1, md: 2 }}> | ||
<Flex | ||
flexDirection="row" | ||
alignItems="center" | ||
gap={6} | ||
px={{ base: 8, md: 20 }} | ||
py={20} | ||
backgroundImage={backgroundResources} | ||
> | ||
<Image h="132px" w="132px" {...image} /> | ||
<H3 fontWeight="semibold" noOfLines={2}> | ||
Threshold Blog | ||
</H3> | ||
</Flex> | ||
<Stack spacing={7} pl={16} pr={20} py={10}> | ||
<H5 noOfLines={2}>{title}</H5> | ||
<BodyLg as="div" color="gray.400" noOfLines={3}> | ||
{description} | ||
</BodyLg> | ||
{buttons.map((button: CardButton, i) => ( | ||
<ExternalButtonLink | ||
key={i} | ||
mt={6} | ||
href={button.url as ExternalLinkHref} | ||
size="lg" | ||
variant="outline" | ||
> | ||
{button.label} | ||
</ExternalButtonLink> | ||
))} | ||
</Stack> | ||
</SimpleGrid> | ||
</Card> | ||
</GridItem> | ||
) | ||
} | ||
|
||
const Resources: FC<{ cards: ResourcesCardProps[] }> = ({ cards }) => { | ||
return ( | ||
<> | ||
<SimpleGrid columns={{ base: 1, md: 2 }} spacing={5} mt={8}> | ||
{cards | ||
.slice(0, 3) | ||
.map((resource: any, i) => | ||
resource.isBigSize ? ( | ||
<ResourcesExtendedCard key={i} {...resource} /> | ||
) : ( | ||
<ResourcesCard key={i} {...resource} /> | ||
) | ||
)} | ||
</SimpleGrid> | ||
</> | ||
) | ||
} | ||
|
||
export default Resources |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.