All files / src/pages/EmailConfirmation/components pageContainer.tsx

0% Statements 0/11
0% Branches 0/2
0% Functions 0/8
0% Lines 0/9

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 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97                                                                                                                                                                                                 
import React from "react";
import BackgroundImageContainer, {
  BackgroundImageContainerProps,
} from "@common/BackgroundImageContainer";
import { Stack, styled } from "@mui/material";
import Footer from "@pages/Login/Footer";
import { Image } from "@common/StyledImage/Image";
import { Text } from "@common/Text";
import { ITextProps } from "@common/Text/Text";
interface PageContainerProps extends BackgroundImageContainerProps {
  imgSrc: string;
  title: string;
  description?: ITextProps["children"];
  actions?: JSX.Element;
  hideSupport?: boolean;
}
 
const PageContainer = styled<React.FC<PageContainerProps>>(
  ({ title, description, imgSrc, actions, hideSupport, ...rest }) => {
    return (
      <BackgroundImageContainer {...rest}>
        <Wrapper>
          <ContentContainer>
            <Image src={imgSrc} />
            <Text
              color={({ palette }) => palette.neutral["90"]}
              fontSize="24px"
              fontWeight="medium"
              textAlign="center"
              lineHeight="32px"
            >
              {title}
            </Text>
            {description && (
              <Text
                color={({ palette }) => palette.neutral["80"]}
                fontSize="16px"
                fontWeight="regular"
                textAlign="center"
              >
                {description}
              </Text>
            )}
            {actions}
          </ContentContainer>
        </Wrapper>
        <Footer
          linkGoupeWrapperStyle={(theme) => ({
            [theme.breakpoints.down("new_sm")]: {
              width: "100%",
              justifyContent: "space-between",
            },
          })}
          sx={(theme) => ({
            ".MuiTypography-root": {
              fontWeight: 400,
            },
            [theme.breakpoints.down("new_sm")]: {
              flexDirection: "column-reverse",
              gap: "8px",
            },
          })}
        />
      </BackgroundImageContainer>
    );
  },
)(({ theme }) => ({
  display: "flex",
  flexDirection: "column",
  height: "100vh",
  objectFit: "cover",
  backgroundRepeat: "no-repeat",
  backgroundPosition: "90% 100px",
  [theme.breakpoints.down("new_sm")]: {
    backgroundPositionY: "-50px",
  },
}));
 
const Wrapper = styled(Stack)(() => ({
  flex: 1,
  alignItems: "center",
  justifyContent: "center",
}));
 
const ContentContainer = styled(Stack)(({ theme }) => ({
  alignItems: "center",
  width: "50%",
  gap: "30px",
 
  [theme.breakpoints.down("new_sm_md")]: {
    width: "100%",
    padding: "0 25px",
  },
}));
 
export default PageContainer;