From 2cbc222d938fa3224bc9a8f3722110e2104f81f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Zbytovsk=C3=BD?= Date: Tue, 16 Apr 2024 18:48:49 +0200 Subject: [PATCH] tagging: add url renderer (#309) --- src/components/FeaturePanel/FeaturedTag.tsx | 10 +++++++--- src/services/tagging/idTaggingScheme.ts | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/FeaturePanel/FeaturedTag.tsx b/src/components/FeaturePanel/FeaturedTag.tsx index ca5733fd6..b96f34904 100644 --- a/src/components/FeaturePanel/FeaturedTag.tsx +++ b/src/components/FeaturePanel/FeaturedTag.tsx @@ -36,13 +36,17 @@ const Value = styled.div` } `; -const DefaultRenderer = ({ v }) => v; -const renderers: { +type Renderers = { [key: string]: React.FC<{ k: string; v: string }>; -} = { +}; + +const DefaultRenderer = ({ v }) => v; +const renderers: Renderers = { + // also updatd in schema – getFeaturedTags() website: WebsiteRenderer, 'website:2': WebsiteRenderer, 'contact:website': WebsiteRenderer, + url: WebsiteRenderer, phone: PhoneRenderer, 'contact:phone': PhoneRenderer, 'contact:mobile': PhoneRenderer, diff --git a/src/services/tagging/idTaggingScheme.ts b/src/services/tagging/idTaggingScheme.ts index dd8227ce0..481274e0d 100644 --- a/src/services/tagging/idTaggingScheme.ts +++ b/src/services/tagging/idTaggingScheme.ts @@ -159,6 +159,7 @@ const getFeaturedTags = (feature: Feature) => { 'website', 'website:2', 'contact:website', + 'url', 'phone', 'contact:phone', 'contact:mobile',