|
1 |
| -import { Card, CardBody, HStack, Heading, Link, LinkProps, Tag, Text } from "@chakra-ui/react" |
| 1 | +import { Card, CardBody, CardFooter, HStack, Heading, Link, LinkProps, Tag, Text } from "@chakra-ui/react" |
| 2 | +import IconDiscord from "../icons/IconDiscord" |
| 3 | +import IconGithub from "../icons/IconGithub" |
| 4 | +import IconWebsite from "../icons/IconWebsite" |
2 | 5 |
|
3 | 6 | export type ProjectCardProps = {
|
4 | 7 | categories: string[]
|
5 | 8 | title: string
|
6 | 9 | description: string
|
7 | 10 | url?: string
|
| 11 | + githubUrl?: string |
| 12 | + discordUrl?: string |
8 | 13 | }
|
9 | 14 |
|
10 |
| -export default function ProjectCard({ categories, title, description, url, ...props }: ProjectCardProps & LinkProps) { |
| 15 | +export default function ProjectCard({ |
| 16 | + categories, |
| 17 | + title, |
| 18 | + description, |
| 19 | + url, |
| 20 | + githubUrl, |
| 21 | + discordUrl, |
| 22 | + ...props |
| 23 | +}: ProjectCardProps & LinkProps) { |
11 | 24 | return (
|
12 |
| - <Link href={url} isExternal h="full" {...props}> |
13 |
| - <Card |
14 |
| - bg="darkBlue" |
15 |
| - borderRadius="18px" |
16 |
| - color="white" |
17 |
| - border="1px" |
18 |
| - borderColor="alabaster.950" |
19 |
| - padding="55px 34px 55px 34px" |
20 |
| - w="full" |
21 |
| - h="full" |
22 |
| - _hover={{ borderColor: "ceruleanBlue" }} |
23 |
| - > |
24 |
| - <HStack gap="8px" mb="2rem" wrap="wrap"> |
25 |
| - {categories.map((category) => ( |
26 |
| - <Tag variant="outline" key={category}> |
27 |
| - {category} |
28 |
| - </Tag> |
29 |
| - ))} |
30 |
| - </HStack> |
31 |
| - <CardBody padding={0}> |
32 |
| - <Heading fontSize="24px" lineHeight="33px"> |
33 |
| - {title} |
34 |
| - </Heading> |
35 |
| - <Text mt="1rem" gap="10px" fontSize="14px" lineHeight="22.4px"> |
36 |
| - {description} |
37 |
| - </Text> |
38 |
| - </CardBody> |
39 |
| - </Card> |
40 |
| - </Link> |
| 25 | + <Card |
| 26 | + bg="darkBlue" |
| 27 | + borderRadius="18px" |
| 28 | + color="white" |
| 29 | + border="1px" |
| 30 | + borderColor="alabaster.950" |
| 31 | + padding="34px" |
| 32 | + w="full" |
| 33 | + h="full" |
| 34 | + _hover={{ borderColor: "ceruleanBlue" }} |
| 35 | + > |
| 36 | + <HStack gap="8px" mb="2rem" wrap="wrap"> |
| 37 | + {categories.map((category) => ( |
| 38 | + <Tag variant="outline" key={category}> |
| 39 | + {category} |
| 40 | + </Tag> |
| 41 | + ))} |
| 42 | + </HStack> |
| 43 | + <CardBody padding={0}> |
| 44 | + <Heading fontSize="24px" lineHeight="33px"> |
| 45 | + {title} |
| 46 | + </Heading> |
| 47 | + <Text mt="1rem" gap="10px" fontSize="14px" lineHeight="22.4px"> |
| 48 | + {description} |
| 49 | + </Text> |
| 50 | + </CardBody> |
| 51 | + {(url || githubUrl || discordUrl) && ( |
| 52 | + <CardFooter pb="0" pl="0"> |
| 53 | + <HStack> |
| 54 | + {githubUrl && ( |
| 55 | + <Link href={githubUrl} isExternal> |
| 56 | + <IconGithub boxSize={{ base: "16px", md: "24px" }} /> |
| 57 | + </Link> |
| 58 | + )} |
| 59 | + {url && ( |
| 60 | + <Link href={url} isExternal> |
| 61 | + <IconWebsite boxSize={{ base: "16px", md: "24px" }} /> |
| 62 | + </Link> |
| 63 | + )} |
| 64 | + {discordUrl && ( |
| 65 | + <Link href={discordUrl} isExternal> |
| 66 | + <IconDiscord boxSize={{ base: "16px", md: "24px" }} /> |
| 67 | + </Link> |
| 68 | + )} |
| 69 | + </HStack> |
| 70 | + </CardFooter> |
| 71 | + )} |
| 72 | + </Card> |
41 | 73 | )
|
42 | 74 | }
|
0 commit comments