All files / src/pages/EmailVerification EmailVerificationPageGenerator.tsx

22.22% Statements 2/9
0% Branches 0/6
0% Functions 0/2
33.33% Lines 2/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49              1x                                                               1x                  
import { NotFoundResourcePage } from "@common/404";
import LoadingSpinner from "@components/Snipper/LoadingSpinner";
import { Box, Stack } from "@mui/material";
import GiveText from "@shared/Text/GiveText";
import { styled } from "@theme/v2/Provider";
import { useEmailVerificationPageFactory } from "./useEmailVerificationPageFactory";
 
const EmailVerificationPageGenerator = () => {
  const { currentStatus, isLoading } = useEmailVerificationPageFactory();
 
  if (isLoading) return <LoadingSpinner />
  if (!currentStatus || !currentStatus.shouldShowPage) return <NotFoundResourcePage />;
 
  return (
    <Box
      alignContent="center"
      justifyContent="center"
      height="100vh"
      margin="0 auto"
    >
      <Stack gap={3} alignItems="center">
        <IconContainer>{currentStatus.icon()}</IconContainer>
        <Stack gap={0.5}>
          <GiveText variant="bodyL" textAlign="center">
            {currentStatus.title}
          </GiveText>
          <GiveText variant="bodyS" color="secondary" textAlign="center">
            {currentStatus.message()}
          </GiveText>
        </Stack>
 
        {currentStatus.action()}
      </Stack>
    </Box>
  );
};
 
export { EmailVerificationPageGenerator };
 
const IconContainer = styled(Box)(({ theme }) => ({
  display: "flex",
  alignItems: "center",
  justifyContent: "center",
  height: "68px",
  width: "68px",
  borderRadius: "64px",
  backgroundColor: theme.palette.primitive?.transparent["darken-5"],
}));