All files / src/shared/ContextualMenu ContextualMenuHeader.tsx

50% Statements 3/6
100% Branches 0/0
0% Functions 0/3
75% Lines 3/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          143x             143x                           143x                                
import { Box } from "@mui/material";
import { CaretLeftIcon } from "@phosphor-icons/react";
import GiveText from "@shared/Text/GiveText";
import { styled } from "@theme/v2/Provider";
 
const MenuHeaderContainer = styled(Box)(() => ({
  padding: "8px 12px 16px 12px",
  display: "flex",
  alignItems: "center",
  justifyContent: "space-between",
}));
 
const MenuBackIconContainer = styled(Box)(({ theme }) => ({
  padding: "4px",
  borderRadius: "50%",
  background: theme.palette.primitive?.neutral[5],
  width: "26px",
  height: "26px",
  cursor: "pointer",
}));
 
interface ContextualMenuHeaderProps {
  onBackClick: () => void;
  title: string;
}
 
export const ContextualMenuHeader = ({
  onBackClick,
  title,
}: ContextualMenuHeaderProps) => {
  return (
    <MenuHeaderContainer>
      <MenuBackIconContainer onClick={onBackClick}>
        <CaretLeftIcon size={18} />
      </MenuBackIconContainer>
      <GiveText variant="bodyS">{title}</GiveText>
      <div />
    </MenuHeaderContainer>
  );
};
 
export default ContextualMenuHeader;