move to git.n39.euall books in the bag ...
This commit is contained in:
commit
8cc2662092
64 changed files with 134252 additions and 0 deletions
frontend/src/shared/components/modals
54
frontend/src/shared/components/modals/Modals.tsx
Normal file
54
frontend/src/shared/components/modals/Modals.tsx
Normal file
|
@ -0,0 +1,54 @@
|
|||
import React from "react";
|
||||
import { AuthenticationModal } from "./AuthenticationModal";
|
||||
import { modalTypes } from "./types";
|
||||
import { BookModal } from "./BookModal";
|
||||
import { CheckoutBookModal } from "./CheckoutModal";
|
||||
import { ScannerModal } from "./ScannerModal";
|
||||
import { DeleteBookModal } from "./DeleteBookModal";
|
||||
import { ModalContextType } from "../../../App";
|
||||
|
||||
const { auth, book, checkout, scanner, del } = modalTypes;
|
||||
|
||||
export const ModalSelector = ({
|
||||
activeModal,
|
||||
setActiveModal,
|
||||
}: ModalContextType): React.JSX.Element => (
|
||||
<>
|
||||
<AuthenticationModal
|
||||
open={activeModal?.type === auth}
|
||||
onClose={setActiveModal}
|
||||
isUpdate={activeModal?.type === auth ? activeModal.isUpdate : undefined}
|
||||
/>
|
||||
<BookModal
|
||||
open={activeModal?.type === book}
|
||||
onClose={
|
||||
activeModal?.type === book ? activeModal.onClose : setActiveModal
|
||||
}
|
||||
book={activeModal?.type === book ? activeModal.book : undefined}
|
||||
/>
|
||||
<CheckoutBookModal
|
||||
open={activeModal?.type === checkout}
|
||||
onClose={
|
||||
activeModal?.type === checkout ? activeModal.onClose : setActiveModal
|
||||
}
|
||||
uuid={activeModal?.type === checkout ? activeModal.uuid : ""}
|
||||
checkoutBy={
|
||||
activeModal?.type === checkout ? activeModal.checkoutBy : undefined
|
||||
}
|
||||
title={activeModal?.type === checkout ? activeModal.title : ""}
|
||||
contact={activeModal?.type === checkout ? activeModal.contact : undefined}
|
||||
/>
|
||||
<ScannerModal
|
||||
open={activeModal?.type === scanner}
|
||||
onClose={setActiveModal}
|
||||
onDetected={
|
||||
activeModal?.type === scanner ? activeModal.onDetect : undefined
|
||||
}
|
||||
/>
|
||||
<DeleteBookModal
|
||||
open={activeModal?.type === del}
|
||||
onClose={activeModal?.type === del ? activeModal.onClose : setActiveModal}
|
||||
uuid={activeModal?.type === checkout ? activeModal.uuid : ""}
|
||||
/>
|
||||
</>
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue