From 85a4e71def1950256d69540cadd150365c7d9922 Mon Sep 17 00:00:00 2001 From: Matt Date: Wed, 29 Apr 2026 19:19:19 +0000 Subject: [PATCH] Redesign wiki links in place card - Remove redundant "Read more (local)" links from WikiSummarySection - Summary text now stands alone with population info - LINKS section now shows Wikipedia/Wikivoyage/Wikidata with brand icons - Use simple monochrome SVG icons for each wiki service - Wikipedia and Wikivoyage show (local) indicator when served from Kiwix - Falls back to wikipedia.org when wiki_url is not available Co-Authored-By: Claude Opus 4.5 --- src/components/PlaceCard.jsx | 79 +++++++++++++++++----------------- src/components/PlaceDetail.jsx | 79 ++++++++++++++++------------------ 2 files changed, 76 insertions(+), 82 deletions(-) diff --git a/src/components/PlaceCard.jsx b/src/components/PlaceCard.jsx index 72f00e1..aacde9d 100644 --- a/src/components/PlaceCard.jsx +++ b/src/components/PlaceCard.jsx @@ -10,6 +10,30 @@ import { fetchElevation, fetchPlaceDetails, fetchPlaceByWikidata, fetchDriveTime import { hasFeature } from "../config" import { buildAddress } from "../utils/place" + +// Wiki service icons (simplified monochrome versions) +const WikipediaIcon = ({ size = 13, style }) => ( + + + +) + +const WikivoyageIcon = ({ size = 13, style }) => ( + + + +) + +const WikidataIcon = ({ size = 13, style }) => ( + + + + + + + +) + const M_TO_FT = 3.28084 function formatDriveTime(seconds) { @@ -178,36 +202,6 @@ function WikiSummarySection({ details }) { Pop. {details.wiki_population.toLocaleString ? details.wiki_population.toLocaleString() : details.wiki_population} )} - - {/* Wiki links */} -
- {details.wiki_url && ( - - - Read more - (local) - - )} - {details.wikivoyage_url && ( - - - Travel guide - (local) - - )} -
) } @@ -264,26 +258,31 @@ function EnrichmentSections({ details }) { {hasLinks && (
- {et.wikipedia && (wiki_url ? ( + {wiki_url ? ( - - {wikiLabel(et.wikipedia)} + + Wikipedia (local) - ) : wikiUrl(et.wikipedia) && ( + ) : et.wikipedia && wikiUrl(et.wikipedia) && ( - - {wikiLabel(et.wikipedia)} + + Wikipedia - ))} + )} {wikivoyage_url && ( - - Travel guide + + Wikivoyage (local) )} - {et.wikidata && View on Wikidata} + {et.wikidata && ( + + + Wikidata + + )}
)} diff --git a/src/components/PlaceDetail.jsx b/src/components/PlaceDetail.jsx index be24c26..a0b839b 100644 --- a/src/components/PlaceDetail.jsx +++ b/src/components/PlaceDetail.jsx @@ -10,6 +10,30 @@ import { fetchElevation, fetchPlaceDetails, fetchPlaceByWikidata, fetchDriveTime import { hasFeature } from '../config' import { buildAddress } from '../utils/place' + +// Wiki service icons (simplified monochrome versions) +const WikipediaIcon = ({ size = 13, style }) => ( + + + +) + +const WikivoyageIcon = ({ size = 13, style }) => ( + + + +) + +const WikidataIcon = ({ size = 13, style }) => ( + + + + + + + +) + /** Meters to feet */ const M_TO_FT = 3.28084 @@ -322,7 +346,7 @@ function EnrichmentSections({ details }) { {hasLinks && (
- {et.wikipedia && (wiki_url ? ( + {wiki_url ? ( - - {wikiLabel(et.wikipedia)} + + Wikipedia (local) - ) : wikiUrl(et.wikipedia) && ( + ) : et.wikipedia && wikiUrl(et.wikipedia) && ( - - {wikiLabel(et.wikipedia)} + + Wikipedia - ))} + )} {wikivoyage_url && ( - - Travel guide + + Wikivoyage (local) )} @@ -364,10 +388,11 @@ function EnrichmentSections({ details }) { href={`https://www.wikidata.org/wiki/${et.wikidata}`} target="_blank" rel="noopener noreferrer" - className="text-[11px]" - style={{ color: 'var(--text-tertiary)', textDecoration: 'underline' }} + className="flex items-center gap-2 text-xs" + style={{ color: 'var(--accent)' }} > - View on Wikidata + + Wikidata )}
@@ -439,36 +464,6 @@ function WikiSummarySection({ details }) { Population: {details.wiki_population.toLocaleString ? details.wiki_population.toLocaleString() : details.wiki_population} )} - - {/* Wiki links */} -
- {details.wiki_url && ( - - - Read more - (local) - - )} - {details.wikivoyage_url && ( - - - Travel guide - (local) - - )} -
) }