All files / src/pages/TermsOfService TermsOfService.tsx

90% Statements 9/10
75% Branches 3/4
100% Functions 2/2
100% Lines 8/8

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                  52x 12x 12x 12x 3x     12x                         52x         52x                    
import styled from "@emotion/styled";
import GiveLogo from "@assets/images/GiveLogo.png";
import { memo } from "react";
import { TosWrapper } from "./TosWrapper";
import TermsOfServiceContentProvider from "./TermsOfServiceContentProvider";
import TermsOfServiceContentGeneral from "./TermsOfServiceContentGeneral";
import TermsOfServiceContentMerchant from "./TermsOfServiceContentMerchant";
import { TermsOfServiceProps } from "./types";
 
const TermsOfService = ({ customStyles, ...props }: TermsOfServiceProps) => {
  const ContentComponent = (() => {
    Iif (props?.isGeneral) return TermsOfServiceContentGeneral;
    if (props?.isEnterPrise) return TermsOfServiceContentProvider;
    return TermsOfServiceContentMerchant;
  })();
 
  return (
    <TosWrapper customStyles={customStyles} data-testid="ToS-modal">
      <Header>
        <img src={GiveLogo} alt="Give Logo" style={{ height: "100%" }} />
      </Header>
      <main>
        <ContentComponent {...props} />
      </main>
      <Footer>© {new Date().getFullYear()} GiveCorporation, Inc.</Footer>
    </TosWrapper>
  );
};
 
const Header = styled.header`
  height: 50px;
  text-align: center;
`;
 
const Footer = styled.footer`
  text-align: center;
  margin: 0 auto;
  margin-top: 20px;
  background: #fafafa;
  color: #767f84;
  font-size: 14px;
`;
 
export default memo(TermsOfService);