Merge pull request #2 from darioesp/main

⚒️ Added file .nvmrc, minors changes of styles and fix hover
This commit is contained in:
Pablo Hdez 2022-07-27 21:51:50 +02:00 committed by GitHub
commit 401549d4ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 13 deletions

1
.nvmrc Normal file
View File

@ -0,0 +1 @@
v16.15.1

View File

@ -13,6 +13,7 @@ import CustomLink from "@/common/link";
const SVGCard = (props: SVGCardProps) => { const SVGCard = (props: SVGCardProps) => {
const bg = useColorModeValue("bg.light", "bg.dark"); const bg = useColorModeValue("bg.light", "bg.dark");
const color = useColorModeValue("rgb(0,0,0, .1)", "rgb(255,255,255, .1)");
return ( return (
<> <>
<Tap> <Tap>
@ -25,10 +26,10 @@ const SVGCard = (props: SVGCardProps) => {
borderWidth="1px" borderWidth="1px"
mb="2" mb="2"
_hover={{ _hover={{
shadow: "md", border:`1px solid ${color}`,
transform: "scale(0.98)",
}} }}
transition="all 0.2s" transition="all 0.2s" >
>
<Center> <Center>
<Image boxSize="50px" src={props.svg} alt={props.title} /> <Image boxSize="50px" src={props.svg} alt={props.title} />
</Center> </Center>

View File

@ -2,27 +2,35 @@ import React from "react";
import useSWR from "swr"; import useSWR from "swr";
import { getCategorySvgs } from "@/services"; import { getCategorySvgs } from "@/services";
import CustomLink from "@/common/link"; import CustomLink from "@/common/link";
import { Box } from "@chakra-ui/react"; import { Box, useColorModeValue } from "@chakra-ui/react";
import { RaceBy } from "@uiball/loaders"; import { RaceBy } from "@uiball/loaders";
import Tap from "@/animations/tap"; import Tap from "@/animations/tap";
const Categories = () => { const Categories = () => {
const { data, error } = useSWR(getCategorySvgs); const { data, error } = useSWR(getCategorySvgs);
const color = useColorModeValue("rgb(0,0,0, .1)", "rgb(255,255,255, .1)");
if (error) return <div>failed to load</div>; if (error) return <div>failed to load</div>;
if (!data) if (!data)
return <RaceBy size={52} lineWeight={3} speed={1.4} color="#4343E5" />; return <RaceBy size={52} lineWeight={3} speed={1.4} color="#4343E5" />;
return ( return (
<> <>
{data.map((category: string) => ( {data.map((category: string) => (
<Tap key={category}> <Tap key={category}>
<CustomLink href={`/category/${category}`}> <CustomLink
<Box p="4" borderRadius="5px" borderWidth="1px"> href={`/category/${category}`}>
{category} <Box
</Box> p={4}
</CustomLink> borderRadius="4px"
</Tap> borderWidth="1px"
_hover={{
border:`1px solid ${color}`,
transform: "scale(0.98)",
}}>
{category}
</Box>
</CustomLink>
</Tap>
))} ))}
</> </>
); );

View File

@ -104,7 +104,8 @@ const Header = () => {
</Box> </Box>
<Box p="4" overflowX="hidden" overflowY="auto"> <Box p="4" overflowX="hidden" overflowY="auto">
<HStack <HStack
justifyContent={{ base: "none", md: "center" }} justifyContent={{ base: "none", lg: "center" }}
flexWrap={{ base: "initial", lg: "wrap" }}
spacing={4} spacing={4}
overflowX="auto" overflowX="auto"
overflowY="hidden" overflowY="hidden"