All files / src/shared/GiveExportModal GiveExportModal.tsx

100% Statements 5/5
100% Branches 0/0
100% Functions 2/2
100% Lines 5/5

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                      22x   22x 3x   22x                           4x    
import useNiceModal from "@common/Modal/ModalFactory/hooks/useNiceModal";
import NiceModal from "@ebay/nice-modal-react";
import GiveSidePanel from "@shared/SidePanel/GiveSidePanel";
import { GIVE_EXPORT_MODAL } from "modals/modal_names";
import GiveExportContent from "./components/GiveExportContent";
import { EXPORT_PANEL_WIDTH } from "./const";
import { ContentProps } from "./giveExportTypes";
 
type Props = Omit<ContentProps, "handleClose">;
 
function GiveExportModalBase({ fieldTypes, merchantID, counts, tab, hasFilters }: Props) {
  const { open } = useNiceModal();
 
  const handleClose = () => {
    NiceModal.remove(GIVE_EXPORT_MODAL);
  };
  return (
    <GiveSidePanel width={EXPORT_PANEL_WIDTH} open={open} onClose={handleClose}>
      <GiveExportContent
        handleClose={handleClose}
        fieldTypes={fieldTypes}
        merchantID={merchantID}
        counts={counts}
        tab={tab}
        hasFilters={hasFilters}
      />
    </GiveSidePanel>
  );
}
 
const GiveExportModal = NiceModal.create(GiveExportModalBase);
export default GiveExportModal;