feat: add fallback button to view unsupported events on njump.me
This commit is contained in:
@@ -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 (
|
||||
<div
|
||||
@@ -21,13 +20,12 @@ export function UnknownNote({ event, className }: { event: Event; className?: st
|
||||
<Button
|
||||
onClick={(e) => {
|
||||
e.stopPropagation()
|
||||
navigator.clipboard.writeText(getSharableEventId(event))
|
||||
setIsCopied(true)
|
||||
setTimeout(() => setIsCopied(false), 2000)
|
||||
window.open(toNjump(getSharableEventId(event)), '_blank')
|
||||
}}
|
||||
variant="outline"
|
||||
>
|
||||
{isCopied ? <Check /> : <Copy />} Copy event ID
|
||||
<ExternalLink />
|
||||
<div>{t('View on njump.me')}</div>
|
||||
</Button>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -232,6 +232,7 @@ export default {
|
||||
'أنت على وشك نشر حدث موقع من قبل [{{eventAuthorName}}]. أنت حالياً مسجل الدخول كـ [{{currentUsername}}]. هل أنت متأكد؟',
|
||||
'Platinum Sponsors': 'الرعاة البلاتينيون',
|
||||
From: 'من',
|
||||
'Comment on': 'تعليق على'
|
||||
'Comment on': 'تعليق على',
|
||||
'View on njump.me': 'عرض على njump.me'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -233,6 +233,7 @@ export default {
|
||||
'あなたは[{{eventAuthorName}}]によって署名されたイベントを公開しようとしています。現在[{{currentUsername}}]としてログインしています。よろしいですか?',
|
||||
'Platinum Sponsors': 'プラチナスポンサー',
|
||||
From: 'から',
|
||||
'Comment on': 'にコメント'
|
||||
'Comment on': 'にコメント',
|
||||
'View on njump.me': 'njump.meで表示'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -236,6 +236,7 @@ export default {
|
||||
'Вы собираетесь опубликовать событие, подписанное [{{eventAuthorName}}]. Вы в данный момент вошли как [{{currentUsername}}]. Вы уверены?',
|
||||
'Platinum Sponsors': 'Платиновые спонсоры',
|
||||
From: 'От',
|
||||
'Comment on': 'Прокомментировать'
|
||||
'Comment on': 'Прокомментировать',
|
||||
'View on njump.me': 'Посмотреть на njump.me'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -233,6 +233,7 @@ export default {
|
||||
'您即将发布一条由 [{{eventAuthorName}}] 签名的事件。您当前以 [{{currentUsername}}] 登录。确定吗?',
|
||||
'Platinum Sponsors': '白金赞助商',
|
||||
From: '来自',
|
||||
'Comment on': '评论于'
|
||||
'Comment on': '评论于',
|
||||
'View on njump.me': '在 njump.me 上查看'
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user