All files / src/pages/MerchantCheckout/components MerchantCheckoutTitle.tsx

100% Statements 9/9
100% Branches 2/2
100% Functions 4/4
100% Lines 6/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          1x 6x 6x                       6x                   5x           5x                
import { Box, Stack } from "@mui/material";
import GiveText from "@shared/Text/GiveText";
import { styled } from "@theme/v2/Provider";
import useGetCheckoutInfo from "@pages/MerchantCheckout/hooks/useGetCheckoutInfo";
 
const MerchantCheckoutTitle = () => {
  const { imageUrl, merchantName: title } = useGetCheckoutInfo();
  return (
    <StyledContainer>
      {imageUrl && (
        <ImageContainer>
          <Image src={imageUrl} />
        </ImageContainer>
      )}
      <GiveText variant="h3">{title}</GiveText>
    </StyledContainer>
  );
};
 
const StyledContainer = styled(Stack)(({ theme }) => ({
  flexDirection: "row",
  gap: theme.spacing(1.5),
  paddingBottom: theme.spacing(5.5),
  alignItems: "center",
  [theme.breakpoints.down("v2_sm")]: {
    paddingBottom: theme.spacing(1),
  },
}));
 
const ImageContainer = styled(Box)(({ theme }) => ({
  borderRadius: theme.spacing(1),
  width: 44,
  height: 44,
}));
 
const Image = styled("img")(({ theme }) => ({
  width: "100%",
  height: "100%",
  objectFit: "cover",
  borderRadius: theme.spacing(1.5),
}));
 
export default MerchantCheckoutTitle;