feat: unified loader

This commit is contained in:
TrèsAbhi committed 2024-01-05 15:01:45 -06:00
1 parent 884531700b
commit cb6ce4f183
7 files changed
+63 -37

No files matched your search

+37
View File
@@ -0,0 +1,37 @@
import { blackA } from '@radix-ui/colors';
import { Flex } from '@radix-ui/themes';
import { PuffLoader } from 'react-spinners';
import { theme } from '../../../stitches.config';
const NAV_HEIGHT = 52.65;
interface LoaderProps {
naked?: boolean;
color?: string;
}
export function Loader({ naked, color }: LoaderProps) {
const animation = (
<PuffLoader color={color ?? theme.colors.solidBackground} />
);
if (naked) return animation;
return (
<Flex
style={{
backgroundColor: blackA.blackA10,
position: 'fixed',
top: NAV_HEIGHT,
left: 0,
width: '100%',
height: `calc(100% - ${NAV_HEIGHT}px)`,
padding: theme.spaces.paddingMajor,
}}
align="center"
justify="center"
>
{animation}
</Flex>
);
}