diff --git a/dependency-graph.svg b/dependency-graph.svg index 302d0af2..63564442 100644 --- a/dependency-graph.svg +++ b/dependency-graph.svg @@ -4,87 +4,92 @@ - - + + 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 +cluster_src/Components/Map/Subcomponents/ItemPopupComponents + +ItemPopupComponents -cluster_src/Components/Profile - -Profile +cluster_src/Components/Map/hooks + +hooks -cluster_src/Components/Templates - -Templates +cluster_src/Components/Profile + +Profile -cluster_src/Components/Typography - -Typography +cluster_src/Components/Templates + +Templates -cluster_src/SampleData - -SampleData +cluster_src/Components/Typography + +Typography +cluster_src/SampleData + +SampleData + + cluster_src/Utils - -Utils + +Utils src/Components/AppShell/AppShell.tsx - -AppShell.tsx + +AppShell.tsx @@ -92,38 +97,38 @@ 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 + +DialogModal.tsx src/Components/AppShell/NavBar.tsx->src/Components/AppShell/DialogModal.tsx - - + + src/Components/AppShell/Content.tsx - -Content.tsx + +Content.tsx @@ -131,8 +136,8 @@ src/Components/AppShell/SideBar.tsx - -SideBar.tsx + +SideBar.tsx @@ -140,146 +145,146 @@ 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/LoginPage.tsx - -LoginPage.tsx + +LoginPage.tsx - + -src/Components/Input/InputText.tsx - - -InputText.tsx +src/Components/Input/TextInput.tsx + + +TextInput.tsx - + -src/Components/Auth/LoginPage.tsx->src/Components/Input/InputText.tsx - - +src/Components/Auth/LoginPage.tsx->src/Components/Input/TextInput.tsx + + src/Components/Typography/ErrorText.tsx - -ErrorText.tsx + +ErrorText.tsx src/Components/Auth/LoginPage.tsx->src/Components/Typography/ErrorText.tsx - - + + src/Components/Auth/SignupPage.tsx - -SignupPage.tsx + +SignupPage.tsx - + -src/Components/Auth/SignupPage.tsx->src/Components/Input/InputText.tsx - - +src/Components/Auth/SignupPage.tsx->src/Components/Input/TextInput.tsx + + src/Components/Auth/SignupPage.tsx->src/Components/Typography/ErrorText.tsx - - + + src/Components/Auth/index.tsx - -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 @@ -287,8 +292,8 @@ src/Components/Gaming/Quests.tsx - -Quests.tsx + +Quests.tsx @@ -296,535 +301,655 @@ 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/TextAreaInput.tsx - -TextAreaInput.tsx + +TextAreaInput.tsx + + + + + +src/Components/Input/index.tsx + + +index.tsx + + + + + +src/Components/Input/index.tsx->src/Components/Input/TextInput.tsx + + + + + +src/Components/Input/index.tsx->src/Components/Input/TextAreaInput.tsx + + + + + +src/Components/Map/ItemForm.tsx + + +ItemForm.tsx + + + + + +src/Components/Map/ItemView.tsx + + +ItemView.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/Input/TextInput.tsx + + + + + +src/Components/Map/Subcomponents/ItemFormPopup.tsx->src/Components/Input/TextAreaInput.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/HeaderView.tsx - - -HeaderView.tsx + + +src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView.tsx + + +HeaderView.tsx - - -src/Components/Map/Subcomponents/ItemViewPopup.tsx->src/Components/Map/Subcomponents/HeaderView.tsx - - + + +src/Components/Map/Subcomponents/ItemViewPopup.tsx->src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView.tsx + + - - -src/Components/Map/Subcomponents/StartEndView.tsx - - -StartEndView.tsx + + +src/Components/Map/Subcomponents/ItemPopupComponents/TextView.tsx + + +TextView.tsx - - -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/ItemViewPopup.tsx->src/Components/Map/Subcomponents/ItemPopupComponents/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/AddButton.tsx->src/Utils/DynamicHeroIcon.tsx + + - + + +src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView.tsx->src/Components/Map/hooks/useItems.tsx + + + + + +src/Components/Map/Subcomponents/ItemPopupComponents/PopupStartEndInput.tsx + + +PopupStartEndInput.tsx + + + + + +src/Components/Map/Subcomponents/ItemPopupComponents/PopupStartEndInput.tsx->src/Components/Input/index.tsx + + + + + +src/Components/Map/Subcomponents/ItemPopupComponents/PopupTextAreaInput.tsx + + +PopupTextAreaInput.tsx + + + + -src/Components/Map/Subcomponents/TextView.tsx->src/Components/Map/hooks/useTags.tsx - - +src/Components/Map/Subcomponents/ItemPopupComponents/PopupTextAreaInput.tsx->src/Components/Input/index.tsx + + + + + +src/Components/Map/Subcomponents/ItemPopupComponents/PopupTextInput.tsx + + +PopupTextInput.tsx + + + + + +src/Components/Map/Subcomponents/ItemPopupComponents/StartEndView.tsx + + +StartEndView.tsx + + + + + +src/Components/Map/Subcomponents/ItemPopupComponents/TextView.tsx->src/Components/Map/hooks/useTags.tsx + + - + src/Utils/HeighlightTags.ts - - -HeighlightTags.ts + + +HeighlightTags.ts - - -src/Components/Map/Subcomponents/TextView.tsx->src/Utils/HeighlightTags.ts - - + + +src/Components/Map/Subcomponents/ItemPopupComponents/TextView.tsx->src/Utils/HeighlightTags.ts + + - + src/Utils/ReplaceURLs.ts - - -ReplaceURLs.ts + + +ReplaceURLs.ts - - -src/Components/Map/Subcomponents/TextView.tsx->src/Utils/ReplaceURLs.ts - - + + +src/Components/Map/Subcomponents/ItemPopupComponents/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/ItemForm.tsx + + + + + +src/Components/Map/index.tsx->src/Components/Map/ItemView.tsx + + + - + src/Components/Map/index.tsx->src/Components/Map/Layer.tsx - - + + + + + +src/Components/Map/index.tsx->src/Components/Map/Subcomponents/ItemPopupComponents/PopupStartEndInput.tsx + + + + + +src/Components/Map/index.tsx->src/Components/Map/Subcomponents/ItemPopupComponents/PopupTextAreaInput.tsx + + + + + +src/Components/Map/index.tsx->src/Components/Map/Subcomponents/ItemPopupComponents/StartEndView.tsx + + + + + +src/Components/Map/index.tsx->src/Components/Map/Subcomponents/ItemPopupComponents/TextView.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/TextInput.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 + + +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/Input/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/Map/Layer.tsx b/src/Components/Map/Layer.tsx index bf8627b2..230d44d4 100644 --- a/src/Components/Map/Layer.tsx +++ b/src/Components/Map/Layer.tsx @@ -8,6 +8,7 @@ import { useAddItem, useItems, useResetItems } from './hooks/useItems' import { useEffect, useState } from 'react' import { useAddLayer } from './hooks/useLayers' import { ItemFormPopupProps, ItemFormPopup } from './Subcomponents/ItemFormPopup' +import { toast } from 'react-toastify' export const Layer = (props: LayerProps) => { @@ -43,9 +44,7 @@ export const Layer = (props: LayerProps) => { const addLayer = useAddLayer(); const resetItems = useResetItems(); - useEffect(() => { - resetItems(props); - + const loadItems = async () => { props.data?.map(item => { if (item.position) { item.layer = props; @@ -53,7 +52,15 @@ export const Layer = (props: LayerProps) => { } }) - props.api?.getItems().then(result => { + if(props.api) { + const result = await toast.promise( + props.api!.getItems(), + { + pending: `loading ${props.name} ...`, + success: `${props.name} loaded` , + error: `error while loading ${props.name}` + } + ); if (result) { result.map(item => { if (item.position) { @@ -61,10 +68,20 @@ export const Layer = (props: LayerProps) => { } }); } - }) - if (props.api || props.api) { + } + + + + if (props.api) { addLayer(props); } + } + + useEffect(() => { + resetItems(props); + loadItems(); + + }, [props.data, props.api]) @@ -82,6 +99,7 @@ export const Layer = (props: LayerProps) => { if (tags[1]) { color2 = tags[1].color; } + return (