From d1638aea31d599334ff3ec50e1e719584ce276ea Mon Sep 17 00:00:00 2001 From: Anton Tranelis Date: Tue, 7 May 2024 08:36:17 +0200 Subject: [PATCH] relations in item-profile-settings --- src/Components/Profile/ActionsButton.tsx | 5 +- src/Components/Profile/OverlayItemProfile.tsx | 2 +- .../Profile/OverlayItemProfileSettings.tsx | 88 ++++++++++++++++++- 3 files changed, 89 insertions(+), 6 deletions(-) diff --git a/src/Components/Profile/ActionsButton.tsx b/src/Components/Profile/ActionsButton.tsx index 2650b3e5..3d566d87 100644 --- a/src/Components/Profile/ActionsButton.tsx +++ b/src/Components/Profile/ActionsButton.tsx @@ -8,13 +8,14 @@ import { TextInput } from "../Input"; import { getValue } from "../../Utils/GetValue"; import { useGetItemTags } from "../Map/hooks/useTags"; -export function ActionButton({ item, triggerAddButton, triggerItemSelected, existingRelations, itemType, colorField, collection = "items" }: { +export function ActionButton({ item, triggerAddButton, triggerItemSelected, existingRelations, itemType, colorField, collection = "items", customStyle }: { triggerAddButton?: any, triggerItemSelected?: any, existingRelations: Item[], itemType?: string; colorField?: string, collection?: string, + customStyle?:string, item: Item }) { const hasUserPermission = useHasUserPermission(); @@ -32,7 +33,7 @@ export function ActionButton({ item, triggerAddButton, triggerItemSelected, exis return ( <>{hasUserPermission(collection, "update", item) && <> -
+
{triggerItemSelected &&
} + {item.layer?.itemType.relations && + <> + updateActiveTab(7)} /> +
+
+
+ {relations && relations.map(i => + + +
navigate('/item/' + i.id)}> + +
+ +
+
+ )} + {updatePermission && } + +
+
+
+ + }
-
+