All files / src/pages/ManageMoney/Modal ManageMoneyFilterModal.tsx

100% Statements 4/4
100% Branches 0/0
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 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72                1x 10x                             14x 13x                                                                                            
import ModalFactory from "@common/Modal/ModalFactory/ModalFactory";
import NiceModal from "@ebay/nice-modal-react";
import useManageMoneyFilter from "./useManageMoneyFilter";
import { FormProvider } from "react-hook-form";
import { Box } from "@mui/material";
import { ModalActions, ModalTitle } from "@common/Modal/ModalFactory/atoms";
import ModalContent from "@common/TableFilters/ModalContent";
 
const ManageMoneyFilterModal = NiceModal.create(() => {
  return <ManageMoneyFilterModalV1 />;
});
 
export default ManageMoneyFilterModal;
 
function ManageMoneyFilterModalV1() {
  const {
    onClose,
    SlideProps,
 
    open,
    methods,
    onSubmit,
    actions,
    filterSections,
  } = useManageMoneyFilter();
  return (
    <ModalFactory
      variant="sidepanel"
      modalProps={{
        open,
        onClose: onClose,
        SlideProps,
        SidePanelProps: {
          width: "500px",
        },
      }}
    >
      <FormProvider {...methods}>
        <Box
          width="100%"
          height="100%"
          display="flex"
          sx={{
            padding: "16px",
            gap: "24px",
            flexDirection: "column",
            justifyContent: "space-between",
            overflow: "hidden",
          }}
          component="form"
          onSubmit={methods.handleSubmit(onSubmit)}
        >
          <ModalTitle
            title="Filter by"
            textStyles={{
              title: {
                fontSize: "18px",
                lineHeight: "21.6px",
                letterSpacing: "-0.18px",
              },
            }}
            closeButtonSize={24}
            onClose={onClose}
          />
          <ModalContent sections={filterSections} />
          <ModalActions animationDelay={250} {...actions} />
        </Box>
      </FormProvider>
    </ModalFactory>
  );
}