From 64a525b83be188b592249d00588df63b4db62b1d Mon Sep 17 00:00:00 2001 From: Philipp Rich Date: Sat, 16 Mar 2024 18:35:56 +0400 Subject: [PATCH] added new record initial state resolves #87 --- .../InstitutionContainer.jsx | 8 +- .../InstitutionsList/InstitutionsList.jsx | 78 ++++++++++++++++--- components/RecordForm/RecordForm.jsx | 3 +- public/institutions-loaded.svg | 1 + 4 files changed, 74 insertions(+), 16 deletions(-) create mode 100644 public/institutions-loaded.svg diff --git a/components/InstitutionContainer/InstitutionContainer.jsx b/components/InstitutionContainer/InstitutionContainer.jsx index ad562c3..36676f2 100644 --- a/components/InstitutionContainer/InstitutionContainer.jsx +++ b/components/InstitutionContainer/InstitutionContainer.jsx @@ -29,10 +29,10 @@ export function InstitutionContainer({ institutionName, isInstitutionOpen }) { return ( {isInstitutionOpen && ( - - {institutions.map((institution, index) => ( - - - - ))} - + {isInstitutionOpen || ( + {selectedInstitution === null ? ( + + ) : ( + false + )} + {institutions.map((institution, index) => ( + + + + ))} + + ); +} + +function ContentPanelOverlay({ image, headingText, text }) { + return ( +
+ + Illustration + + + + {headingText} + + {text} + + +
+ ); +} diff --git a/components/RecordForm/RecordForm.jsx b/components/RecordForm/RecordForm.jsx index 3a954ef..523593c 100644 --- a/components/RecordForm/RecordForm.jsx +++ b/components/RecordForm/RecordForm.jsx @@ -22,7 +22,8 @@ import { handleSavingSuccess, handleSavingError } from "./handlers"; export function RecordForm() { const [isInstitutionOpen, setIsInstitutionOpen] = useState(false); - const [selectedInstitutionIndex, setSelectedInstitutionIndex] = useState(0); + const [selectedInstitutionIndex, setSelectedInstitutionIndex] = + useState(null); const [formOverlay, setFormOverlay] = useState(false); const [warningState, setWarningState] = useState(null); const toast = useToast({ position: "top" }); diff --git a/public/institutions-loaded.svg b/public/institutions-loaded.svg new file mode 100644 index 0000000..15bcde7 --- /dev/null +++ b/public/institutions-loaded.svg @@ -0,0 +1 @@ + \ No newline at end of file