All files / src/pages/Login/components GiveCheckYourEmailContent.tsx

100% Statements 5/5
80% Branches 4/5
100% Functions 2/2
100% Lines 4/4

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 50 51 52 53 54 55 56 57                          2x         2x   2x                                               2x                        
import { Box, Stack } from "@mui/material";
import { EnvelopeSimpleOpenIcon } from "@phosphor-icons/react";
import GiveText from "@shared/Text/GiveText";
import { styled, useAppTheme } from "@theme/v2/Provider";
import { maskEmail } from "@hooks/auth-api/useLoginOTP";
import { ReactNode } from "react";
 
type Props = {
  email: string;
  title?: ReactNode | string;
  description?: ReactNode;
};
 
const GiveCheckYourEmailContent = ({
  email,
  title = "Check your email",
  description,
}: Props) => {
  const { palette } = useAppTheme();
 
  return (
    <Stack gap={"20px"} alignItems="flex-start">
      <IconContainer>
        <EnvelopeSimpleOpenIcon size={24} color={palette.primitive?.blue?.[100]} />
      </IconContainer>
      <Stack gap={"12px"}>
        {typeof title === "string" ? (
          <GiveText variant="h3">{title}</GiveText>
        ) : (
          title
        )}
        <GiveText variant="bodyM" color={"secondary"}>
          {description || (
            <>
              We sent an email to {maskEmail(email)} with a link to change your
              password.
            </>
          )}
        </GiveText>
      </Stack>
    </Stack>
  );
};
 
const IconContainer = styled(Box)(({ theme }) => ({
  width: 48,
  height: 48,
  borderRadius: "50%",
  display: "flex",
  alignItems: "center",
  justifyContent: "center",
  backgroundColor: theme.palette.primitive?.blue?.[10],
}));
 
export default GiveCheckYourEmailContent;