From 19c2275086e6f2a6da67c6e500bc5d20e57e3706 Mon Sep 17 00:00:00 2001 From: Silberengel Date: Wed, 6 May 2026 13:15:21 +0200 Subject: [PATCH] refine calendar and maps --- .../CalendarEventNip52StructuredMeta.tsx | 54 +++-- .../ActiveRelaysTitlebarButton.tsx | 2 +- src/i18n/locales/cs.ts | 3 +- src/i18n/locales/de.ts | 3 +- src/i18n/locales/en.ts | 3 +- src/i18n/locales/es.ts | 3 +- src/i18n/locales/fr.ts | 3 +- src/i18n/locales/nl.ts | 3 +- src/i18n/locales/pl.ts | 3 +- src/i18n/locales/ru.ts | 3 +- src/i18n/locales/tr.ts | 3 +- src/i18n/locales/zh.ts | 3 +- src/pages/primary/NoteListPage/index.tsx | 202 ++++++++---------- 13 files changed, 153 insertions(+), 135 deletions(-) diff --git a/src/components/CalendarEventNip52StructuredMeta.tsx b/src/components/CalendarEventNip52StructuredMeta.tsx index 1af0b7b8..fa63fe97 100644 --- a/src/components/CalendarEventNip52StructuredMeta.tsx +++ b/src/components/CalendarEventNip52StructuredMeta.tsx @@ -1,6 +1,5 @@ import { getNip52CalendarEventTagExtras, type CalendarEventMeta } from '@/lib/calendar-event' import { useSmartNoteNavigation } from '@/PageManager' -import { cn } from '@/lib/utils' import { Event } from 'nostr-tools' import { useMemo } from 'react' import { useTranslation } from 'react-i18next' @@ -9,6 +8,19 @@ import { Calendar, ExternalLink, Link2, MapPin } from 'lucide-react' type Placement = 'beforeDescription' | 'afterDescription' +/** [Geohash Explorer](https://geohash.softeng.co/) style URL for a geohash string. */ +function nip52GeohashSoftengUrl(geohash: string): string { + const h = geohash.trim() + return `https://geohash.softeng.co/${encodeURIComponent(h)}` +} + +/** Google Maps “place” style URL from a free-text address or place name. */ +function googleMapsPlaceUrl(placeQuery: string): string { + const q = placeQuery.trim() + if (!q) return '#' + return `https://www.google.com/maps/place/${encodeURIComponent(q).replace(/%20/g, '+')}` +} + export function CalendarEventNip52StructuredMeta({ placement, event, @@ -38,16 +50,34 @@ export function CalendarEventNip52StructuredMeta({ {meta.locations.length > 1 ? t('calendarNip52Locations') : t('calendarNip52Location')} {meta.locations.length === 1 ? ( -

- - {meta.locations[0]} -

+
+

+ + {meta.locations[0]} +

+ +
) : ( -