From a431f31a88a3ad58c81ca68832fae17c79e789f2 Mon Sep 17 00:00:00 2001 From: codytseng Date: Mon, 26 May 2025 21:51:09 +0800 Subject: [PATCH] feat: add fallback button to view unsupported events on njump.me --- src/components/Note/UnknownNote.tsx | 12 +++++------- src/i18n/locales/ar.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/it.ts | 3 ++- src/i18n/locales/ja.ts | 3 ++- src/i18n/locales/pl.ts | 3 ++- src/i18n/locales/pt-BR.ts | 3 ++- src/i18n/locales/pt-PT.ts | 3 ++- src/i18n/locales/ru.ts | 3 ++- src/i18n/locales/zh.ts | 3 ++- 13 files changed, 29 insertions(+), 19 deletions(-) diff --git a/src/components/Note/UnknownNote.tsx b/src/components/Note/UnknownNote.tsx index 0ad9926..dc516fa 100644 --- a/src/components/Note/UnknownNote.tsx +++ b/src/components/Note/UnknownNote.tsx @@ -1,14 +1,13 @@ import { Button } from '@/components/ui/button' import { getSharableEventId } from '@/lib/event' +import { toNjump } from '@/lib/link' import { cn } from '@/lib/utils' -import { Check, Copy } from 'lucide-react' +import { ExternalLink } from 'lucide-react' import { Event } from 'nostr-tools' -import { useState } from 'react' import { useTranslation } from 'react-i18next' export function UnknownNote({ event, className }: { event: Event; className?: string }) { const { t } = useTranslation() - const [isCopied, setIsCopied] = useState(false) return (
{ e.stopPropagation() - navigator.clipboard.writeText(getSharableEventId(event)) - setIsCopied(true) - setTimeout(() => setIsCopied(false), 2000) + window.open(toNjump(getSharableEventId(event)), '_blank') }} variant="outline" > - {isCopied ? : } Copy event ID + +
{t('View on njump.me')}
) diff --git a/src/i18n/locales/ar.ts b/src/i18n/locales/ar.ts index aea8e5c..12f3767 100644 --- a/src/i18n/locales/ar.ts +++ b/src/i18n/locales/ar.ts @@ -232,6 +232,7 @@ export default { 'أنت على وشك نشر حدث موقع من قبل [{{eventAuthorName}}]. أنت حالياً مسجل الدخول كـ [{{currentUsername}}]. هل أنت متأكد؟', 'Platinum Sponsors': 'الرعاة البلاتينيون', From: 'من', - 'Comment on': 'تعليق على' + 'Comment on': 'تعليق على', + 'View on njump.me': 'عرض على njump.me' } } diff --git a/src/i18n/locales/de.ts b/src/i18n/locales/de.ts index 3eab03e..0665e06 100644 --- a/src/i18n/locales/de.ts +++ b/src/i18n/locales/de.ts @@ -238,6 +238,7 @@ export default { 'Du bist dabei, ein Ereignis zu veröffentlichen, das von [{{eventAuthorName}}] signiert wurde. Du bist derzeit als [{{currentUsername}}] angemeldet. Bist du sicher?', 'Platinum Sponsors': 'Platin-Sponsoren', From: 'Von', - 'Comment on': 'Kommentar zu' + 'Comment on': 'Kommentar zu', + 'View on njump.me': 'Auf njump.me ansehen' } } diff --git a/src/i18n/locales/en.ts b/src/i18n/locales/en.ts index f337a81..33d9a76 100644 --- a/src/i18n/locales/en.ts +++ b/src/i18n/locales/en.ts @@ -232,6 +232,7 @@ export default { 'You are about to publish an event signed by [{{eventAuthorName}}]. You are currently logged in as [{{currentUsername}}]. Are you sure?', 'Platinum Sponsors': 'Platinum Sponsors', From: 'From', - 'Comment on': 'Comment on' + 'Comment on': 'Comment on', + 'View on njump.me': 'View on njump.me' } } diff --git a/src/i18n/locales/es.ts b/src/i18n/locales/es.ts index d5bfe96..4a342e6 100644 --- a/src/i18n/locales/es.ts +++ b/src/i18n/locales/es.ts @@ -237,6 +237,7 @@ export default { 'Estás a punto de publicar un evento firmado por [{{eventAuthorName}}]. Actualmente has iniciado sesión como [{{currentUsername}}]. ¿Estás seguro?', 'Platinum Sponsors': 'Patrocinadores Platino', From: 'De', - 'Comment on': 'Comentar en' + 'Comment on': 'Comentar en', + 'View on njump.me': 'Ver en njump.me' } } diff --git a/src/i18n/locales/fr.ts b/src/i18n/locales/fr.ts index eb642da..fd7ad81 100644 --- a/src/i18n/locales/fr.ts +++ b/src/i18n/locales/fr.ts @@ -237,6 +237,7 @@ export default { 'Vous êtes sur le point de publier un événement signé par [{{eventAuthorName}}]. Vous êtes actuellement connecté en tant que [{{currentUsername}}]. Êtes-vous sûr ?', 'Platinum Sponsors': 'Sponsors Platine', From: 'De', - 'Comment on': 'Commenter sur' + 'Comment on': 'Commenter sur', + 'View on njump.me': 'Voir sur njump.me' } } diff --git a/src/i18n/locales/it.ts b/src/i18n/locales/it.ts index 7b9cef3..f6d041c 100644 --- a/src/i18n/locales/it.ts +++ b/src/i18n/locales/it.ts @@ -236,6 +236,7 @@ export default { 'Stai per pubblicare un evento firmato da [{{eventAuthorName}}]. Attualmente sei connesso come [{{currentUsername}}]. Sei sicuro?', 'Platinum Sponsors': 'Sponsor Platino', From: 'Da', - 'Comment on': 'Commenta su' + 'Comment on': 'Commenta su', + 'View on njump.me': 'Visualizza su njump.me' } } diff --git a/src/i18n/locales/ja.ts b/src/i18n/locales/ja.ts index 8672293..e78a554 100644 --- a/src/i18n/locales/ja.ts +++ b/src/i18n/locales/ja.ts @@ -233,6 +233,7 @@ export default { 'あなたは[{{eventAuthorName}}]によって署名されたイベントを公開しようとしています。現在[{{currentUsername}}]としてログインしています。よろしいですか?', 'Platinum Sponsors': 'プラチナスポンサー', From: 'から', - 'Comment on': 'にコメント' + 'Comment on': 'にコメント', + 'View on njump.me': 'njump.meで表示' } } diff --git a/src/i18n/locales/pl.ts b/src/i18n/locales/pl.ts index 47f16a7..a1c5d78 100644 --- a/src/i18n/locales/pl.ts +++ b/src/i18n/locales/pl.ts @@ -235,6 +235,7 @@ export default { 'Zaraz opublikujesz zdarzenie podpisane przez [{{eventAuthorName}}]. Obecnie jesteś zalogowany jako [{{currentUsername}}]. Czy jesteś pewien?', 'Platinum Sponsors': 'Sponsorzy Platynowi', From: 'Od', - 'Comment on': 'Komentarz do' + 'Comment on': 'Komentarz do', + 'View on njump.me': 'Zobacz na njump.me' } } diff --git a/src/i18n/locales/pt-BR.ts b/src/i18n/locales/pt-BR.ts index 0bf2c57..80ea4a5 100644 --- a/src/i18n/locales/pt-BR.ts +++ b/src/i18n/locales/pt-BR.ts @@ -235,6 +235,7 @@ export default { 'Você está prestes a publicar um evento assinado por [{{eventAuthorName}}]. Você está atualmente logado como [{{currentUsername}}]. Tem certeza?', 'Platinum Sponsors': 'Patrocinadores Platinum', From: 'Fonte', - 'Comment on': 'Comentando' + 'Comment on': 'Comentando', + 'View on njump.me': 'Ver em njump.me' } } diff --git a/src/i18n/locales/pt-PT.ts b/src/i18n/locales/pt-PT.ts index a46b697..bd53019 100644 --- a/src/i18n/locales/pt-PT.ts +++ b/src/i18n/locales/pt-PT.ts @@ -236,6 +236,7 @@ export default { 'Você está prestes a publicar um evento assinado por [{{eventAuthorName}}]. Você está atualmente logado como [{{currentUsername}}]. Tem certeza?', 'Platinum Sponsors': 'Patrocinadores Platinum', From: 'De', - 'Comment on': 'Comentar em' + 'Comment on': 'Comentar em', + 'View on njump.me': 'Ver em njump.me' } } diff --git a/src/i18n/locales/ru.ts b/src/i18n/locales/ru.ts index 8f2e877..20f35b8 100644 --- a/src/i18n/locales/ru.ts +++ b/src/i18n/locales/ru.ts @@ -236,6 +236,7 @@ export default { 'Вы собираетесь опубликовать событие, подписанное [{{eventAuthorName}}]. Вы в данный момент вошли как [{{currentUsername}}]. Вы уверены?', 'Platinum Sponsors': 'Платиновые спонсоры', From: 'От', - 'Comment on': 'Прокомментировать' + 'Comment on': 'Прокомментировать', + 'View on njump.me': 'Посмотреть на njump.me' } } diff --git a/src/i18n/locales/zh.ts b/src/i18n/locales/zh.ts index 28650b0..fd56124 100644 --- a/src/i18n/locales/zh.ts +++ b/src/i18n/locales/zh.ts @@ -233,6 +233,7 @@ export default { '您即将发布一条由 [{{eventAuthorName}}] 签名的事件。您当前以 [{{currentUsername}}] 登录。确定吗?', 'Platinum Sponsors': '白金赞助商', From: '来自', - 'Comment on': '评论于' + 'Comment on': '评论于', + 'View on njump.me': '在 njump.me 上查看' } }