From 7aabde9f247813e85ccfb75bba983b5f68254307 Mon Sep 17 00:00:00 2001 From: Mikael Brevik Date: Fri, 19 Apr 2024 12:21:14 +0200 Subject: [PATCH] feat: adds meta description to departure; --- src/components/open-graph/index.tsx | 14 ++++++++++++++ src/page-modules/departures/stop-place/index.tsx | 11 ++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/components/open-graph/index.tsx b/src/components/open-graph/index.tsx index 770c1de2..576b359e 100644 --- a/src/components/open-graph/index.tsx +++ b/src/components/open-graph/index.tsx @@ -19,6 +19,20 @@ export function OpenGraphImage({ image }: OpenGraphImageProps) { ); } +export type OpenGraphDescriptionProps = { + description: string; +}; +export function OpenGraphDescription({ + description, +}: OpenGraphDescriptionProps) { + return ( + + + + + ); +} + export type OpenGraphBaseProps = { title: string; }; diff --git a/src/page-modules/departures/stop-place/index.tsx b/src/page-modules/departures/stop-place/index.tsx index d761e635..21be720c 100644 --- a/src/page-modules/departures/stop-place/index.tsx +++ b/src/page-modules/departures/stop-place/index.tsx @@ -3,7 +3,10 @@ import { DepartureTime } from '@atb/components/departure-time'; import { ColorIcon, MonoIcon } from '@atb/components/icon'; import LineChip from '@atb/components/line-chip'; import { MapWithHeader } from '@atb/components/map'; -import { OpenGraphImage } from '@atb/components/open-graph'; +import { + OpenGraphDescription, + OpenGraphImage, +} from '@atb/components/open-graph'; import ScreenReaderOnly from '@atb/components/screen-reader-only'; import { Typo } from '@atb/components/typography'; import { @@ -38,6 +41,12 @@ export function StopPlace({ departures }: StopPlaceProps) { image={`api/departures/open-graph?stopPlaceId=${departures.stopPlace.id}`} /> + {/* Hard coded to norwegian as this should be the default for sharing links where + we dont know what language to show. */} + +