⚒️ Add loaders.

This commit is contained in:
pheralb 2022-06-28 13:17:36 +01:00
parent e7ec89a8c6
commit 4cca689a95
2 changed files with 7 additions and 4 deletions

View File

@ -1,11 +1,12 @@
import { LoadingProps } from "@/interfaces/components";
import { Center, Spinner, Text, VStack } from "@chakra-ui/react";
import { LeapFrog } from "@uiball/loaders";
const Loading = (props: LoadingProps) => {
return (
<Center>
<VStack spacing={3}>
<Spinner color="brand.purple" />
<VStack spacing={3} mt="3">
<LeapFrog size={32} speed={2.5} color="#4343E5" />
<Text>{props.text}</Text>
</VStack>
</Center>

View File

@ -2,13 +2,15 @@ import React from "react";
import useSWR from "swr";
import { getCategorySvgs } from "@/services";
import CustomLink from "@/common/link";
import { Box, Text } from "@chakra-ui/react";
import { Box } from "@chakra-ui/react";
import { RaceBy } from "@uiball/loaders";
const Categories = () => {
const { data, error } = useSWR(getCategorySvgs);
if (error) return <div>failed to load</div>;
if (!data) return <div>loading...</div>;
if (!data)
return <RaceBy size={52} lineWeight={3} speed={1.4} color="#4343E5" />;
return (
<>