From 94677ef51896e4d358160a66cb5a40d9b21a752f Mon Sep 17 00:00:00 2001 From: stianjsu Date: Fri, 14 Jul 2023 10:46:44 +0200 Subject: [PATCH] feat(edit tile): implements platform dropdown in settings components --- .../scenarios/TileSettings/components/PlatformDropdown.tsx | 6 ++++-- .../scenarios/TileSettings/components/QuaySettings.tsx | 2 ++ .../scenarios/TileSettings/components/StopPlaceSettings.tsx | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/next-tavla/src/Admin/scenarios/TileSettings/components/PlatformDropdown.tsx b/next-tavla/src/Admin/scenarios/TileSettings/components/PlatformDropdown.tsx index eed5c0eab..5fe18d477 100644 --- a/next-tavla/src/Admin/scenarios/TileSettings/components/PlatformDropdown.tsx +++ b/next-tavla/src/Admin/scenarios/TileSettings/components/PlatformDropdown.tsx @@ -8,12 +8,12 @@ import { isNotNullOrUndefined } from 'utils/typeguards' const stopPlaceOption = { value: 'stopPlace', label: 'Vis Alle' } as const -function PlatformDropdown({ +function PlatformDropdown({ stopPlaceId, tile, }: { stopPlaceId: string - tile: T + tile: TTile }) { const dispatch = useSettingsDispatch() @@ -55,6 +55,7 @@ function PlatformDropdown({ type: 'stop_place', placeId: stopPlaceId, uuid: tile.uuid, + columns: tile.columns, }) else setTile({ @@ -62,6 +63,7 @@ function PlatformDropdown({ stopPlaceId, placeId: e.value, uuid: tile.uuid, + columns: tile.columns, }) } }} diff --git a/next-tavla/src/Admin/scenarios/TileSettings/components/QuaySettings.tsx b/next-tavla/src/Admin/scenarios/TileSettings/components/QuaySettings.tsx index e790a527f..e3b24c8b8 100644 --- a/next-tavla/src/Admin/scenarios/TileSettings/components/QuaySettings.tsx +++ b/next-tavla/src/Admin/scenarios/TileSettings/components/QuaySettings.tsx @@ -4,6 +4,7 @@ import { useQuery } from 'graphql/utils' import { TQuayTile } from 'types/tile' import { fieldsNotNull } from 'utils/typeguards' import { TileSettingsWrapper } from './TileSettingsWrapper' +import { PlatformDropdown } from './PlatformDropdown' function QuaySettings({ tile }: { tile: TQuayTile }) { const { data } = useQuery(GetQuayQuery, { quayId: tile.placeId }) @@ -18,6 +19,7 @@ function QuaySettings({ tile }: { tile: TQuayTile }) { return ( + ) diff --git a/next-tavla/src/Admin/scenarios/TileSettings/components/StopPlaceSettings.tsx b/next-tavla/src/Admin/scenarios/TileSettings/components/StopPlaceSettings.tsx index 4824765cc..a91655c59 100644 --- a/next-tavla/src/Admin/scenarios/TileSettings/components/StopPlaceSettings.tsx +++ b/next-tavla/src/Admin/scenarios/TileSettings/components/StopPlaceSettings.tsx @@ -4,6 +4,7 @@ import { useQuery } from 'graphql/utils' import { TStopPlaceTile } from 'types/tile' import { fieldsNotNull } from 'utils/typeguards' import { TileSettingsWrapper } from './TileSettingsWrapper' +import { PlatformDropdown } from './PlatformDropdown' function StopPlaceSettings({ tile }: { tile: TStopPlaceTile }) { const { data } = useQuery(StopPlaceSettingsQuery, { id: tile.placeId }) @@ -17,6 +18,7 @@ function StopPlaceSettings({ tile }: { tile: TStopPlaceTile }) { return ( + )