From b6341117886a6e22b120f1d2cfd37fefd9fbb258 Mon Sep 17 00:00:00 2001 From: Babastienne Date: Tue, 7 May 2024 18:58:52 +0200 Subject: [PATCH] feat: add external uri button on Station --- src/api/stations.ts | 1 + src/components/station.page.tsx | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/api/stations.ts b/src/api/stations.ts index 2621006..04a8091 100644 --- a/src/api/stations.ts +++ b/src/api/stations.ts @@ -13,6 +13,7 @@ export type Station = { description: string; customContributionTypes: number[]; observations?: StationObservations | null; + url?: string; geometry: { type: string; coordinates: number[]; diff --git a/src/components/station.page.tsx b/src/components/station.page.tsx index 236dd69..9992c88 100644 --- a/src/components/station.page.tsx +++ b/src/components/station.page.tsx @@ -1,11 +1,13 @@ import { Observation } from '@/api/customObservations'; import { Station } from '@/api/stations'; import { LatLngTuple } from 'leaflet'; +import { useTranslations } from 'next-intl'; import ButtonCenterView from './button-center-view'; import ButtonClose from './button-close'; import { StationContributionList } from './station-contribution-list'; import { StationContributionTypesList } from './station-contribution-types-list'; +import LinkAsButton from './ui/link-as-button'; type Props = { content: Station; @@ -14,7 +16,7 @@ type Props = { export default function StationPageUI({ content, observationTypes }: Props) { const observations = content.observations ?? []; - + const t = useTranslations('details'); return (
@@ -35,6 +37,15 @@ export default function StationPageUI({ content, observationTypes }: Props) { {content.description.split('\n').map(e => (

{e}

))} + {content?.url && ( + + {t('link')} + + )}