svgl/src/components/svgCard.tsx

38 lines
1.0 KiB
TypeScript
Raw Normal View History

2022-06-04 23:48:13 +01:00
import React from "react";
import { SVGCardProps } from "@/interfaces/components";
2022-06-24 13:31:15 +01:00
import { Box, Center, Image, Text, useColorModeValue } from "@chakra-ui/react";
import Tap from "@/animations/tap";
import CustomLink from "@/common/link";
2022-06-04 23:48:13 +01:00
const SVGCard = (props: SVGCardProps) => {
const bg = useColorModeValue("bg.light", "bg.dark");
return (
2022-06-24 13:31:15 +01:00
<Tap>
<CustomLink href={`/svg/${props.id}`}>
<Box
bg={bg}
p={4}
cursor="pointer"
borderRadius="10px"
borderWidth="1px"
mb="2"
_hover={{
/* shadow: "md", */
border:"1px solid rgb(0,0,0, .1)",
transform: "scale(0.98)",
2022-06-24 13:31:15 +01:00
}}
transition="all 0.2s" >
2022-06-24 13:31:15 +01:00
<Center>
<Image boxSize="50px" src={props.svg} alt={props.title} />
</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;