From b746c45d2d7456c27f0699cc7fa64769fdbb5ad9 Mon Sep 17 00:00:00 2001 From: Anton Date: Sun, 3 Sep 2023 11:13:51 +0200 Subject: [PATCH] added tooltips --- dependency-graph.svg | 888 +++++++++++++++++-------------- src/Components/Map/Layer.tsx | 14 +- src/Components/Map/UtopiaMap.css | 7 + 3 files changed, 489 insertions(+), 420 deletions(-) diff --git a/dependency-graph.svg b/dependency-graph.svg index 45c2f1fc..ae3f2780 100644 --- a/dependency-graph.svg +++ b/dependency-graph.svg @@ -4,60 +4,60 @@ - - + + 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/Subcomponents/ItemPopupComponents - -ItemPopupComponents + +ItemPopupComponents cluster_src/Components/Map/hooks - -hooks + +hooks cluster_src/Components/Profile @@ -66,30 +66,30 @@ 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 @@ -97,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 @@ -136,8 +136,8 @@ src/Components/AppShell/SideBar.tsx - -SideBar.tsx + +SideBar.tsx @@ -145,50 +145,50 @@ 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 @@ -196,52 +196,52 @@ src/Components/Input/TextInput.tsx - -TextInput.tsx + +TextInput.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/TextInput.tsx - - + + src/Components/Auth/SignupPage.tsx->src/Components/Typography/ErrorText.tsx - - + + @@ -255,36 +255,36 @@ 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 @@ -292,8 +292,8 @@ src/Components/Gaming/Quests.tsx - -Quests.tsx + +Quests.tsx @@ -301,29 +301,29 @@ 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 @@ -331,44 +331,46 @@ src/Components/Map/hooks/useTags.tsx - -useTags.tsx + +useTags.tsx src/Components/Input/TextAreaInput.tsx->src/Components/Map/hooks/useTags.tsx - - + + + + src/Components/Input/index.tsx - -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 + +ItemForm.tsx @@ -376,8 +378,8 @@ src/Components/Map/ItemView.tsx - -ItemView.tsx + +ItemView.tsx @@ -385,625 +387,685 @@ src/Components/Map/Layer.tsx - -Layer.tsx + +Layer.tsx - - -src/Components/Map/Layer.tsx->src/Components/Map/hooks/useTags.tsx - - - - - -src/Utils/HeighlightTags.ts - - -HeighlightTags.ts - - - - - -src/Components/Map/Layer.tsx->src/Utils/HeighlightTags.ts - - - - + src/Utils/MarkerIconFactory.ts - - -MarkerIconFactory.ts + + +MarkerIconFactory.ts - + src/Components/Map/Layer.tsx->src/Utils/MarkerIconFactory.ts - - + + - + src/Components/Map/hooks/useFilter.tsx - - -useFilter.tsx + + +useFilter.tsx - + src/Components/Map/Layer.tsx->src/Components/Map/hooks/useFilter.tsx - - + + - + 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 - - - - - -src/Components/Map/Layer.tsx->src/Components/Map/hooks/useLayers.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/hooks/useItems.tsx->src/Components/Map/hooks/useTags.tsx + + + + + +src/Components/Map/hooks/useLayers.tsx + + +useLayers.tsx + + + + + +src/Components/Map/hooks/useItems.tsx->src/Components/Map/hooks/useLayers.tsx + + + + + +src/Utils/HashTagRegex.tsx + + +HashTagRegex.tsx + + + + + +src/Components/Map/hooks/useItems.tsx->src/Utils/HashTagRegex.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/useTags.tsx - - + + - - -src/Components/Map/Subcomponents/ItemFormPopup.tsx->src/Utils/HeighlightTags.ts - - + + +src/Components/Map/Subcomponents/ItemFormPopup.tsx->src/Components/Map/hooks/useFilter.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/ItemFormPopup.tsx->src/Utils/HashTagRegex.tsx + + - + src/Utils/RandomColor.ts - - -RandomColor.ts + + +RandomColor.ts - + src/Components/Map/Subcomponents/ItemFormPopup.tsx->src/Utils/RandomColor.ts - - + + - + src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView.tsx - - -HeaderView.tsx + + +HeaderView.tsx - + src/Components/Map/Subcomponents/ItemViewPopup.tsx->src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView.tsx - - + + - + src/Components/Map/Subcomponents/ItemPopupComponents/TextView.tsx - - -TextView.tsx + + +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/AddButton.tsx->src/Components/Map/hooks/useLayers.tsx + + + + + +src/Components/Map/Subcomponents/FilterControl.tsx + + +FilterControl.tsx + + + + + +src/Components/Map/Subcomponents/FilterControl.tsx->src/Components/Map/hooks/useFilter.tsx + + + + + +src/Components/Map/hooks/useWindowDimension.tsx + + +useWindowDimension.tsx + + + + + +src/Components/Map/Subcomponents/FilterControl.tsx->src/Components/Map/hooks/useWindowDimension.tsx + + src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView.tsx->src/Components/Map/hooks/useItems.tsx - - + + - + src/Components/Map/Subcomponents/ItemPopupComponents/PopupStartEndInput.tsx - - -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 + + +PopupTextAreaInput.tsx src/Components/Map/Subcomponents/ItemPopupComponents/PopupTextAreaInput.tsx->src/Components/Input/index.tsx - - + + - + src/Components/Map/Subcomponents/ItemPopupComponents/PopupTextInput.tsx - - -PopupTextInput.tsx + + +PopupTextInput.tsx - + src/Components/Map/Subcomponents/ItemPopupComponents/StartEndView.tsx - - -StartEndView.tsx + + +StartEndView.tsx - + src/Components/Map/Subcomponents/ItemPopupComponents/TextView.tsx->src/Components/Map/hooks/useTags.tsx - - + + - + + +src/Components/Map/Subcomponents/ItemPopupComponents/TextView.tsx->src/Components/Map/hooks/useFilter.tsx + + + + -src/Components/Map/Subcomponents/ItemPopupComponents/TextView.tsx->src/Utils/HeighlightTags.ts - - +src/Components/Map/Subcomponents/ItemPopupComponents/TextView.tsx->src/Utils/HashTagRegex.tsx + + + + + +src/Components/Map/Subcomponents/ItemPopupComponents/TextView.tsx->src/Utils/RandomColor.ts + + - + src/Utils/ReplaceURLs.ts - - -ReplaceURLs.ts + + +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/useTags.tsx - - + + + + + +src/Components/Map/UtopiaMap.tsx->src/Components/Map/hooks/useFilter.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/Subcomponents/AddButton.tsx - - + + + + + +src/Components/Map/UtopiaMap.tsx->src/Components/Map/hooks/useLayers.tsx + + + + + +src/Components/Map/UtopiaMap.tsx->src/Components/Map/Subcomponents/FilterControl.tsx + + - + 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 - + 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 - + src/Components/Profile/index.tsx->src/Components/Profile/Settings.tsx - + src/Components/Templates/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/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 8ac0514b..bac78c72 100644 --- a/src/Components/Map/Layer.tsx +++ b/src/Components/Map/Layer.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import { Marker } from 'react-leaflet' +import { Marker, Tooltip } from 'react-leaflet' import { Item, LayerProps } from '../../types' import MarkerIconFactory from '../../Utils/MarkerIconFactory' import { ItemViewPopup } from './Subcomponents/ItemViewPopup' @@ -48,8 +48,8 @@ export const Layer = (props: LayerProps) => { ? item : item.name.toLowerCase().includes(searchPhrase.toLowerCase()) }). - map((place: Item) => { - const tags = place.tags; + map((item: Item) => { + const tags = item.tags; let color1 = "#666"; let color2 = "RGBA(35, 31, 32, 0.2)"; @@ -60,20 +60,20 @@ export const Layer = (props: LayerProps) => { color2 = tags[1].color; } return ( - + { (props.children && React.Children.toArray(props.children).some(child => React.isValidElement(child) && child.props.__TYPE === "ItemView") ? React.Children.toArray(props.children).map((child) => React.isValidElement(child) && child.props.__TYPE === "ItemView" ? - {child} + {child} : "" ) : <> - + ) } - + {item.name} ); }) diff --git a/src/Components/Map/UtopiaMap.css b/src/Components/Map/UtopiaMap.css index 3072b073..894a8c78 100644 --- a/src/Components/Map/UtopiaMap.css +++ b/src/Components/Map/UtopiaMap.css @@ -53,4 +53,11 @@ background-color: theme('colors.base-100'); color: theme('colors.base-content'); + } + + .leaflet-tooltip { + border-radius: 1em; + transition: opacity 500ms; + transition-delay: 50ms; + } \ No newline at end of file