Browse Source

feat: add fallback button to view unsupported events on njump.me

imwald
codytseng 10 months ago
parent
commit
a431f31a88
  1. 12
      src/components/Note/UnknownNote.tsx
  2. 3
      src/i18n/locales/ar.ts
  3. 3
      src/i18n/locales/de.ts
  4. 3
      src/i18n/locales/en.ts
  5. 3
      src/i18n/locales/es.ts
  6. 3
      src/i18n/locales/fr.ts
  7. 3
      src/i18n/locales/it.ts
  8. 3
      src/i18n/locales/ja.ts
  9. 3
      src/i18n/locales/pl.ts
  10. 3
      src/i18n/locales/pt-BR.ts
  11. 3
      src/i18n/locales/pt-PT.ts
  12. 3
      src/i18n/locales/ru.ts
  13. 3
      src/i18n/locales/zh.ts

12
src/components/Note/UnknownNote.tsx

@ -1,14 +1,13 @@
import { Button } from '@/components/ui/button' import { Button } from '@/components/ui/button'
import { getSharableEventId } from '@/lib/event' import { getSharableEventId } from '@/lib/event'
import { toNjump } from '@/lib/link'
import { cn } from '@/lib/utils' import { cn } from '@/lib/utils'
import { Check, Copy } from 'lucide-react' import { ExternalLink } from 'lucide-react'
import { Event } from 'nostr-tools' import { Event } from 'nostr-tools'
import { useState } from 'react'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
export function UnknownNote({ event, className }: { event: Event; className?: string }) { export function UnknownNote({ event, className }: { event: Event; className?: string }) {
const { t } = useTranslation() const { t } = useTranslation()
const [isCopied, setIsCopied] = useState(false)
return ( return (
<div <div
@ -21,13 +20,12 @@ export function UnknownNote({ event, className }: { event: Event; className?: st
<Button <Button
onClick={(e) => { onClick={(e) => {
e.stopPropagation() e.stopPropagation()
navigator.clipboard.writeText(getSharableEventId(event)) window.open(toNjump(getSharableEventId(event)), '_blank')
setIsCopied(true)
setTimeout(() => setIsCopied(false), 2000)
}} }}
variant="outline" variant="outline"
> >
{isCopied ? <Check /> : <Copy />} Copy event ID <ExternalLink />
<div>{t('View on njump.me')}</div>
</Button> </Button>
</div> </div>
) )

3
src/i18n/locales/ar.ts

@ -232,6 +232,7 @@ export default {
'أنت على وشك نشر حدث موقع من قبل [{{eventAuthorName}}]. أنت حالياً مسجل الدخول كـ [{{currentUsername}}]. هل أنت متأكد؟', 'أنت على وشك نشر حدث موقع من قبل [{{eventAuthorName}}]. أنت حالياً مسجل الدخول كـ [{{currentUsername}}]. هل أنت متأكد؟',
'Platinum Sponsors': 'الرعاة البلاتينيون', 'Platinum Sponsors': 'الرعاة البلاتينيون',
From: 'من', From: 'من',
'Comment on': 'تعليق على' 'Comment on': 'تعليق على',
'View on njump.me': 'عرض على njump.me'
} }
} }

3
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?', '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', 'Platinum Sponsors': 'Platin-Sponsoren',
From: 'Von', From: 'Von',
'Comment on': 'Kommentar zu' 'Comment on': 'Kommentar zu',
'View on njump.me': 'Auf njump.me ansehen'
} }
} }

3
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?', 'You are about to publish an event signed by [{{eventAuthorName}}]. You are currently logged in as [{{currentUsername}}]. Are you sure?',
'Platinum Sponsors': 'Platinum Sponsors', 'Platinum Sponsors': 'Platinum Sponsors',
From: 'From', From: 'From',
'Comment on': 'Comment on' 'Comment on': 'Comment on',
'View on njump.me': 'View on njump.me'
} }
} }

3
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?', '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', 'Platinum Sponsors': 'Patrocinadores Platino',
From: 'De', From: 'De',
'Comment on': 'Comentar en' 'Comment on': 'Comentar en',
'View on njump.me': 'Ver en njump.me'
} }
} }

3
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 ?', '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', 'Platinum Sponsors': 'Sponsors Platine',
From: 'De', From: 'De',
'Comment on': 'Commenter sur' 'Comment on': 'Commenter sur',
'View on njump.me': 'Voir sur njump.me'
} }
} }

3
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?', 'Stai per pubblicare un evento firmato da [{{eventAuthorName}}]. Attualmente sei connesso come [{{currentUsername}}]. Sei sicuro?',
'Platinum Sponsors': 'Sponsor Platino', 'Platinum Sponsors': 'Sponsor Platino',
From: 'Da', From: 'Da',
'Comment on': 'Commenta su' 'Comment on': 'Commenta su',
'View on njump.me': 'Visualizza su njump.me'
} }
} }

3
src/i18n/locales/ja.ts

@ -233,6 +233,7 @@ export default {
'あなたは[{{eventAuthorName}}]によって署名されたイベントを公開しようとしています。現在[{{currentUsername}}]としてログインしています。よろしいですか?', 'あなたは[{{eventAuthorName}}]によって署名されたイベントを公開しようとしています。現在[{{currentUsername}}]としてログインしています。よろしいですか?',
'Platinum Sponsors': 'プラチナスポンサー', 'Platinum Sponsors': 'プラチナスポンサー',
From: 'から', From: 'から',
'Comment on': 'にコメント' 'Comment on': 'にコメント',
'View on njump.me': 'njump.meで表示'
} }
} }

3
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?', 'Zaraz opublikujesz zdarzenie podpisane przez [{{eventAuthorName}}]. Obecnie jesteś zalogowany jako [{{currentUsername}}]. Czy jesteś pewien?',
'Platinum Sponsors': 'Sponsorzy Platynowi', 'Platinum Sponsors': 'Sponsorzy Platynowi',
From: 'Od', From: 'Od',
'Comment on': 'Komentarz do' 'Comment on': 'Komentarz do',
'View on njump.me': 'Zobacz na njump.me'
} }
} }

3
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?', 'Você está prestes a publicar um evento assinado por [{{eventAuthorName}}]. Você está atualmente logado como [{{currentUsername}}]. Tem certeza?',
'Platinum Sponsors': 'Patrocinadores Platinum', 'Platinum Sponsors': 'Patrocinadores Platinum',
From: 'Fonte', From: 'Fonte',
'Comment on': 'Comentando' 'Comment on': 'Comentando',
'View on njump.me': 'Ver em njump.me'
} }
} }

3
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?', 'Você está prestes a publicar um evento assinado por [{{eventAuthorName}}]. Você está atualmente logado como [{{currentUsername}}]. Tem certeza?',
'Platinum Sponsors': 'Patrocinadores Platinum', 'Platinum Sponsors': 'Patrocinadores Platinum',
From: 'De', From: 'De',
'Comment on': 'Comentar em' 'Comment on': 'Comentar em',
'View on njump.me': 'Ver em njump.me'
} }
} }

3
src/i18n/locales/ru.ts

@ -236,6 +236,7 @@ export default {
'Вы собираетесь опубликовать событие, подписанное [{{eventAuthorName}}]. Вы в данный момент вошли как [{{currentUsername}}]. Вы уверены?', 'Вы собираетесь опубликовать событие, подписанное [{{eventAuthorName}}]. Вы в данный момент вошли как [{{currentUsername}}]. Вы уверены?',
'Platinum Sponsors': 'Платиновые спонсоры', 'Platinum Sponsors': 'Платиновые спонсоры',
From: 'От', From: 'От',
'Comment on': 'Прокомментировать' 'Comment on': 'Прокомментировать',
'View on njump.me': 'Посмотреть на njump.me'
} }
} }

3
src/i18n/locales/zh.ts

@ -233,6 +233,7 @@ export default {
'您即将发布一条由 [{{eventAuthorName}}] 签名的事件。您当前以 [{{currentUsername}}] 登录。确定吗?', '您即将发布一条由 [{{eventAuthorName}}] 签名的事件。您当前以 [{{currentUsername}}] 登录。确定吗?',
'Platinum Sponsors': '白金赞助商', 'Platinum Sponsors': '白金赞助商',
From: '来自', From: '来自',
'Comment on': '评论于' 'Comment on': '评论于',
'View on njump.me': '在 njump.me 上查看'
} }
} }

Loading…
Cancel
Save