svgl/src/components/svgCard.tsx

48 lines
1.2 KiB
TypeScript
Raw Normal View History

2022-06-04 23:48:13 +01:00
import React from "react";
import { SVGCardProps } from "@/interfaces/components";
2022-07-24 23:40:18 +01:00
import {
Box,
Center,
Image,
Text,
useColorModeValue,
useDisclosure,
} from "@chakra-ui/react";
2022-06-24 13:31:15 +01:00
import Tap from "@/animations/tap";
import CustomLink from "@/common/link";
2022-08-01 17:42:12 +01:00
import { Smiley } from "phosphor-react";
2022-06-04 23:48:13 +01:00
const SVGCard = (props: SVGCardProps) => {
const bg = useColorModeValue("bg.light", "bg.dark");
2022-07-24 00:55:46 -04:00
const color = useColorModeValue("rgb(0,0,0, .1)", "rgb(255,255,255, .1)");
2022-06-04 23:48:13 +01:00
return (
2022-07-24 23:40:18 +01:00
<>
<Tap>
<CustomLink href={`/svg/${props.id}`}>
<Box
bg={bg}
p={4}
cursor="pointer"
borderRadius="10px"
borderWidth="1px"
mb="2"
_hover={{
2022-07-26 15:05:26 -04:00
border:`1px solid ${color}`,
2022-08-01 17:42:12 +01:00
transform: "scale(1.04)",
2022-07-24 23:40:18 +01:00
}}
2022-07-26 15:05:26 -04:00
transition="all 0.2s" >
2022-07-24 23:40:18 +01:00
<Center>
2022-08-01 17:42:12 +01:00
<Image boxSize="45px" src={props.svg} alt={props.title} />
2022-07-24 23:40:18 +01:00
</Center>
<Text mt="2" fontWeight="light" textAlign="center">
{props.title}
</Text>
</Box>
</CustomLink>
</Tap>
</>
2022-06-04 23:48:13 +01:00
);
};
export default SVGCard;