From 4fe4aa6b748ce6779a1d60642d0daa9c8510d108 Mon Sep 17 00:00:00 2001 From: Anton Date: Sun, 20 Aug 2023 13:11:57 +0200 Subject: [PATCH] Modularization of Item Popups --- dependency-graph.svg | 797 ++++++++++-------- src/Components/AppShell/DialogModal.tsx | 4 +- src/Components/Input/TextAreaInput.tsx | 13 +- src/Components/Map/Layer.tsx | 2 +- .../Map/Subcomponents/ItemFormPopup.tsx | 6 +- .../Map/Subcomponents/ItemViewPopup.tsx | 101 +-- src/Components/Map/UtopiaMap.tsx | 4 +- src/Components/Map/index.tsx | 2 +- src/Components/Profile/Settings.tsx | 12 +- src/index.tsx | 2 +- 10 files changed, 491 insertions(+), 452 deletions(-) diff --git a/dependency-graph.svg b/dependency-graph.svg index 19f70394..302d0af2 100644 --- a/dependency-graph.svg +++ b/dependency-graph.svg @@ -4,87 +4,87 @@ - - + + dependency-cruiser output - + cluster_src - -src + +src cluster_src/Components - -Components + +Components cluster_src/Components/AppShell - -AppShell + +AppShell cluster_src/Components/Auth - -Auth + +Auth cluster_src/Components/Gaming - -Gaming + +Gaming cluster_src/Components/Input - -Input + +Input cluster_src/Components/Map - -Map + +Map cluster_src/Components/Map/Subcomponents - -Subcomponents + +Subcomponents cluster_src/Components/Map/hooks - -hooks + +hooks cluster_src/Components/Profile - -Profile + +Profile cluster_src/Components/Templates - -Templates + +Templates cluster_src/Components/Typography - -Typography + +Typography cluster_src/SampleData - -SampleData + +SampleData cluster_src/Utils - -Utils + +Utils src/Components/AppShell/AppShell.tsx - -AppShell.tsx + +AppShell.tsx @@ -92,616 +92,739 @@ src/Components/AppShell/NavBar.tsx - -NavBar.tsx + +NavBar.tsx src/Components/AppShell/AppShell.tsx->src/Components/AppShell/NavBar.tsx - - + + + + + +src/Components/AppShell/DialogModal.tsx + + +DialogModal.tsx + + + + + +src/Components/AppShell/NavBar.tsx->src/Components/AppShell/DialogModal.tsx + + src/Components/AppShell/Content.tsx - -Content.tsx + +Content.tsx - + src/Components/AppShell/SideBar.tsx - - -SideBar.tsx + + +SideBar.tsx - + src/Components/AppShell/SidebarSubmenu.tsx - - -SidebarSubmenu.tsx + + +SidebarSubmenu.tsx - + src/Components/AppShell/SideBar.tsx->src/Components/AppShell/SidebarSubmenu.tsx - - + + - + src/Components/AppShell/index.tsx - - -index.tsx + + +index.tsx - + src/Components/AppShell/index.tsx->src/Components/AppShell/AppShell.tsx - - + + - + src/Components/AppShell/index.tsx->src/Components/AppShell/Content.tsx - - + + - + src/Components/AppShell/index.tsx->src/Components/AppShell/SideBar.tsx - - + + - - -src/Components/Auth/index.tsx - - -index.tsx + + +src/Components/Auth/LoginPage.tsx + + +LoginPage.tsx + + +src/Components/Input/InputText.tsx + + +InputText.tsx + + + + + +src/Components/Auth/LoginPage.tsx->src/Components/Input/InputText.tsx + + + + + +src/Components/Typography/ErrorText.tsx + + +ErrorText.tsx + + + + + +src/Components/Auth/LoginPage.tsx->src/Components/Typography/ErrorText.tsx + + + + + +src/Components/Auth/SignupPage.tsx + + +SignupPage.tsx + + + + + +src/Components/Auth/SignupPage.tsx->src/Components/Input/InputText.tsx + + + + + +src/Components/Auth/SignupPage.tsx->src/Components/Typography/ErrorText.tsx + + + + + +src/Components/Auth/index.tsx + + +index.tsx + + + + + +src/Components/Auth/index.tsx->src/Components/Auth/LoginPage.tsx + + + + + +src/Components/Auth/index.tsx->src/Components/Auth/SignupPage.tsx + + + - + src/Components/Auth/useAuth.tsx - - -useAuth.tsx + + +useAuth.tsx - + src/Components/Auth/index.tsx->src/Components/Auth/useAuth.tsx - - + + - + src/Components/Gaming/Modal.tsx - - -Modal.tsx + + +Modal.tsx - + src/Components/Gaming/Quests.tsx - - -Quests.tsx + + +Quests.tsx - + src/Components/Gaming/index.tsx - - -index.tsx + + +index.tsx - + src/Components/Gaming/index.tsx->src/Components/Gaming/Modal.tsx - - + + - + src/Components/Gaming/index.tsx->src/Components/Gaming/Quests.tsx - - - - - -src/Components/Input/InputText.tsx - - -InputText.tsx - - + + - + src/Components/Input/TextAreaInput.tsx - - -TextAreaInput.tsx + + +TextAreaInput.tsx - + src/Components/Map/Layer.tsx - - -Layer.tsx + + +Layer.tsx - + src/Utils/MarkerIconFactory.ts - - -MarkerIconFactory.ts + + +MarkerIconFactory.ts - + src/Components/Map/Layer.tsx->src/Utils/MarkerIconFactory.ts - - + + - + src/Components/Map/hooks/useItems.tsx - - -useItems.tsx + + +useItems.tsx - + src/Components/Map/Layer.tsx->src/Components/Map/hooks/useItems.tsx - - + + - + src/Components/Map/hooks/useLayers.tsx - - -useLayers.tsx + + +useLayers.tsx - + src/Components/Map/Layer.tsx->src/Components/Map/hooks/useLayers.tsx - - + + - + src/Components/Map/hooks/useTags.tsx - - -useTags.tsx + + +useTags.tsx - + src/Components/Map/Layer.tsx->src/Components/Map/hooks/useTags.tsx - - + + - + src/Components/Map/Subcomponents/ItemFormPopup.tsx - - -ItemFormPopup.tsx + + +ItemFormPopup.tsx - + src/Components/Map/Layer.tsx->src/Components/Map/Subcomponents/ItemFormPopup.tsx - - + + - + src/Components/Map/Subcomponents/ItemViewPopup.tsx - - -ItemViewPopup.tsx + + +ItemViewPopup.tsx - + src/Components/Map/Layer.tsx->src/Components/Map/Subcomponents/ItemViewPopup.tsx - - + + - + src/Components/Map/Subcomponents/ItemFormPopup.tsx->src/Components/Map/hooks/useItems.tsx - - + + - + src/types.ts - - -types.ts + + +types.ts - + src/Components/Map/Subcomponents/ItemFormPopup.tsx->src/types.ts - - + + - - -src/Components/Map/Subcomponents/ItemViewPopup.tsx->src/Components/Map/hooks/useItems.tsx - - - - - -src/Components/Map/Subcomponents/ItemViewPopup.tsx->src/Components/Map/hooks/useTags.tsx - - - - - -src/Utils/HeighlightTags.ts - - -HeighlightTags.ts + + +src/Components/Map/Subcomponents/HeaderView.tsx + + +HeaderView.tsx - - -src/Components/Map/Subcomponents/ItemViewPopup.tsx->src/Utils/HeighlightTags.ts - - + + +src/Components/Map/Subcomponents/ItemViewPopup.tsx->src/Components/Map/Subcomponents/HeaderView.tsx + + - - -src/Utils/ReplaceURLs.ts - - -ReplaceURLs.ts + + +src/Components/Map/Subcomponents/StartEndView.tsx + + +StartEndView.tsx - - -src/Components/Map/Subcomponents/ItemViewPopup.tsx->src/Utils/ReplaceURLs.ts - - + + +src/Components/Map/Subcomponents/ItemViewPopup.tsx->src/Components/Map/Subcomponents/StartEndView.tsx + + + + + +src/Components/Map/Subcomponents/TextView.tsx + + +TextView.tsx + + + + + +src/Components/Map/Subcomponents/ItemViewPopup.tsx->src/Components/Map/Subcomponents/TextView.tsx + + - + src/Components/Map/Subcomponents/AddButton.tsx - - -AddButton.tsx + + +AddButton.tsx - + src/Components/Map/Subcomponents/AddButton.tsx->src/Components/Map/hooks/useLayers.tsx - - + + - + src/Utils/DynamicHeroIcon.tsx - - -DynamicHeroIcon.tsx + + +DynamicHeroIcon.tsx - + src/Components/Map/Subcomponents/AddButton.tsx->src/Utils/DynamicHeroIcon.tsx - - + + + + + +src/Components/Map/Subcomponents/HeaderView.tsx->src/Components/Map/hooks/useItems.tsx + + + + + +src/Components/Map/Subcomponents/TextView.tsx->src/Components/Map/hooks/useTags.tsx + + + + + +src/Utils/HeighlightTags.ts + + +HeighlightTags.ts + + + + + +src/Components/Map/Subcomponents/TextView.tsx->src/Utils/HeighlightTags.ts + + + + + +src/Utils/ReplaceURLs.ts + + +ReplaceURLs.ts + + + + + +src/Components/Map/Subcomponents/TextView.tsx->src/Utils/ReplaceURLs.ts + + - + src/Components/Map/Tags.tsx - - -Tags.tsx + + +Tags.tsx - + src/Components/Map/Tags.tsx->src/Components/Map/hooks/useTags.tsx - - + + - + src/Components/Map/UtopiaMap.css - - -UtopiaMap.css + + +UtopiaMap.css - + src/Components/Map/UtopiaMap.tsx - - -UtopiaMap.tsx + + +UtopiaMap.tsx - + src/Components/Map/UtopiaMap.tsx->src/Components/Map/hooks/useItems.tsx - - + + - + src/Components/Map/UtopiaMap.tsx->src/Components/Map/hooks/useLayers.tsx - - + + - + src/Components/Map/UtopiaMap.tsx->src/Components/Map/hooks/useTags.tsx - - + + - + src/Components/Map/UtopiaMap.tsx->src/Components/Map/Subcomponents/AddButton.tsx - - + + - + src/Components/Map/UtopiaMap.tsx->src/types.ts - - + + - + src/Components/Map/UtopiaMap.tsx->src/Components/Map/UtopiaMap.css - - + + - + src/Components/Map/index.tsx - - -index.tsx + + +index.tsx - + src/Components/Map/index.tsx->src/Components/Map/Layer.tsx - - + + - + src/Components/Map/index.tsx->src/Components/Map/Tags.tsx - - + + - + src/Components/Map/index.tsx->src/Components/Map/UtopiaMap.tsx - - + + - + src/Components/Profile/Settings.tsx - - -Settings.tsx + + +Settings.tsx - + src/Components/Profile/Settings.tsx->src/Components/Input/InputText.tsx - - + + - + src/Components/Profile/Settings.tsx->src/Components/Input/TextAreaInput.tsx - - + + - + src/Components/Templates/TitleCard.tsx - - -TitleCard.tsx + + +TitleCard.tsx - + src/Components/Profile/Settings.tsx->src/Components/Templates/TitleCard.tsx - - + + - + src/Components/Typography/Subtitle.tsx - - -Subtitle.tsx + + +Subtitle.tsx - + src/Components/Templates/TitleCard.tsx->src/Components/Typography/Subtitle.tsx - - + + - + src/Components/Profile/index.tsx - - -index.tsx + + +index.tsx - + src/Components/Profile/index.tsx->src/Components/Profile/Settings.tsx - - + + - + src/Components/Templates/CardPage.tsx - - -CardPage.tsx + + +CardPage.tsx - + src/Components/Templates/CardPage.tsx->src/Components/Templates/TitleCard.tsx - - + + - + src/Components/Templates/index.tsx - + index.tsx - + src/Components/Templates/index.tsx->src/Components/Templates/TitleCard.tsx - - + + - + src/Components/Templates/index.tsx->src/Components/Templates/CardPage.tsx - - + + - + src/SampleData/data.js - - -data.js + + +data.js - + src/index.css - - -index.css + + +index.css - + src/index.tsx - - -index.tsx + + +index.tsx - + src/index.tsx->src/Components/AppShell/index.tsx - - + + - + src/index.tsx->src/Components/Auth/index.tsx - - + + - + src/index.tsx->src/Components/Gaming/index.tsx - - + + - + src/index.tsx->src/Components/Map/index.tsx - - + + - + src/index.tsx->src/Components/Profile/index.tsx - - + + - + src/index.tsx->src/Components/Templates/index.tsx - - + + - + src/index.tsx->src/index.css - - + + diff --git a/src/Components/AppShell/DialogModal.tsx b/src/Components/AppShell/DialogModal.tsx index 30ab1d3f..c9577806 100644 --- a/src/Components/AppShell/DialogModal.tsx +++ b/src/Components/AppShell/DialogModal.tsx @@ -31,16 +31,18 @@ const DialogModal = ({ useEffect(() => { if (isOpened) { ref.current?.showModal(); + ref.current?.classList.remove("tw-hidden"); document.body.classList.add("modal-open"); // prevent bg scroll } else { ref.current?.close(); + ref.current?.classList.add("tw-hidden"); document.body.classList.remove("modal-open"); } }, [isOpened]); return ( - void; @@ -13,7 +14,7 @@ type TextAreaProps = { -function TextAreaInput({labelTitle, labelStyle, containerStyle, defaultValue, placeholder, updateFormValue} : TextAreaProps){ +function TextAreaInput({labelTitle, labelStyle, containerStyle, inputStyle, defaultValue, placeholder, updateFormValue} : TextAreaProps){ const [value, setValue] = useState(defaultValue) @@ -28,11 +29,11 @@ function TextAreaInput({labelTitle, labelStyle, containerStyle, defaultValue, pl } return( -
-