Color-mode specific styling for LoadingScreen

This commit is contained in:
klotske
2023-01-11 23:42:19 +03:00
parent 0eed9b5126
commit 802701d776
@@ -1,13 +1,15 @@
import { Box, Progress, Text } from "@chakra-ui/react";
import { Box, Center, Progress, Text, useColorModeValue } from "@chakra-ui/react";
export const LoadingScreen = ({ text = "Loading..." } = {}) => {
const mainBgClasses = useColorModeValue("bg-slate-300 text-gray-900", "bg-slate-900 text-white");
return (
<Box width="full">
<Box width="full" className={mainBgClasses}>
<Progress size="sm" isIndeterminate />
{text && (
<Box width="full">
<Center width="full" className="p-12">
<Text fontFamily="Inter">{text}</Text>
</Box>
</Center>
)}
</Box>
);