From f296ddd6064c31aa7e46274bf8ab7ddda3766260 Mon Sep 17 00:00:00 2001 From: Anton Tranelis Date: Wed, 6 Nov 2024 20:11:17 +0100 Subject: [PATCH] implemented flex profiles --- src/Components/Input/ComboBoxInput.tsx | 11 +- .../PopupStartEndInput.tsx | 2 +- .../ItemPopupComponents/PopupTextInput.tsx | 2 +- src/Components/Map/UtopiaMap.css | 14 +++ src/Components/Profile/ProfileForm.tsx | 6 +- .../Profile/Subcomponents/ContactInfoForm.tsx | 2 +- .../{ContactInfo.tsx => ContactInfoView.tsx} | 6 +- .../Subcomponents/GroupSubHeaderView.tsx | 11 +- .../Subcomponents/GroupSubheaderForm.tsx | 105 ++++++++---------- .../Subcomponents/ProfileStartEndForm.tsx | 30 +++++ .../Subcomponents/ProfileStartEndView.tsx | 11 ++ .../Profile/Subcomponents/ProfileTextForm.tsx | 27 +++-- .../Profile/Subcomponents/ProfileTextView.tsx | 17 +-- src/Components/Profile/Templates/FlexForm.tsx | 11 +- src/Components/Profile/Templates/FlexView.tsx | 10 +- .../Profile/Templates/OnepagerView.tsx | 4 +- src/Components/Profile/itemFunctions.ts | 4 +- src/Utils/MarkerIconFactory.ts | 4 + 18 files changed, 159 insertions(+), 118 deletions(-) rename src/Components/Profile/Subcomponents/{ContactInfo.tsx => ContactInfoView.tsx} (96%) create mode 100644 src/Components/Profile/Subcomponents/ProfileStartEndForm.tsx create mode 100644 src/Components/Profile/Subcomponents/ProfileStartEndView.tsx diff --git a/src/Components/Input/ComboBoxInput.tsx b/src/Components/Input/ComboBoxInput.tsx index 91b49d88..3491102d 100644 --- a/src/Components/Input/ComboBoxInput.tsx +++ b/src/Components/Input/ComboBoxInput.tsx @@ -1,20 +1,15 @@ -import { useState } from 'react' import * as React from 'react' interface ComboBoxProps { id?: string - options: { value: string; label: string }[] + options: string[] value: string onValueChange: (newValue: string) => void } const ComboBoxInput = ({ id, options, value, onValueChange }: ComboBoxProps) => { - // eslint-disable-next-line no-unused-vars - const [selectedValue, setSelectedValue] = useState(value) - const handleChange = (e: React.ChangeEvent) => { const value = e.target.value - setSelectedValue(value) onValueChange(value) } @@ -25,8 +20,8 @@ const ComboBoxInput = ({ id, options, value, onValueChange }: ComboBoxProps) => onChange={handleChange} > {options.map((o) => ( - ))} diff --git a/src/Components/Map/Subcomponents/ItemPopupComponents/PopupStartEndInput.tsx b/src/Components/Map/Subcomponents/ItemPopupComponents/PopupStartEndInput.tsx index 4a728ee0..d2b84100 100644 --- a/src/Components/Map/Subcomponents/ItemPopupComponents/PopupStartEndInput.tsx +++ b/src/Components/Map/Subcomponents/ItemPopupComponents/PopupStartEndInput.tsx @@ -16,7 +16,7 @@ export const PopupStartEndInput = ({ updateEndValue, }: StartEndInputProps) => { return ( -
+
) } diff --git a/src/Components/Map/UtopiaMap.css b/src/Components/Map/UtopiaMap.css index 389e3469..5ab6dc05 100644 --- a/src/Components/Map/UtopiaMap.css +++ b/src/Components/Map/UtopiaMap.css @@ -120,6 +120,20 @@ left: 4px; width: 24px; } + + .flower-icon { + position: relative; + top: -35px; + left: 4px; + width: 24px; + } + + .network-icon { + position: relative; + top: -35px; + left: 4px; + width: 24px; + } .leaflet-popup-scrolled { overflow-x: hidden; diff --git a/src/Components/Profile/ProfileForm.tsx b/src/Components/Profile/ProfileForm.tsx index 97c0794d..261414bb 100644 --- a/src/Components/Profile/ProfileForm.tsx +++ b/src/Components/Profile/ProfileForm.tsx @@ -108,8 +108,8 @@ export function ProfileForm() { setState({ color: newColor, id: item?.id ?? '', - group_type: item?.group_type ?? 'wuerdekompass', - status: item?.status ?? 'active', + group_type: item?.group_type ?? '', + status: item?.status ?? '', name: item?.name ?? '', subname: item?.subname ?? '', text: item?.text ?? '', @@ -165,7 +165,7 @@ export function ProfileForm() { > )} -
+