feat: 💨
This commit is contained in:
17
src/components/ClientTag/index.tsx
Normal file
17
src/components/ClientTag/index.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
import { getUsingClient } from '@/lib/event'
|
||||
import { NostrEvent } from 'nostr-tools'
|
||||
import { useMemo } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
export default function ClientTag({ event }: { event: NostrEvent }) {
|
||||
const { t } = useTranslation()
|
||||
const usingClient = useMemo(() => getUsingClient(event), [event])
|
||||
|
||||
if (!usingClient) return null
|
||||
|
||||
return (
|
||||
<span className="text-sm text-muted-foreground shrink-0">
|
||||
{t('via {{client}}', { client: usingClient })}
|
||||
</span>
|
||||
)
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useSecondaryPage } from '@/PageManager'
|
||||
import { ExtendedKind, SUPPORTED_KINDS } from '@/constants'
|
||||
import { getParentBech32Id, getUsingClient, isNsfwEvent } from '@/lib/event'
|
||||
import { getParentBech32Id, isNsfwEvent } from '@/lib/event'
|
||||
import { toNote } from '@/lib/link'
|
||||
import { useContentPolicy } from '@/providers/ContentPolicyProvider'
|
||||
import { useMuteList } from '@/providers/MuteListProvider'
|
||||
@@ -8,6 +8,7 @@ import { useScreenSize } from '@/providers/ScreenSizeProvider'
|
||||
import { Event, kinds } from 'nostr-tools'
|
||||
import { useMemo, useState } from 'react'
|
||||
import AudioPlayer from '../AudioPlayer'
|
||||
import ClientTag from '../ClientTag'
|
||||
import Content from '../Content'
|
||||
import { FormattedTimestamp } from '../FormattedTimestamp'
|
||||
import Nip05 from '../Nip05'
|
||||
@@ -51,7 +52,6 @@ export default function Note({
|
||||
() => (hideParentNotePreview ? undefined : getParentBech32Id(event)),
|
||||
[event, hideParentNotePreview]
|
||||
)
|
||||
const usingClient = useMemo(() => getUsingClient(event), [event])
|
||||
const { defaultShowNsfw } = useContentPolicy()
|
||||
const [showNsfw, setShowNsfw] = useState(false)
|
||||
const { mutePubkeySet } = useMuteList()
|
||||
@@ -114,9 +114,7 @@ export default function Note({
|
||||
className={`font-semibold flex truncate ${size === 'small' ? 'text-sm' : ''}`}
|
||||
skeletonClassName={size === 'small' ? 'h-3' : 'h-4'}
|
||||
/>
|
||||
{usingClient && (
|
||||
<span className="text-sm text-muted-foreground shrink-0">using {usingClient}</span>
|
||||
)}
|
||||
<ClientTag event={event} />
|
||||
</div>
|
||||
<div className="flex items-center gap-1 text-sm text-muted-foreground">
|
||||
<Nip05 pubkey={event.pubkey} append="·" />
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useSecondaryPage } from '@/PageManager'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Skeleton } from '@/components/ui/skeleton'
|
||||
import { getUsingClient, isMentioningMutedUsers } from '@/lib/event'
|
||||
import { isMentioningMutedUsers } from '@/lib/event'
|
||||
import { toNote } from '@/lib/link'
|
||||
import { useContentPolicy } from '@/providers/ContentPolicyProvider'
|
||||
import { useMuteList } from '@/providers/MuteListProvider'
|
||||
@@ -9,6 +9,7 @@ import { useScreenSize } from '@/providers/ScreenSizeProvider'
|
||||
import { Event } from 'nostr-tools'
|
||||
import { useMemo, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import ClientTag from '../ClientTag'
|
||||
import Collapsible from '../Collapsible'
|
||||
import Content from '../Content'
|
||||
import { FormattedTimestamp } from '../FormattedTimestamp'
|
||||
@@ -49,7 +50,6 @@ export default function ReplyNote({
|
||||
}
|
||||
return true
|
||||
}, [showMuted, mutePubkeySet, event, hideContentMentioningMutedUsers])
|
||||
const usingClient = useMemo(() => getUsingClient(event), [event])
|
||||
|
||||
return (
|
||||
<div
|
||||
@@ -68,11 +68,7 @@ export default function ReplyNote({
|
||||
className="text-sm font-semibold text-muted-foreground hover:text-foreground truncate"
|
||||
skeletonClassName="h-3"
|
||||
/>
|
||||
{usingClient && (
|
||||
<span className="text-sm text-muted-foreground shrink-0">
|
||||
using {usingClient}
|
||||
</span>
|
||||
)}
|
||||
<ClientTag event={event} />
|
||||
</div>
|
||||
<div className="flex items-center gap-1 text-sm text-muted-foreground">
|
||||
<Nip05 pubkey={event.pubkey} append="·" />
|
||||
|
||||
@@ -400,6 +400,7 @@ export default {
|
||||
Compact: 'مضغوط',
|
||||
'Submit Relay': 'إرسال ريلاي',
|
||||
Homepage: 'الصفحة الرئيسية',
|
||||
'Proof of Work (difficulty {{minPow}})': 'إثبات العمل (الصعوبة {{minPow}})'
|
||||
'Proof of Work (difficulty {{minPow}})': 'إثبات العمل (الصعوبة {{minPow}})',
|
||||
'via {{client}}': 'عبر {{client}}'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -410,6 +410,7 @@ export default {
|
||||
Compact: 'Kompakt',
|
||||
'Submit Relay': 'Relay einreichen',
|
||||
Homepage: 'Homepage',
|
||||
'Proof of Work (difficulty {{minPow}})': 'Arbeitsnachweis (Schwierigkeit {{minPow}})'
|
||||
'Proof of Work (difficulty {{minPow}})': 'Arbeitsnachweis (Schwierigkeit {{minPow}})',
|
||||
'via {{client}}': 'über {{client}}'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -399,6 +399,7 @@ export default {
|
||||
Compact: 'Compact',
|
||||
'Submit Relay': 'Submit Relay',
|
||||
Homepage: 'Homepage',
|
||||
'Proof of Work (difficulty {{minPow}})': 'Proof of Work (difficulty {{minPow}})'
|
||||
'Proof of Work (difficulty {{minPow}})': 'Proof of Work (difficulty {{minPow}})',
|
||||
'via {{client}}': 'via {{client}}'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -405,6 +405,7 @@ export default {
|
||||
Compact: 'Compacto',
|
||||
'Submit Relay': 'Enviar relé',
|
||||
Homepage: 'Página principal',
|
||||
'Proof of Work (difficulty {{minPow}})': 'Prueba de Trabajo (dificultad {{minPow}})'
|
||||
'Proof of Work (difficulty {{minPow}})': 'Prueba de Trabajo (dificultad {{minPow}})',
|
||||
'via {{client}}': 'vía {{client}}'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -401,6 +401,7 @@ export default {
|
||||
Compact: 'فشرده',
|
||||
'Submit Relay': 'ارسال رله',
|
||||
Homepage: 'صفحه اصلی',
|
||||
'Proof of Work (difficulty {{minPow}})': 'اثبات کار (دشواری {{minPow}})'
|
||||
'Proof of Work (difficulty {{minPow}})': 'اثبات کار (دشواری {{minPow}})',
|
||||
'via {{client}}': 'از طریق {{client}}'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -410,6 +410,7 @@ export default {
|
||||
Compact: 'Compact',
|
||||
'Submit Relay': 'Soumettre un relais',
|
||||
Homepage: 'Page d’accueil',
|
||||
'Proof of Work (difficulty {{minPow}})': 'Preuve de travail (difficulté {{minPow}})'
|
||||
'Proof of Work (difficulty {{minPow}})': 'Preuve de travail (difficulté {{minPow}})',
|
||||
'via {{client}}': 'via {{client}}'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -404,6 +404,7 @@ export default {
|
||||
Compact: 'संक्षिप्त',
|
||||
'Submit Relay': 'रिले सबमिट करें',
|
||||
Homepage: 'होमपेज',
|
||||
'Proof of Work (difficulty {{minPow}})': 'कार्य प्रमाण (कठिनाई {{minPow}})'
|
||||
'Proof of Work (difficulty {{minPow}})': 'कार्य प्रमाण (कठिनाई {{minPow}})',
|
||||
'via {{client}}': 'के माध्यम से {{client}}'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -405,6 +405,7 @@ export default {
|
||||
Compact: 'Compatto',
|
||||
'Submit Relay': 'Invia Relay',
|
||||
Homepage: 'Homepage',
|
||||
'Proof of Work (difficulty {{minPow}})': 'Proof of Work (difficoltà {{minPow}})'
|
||||
'Proof of Work (difficulty {{minPow}})': 'Proof of Work (difficoltà {{minPow}})',
|
||||
'via {{client}}': 'tramite {{client}}'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -402,6 +402,7 @@ export default {
|
||||
Compact: 'コンパクト',
|
||||
'Submit Relay': 'リレーを提出',
|
||||
Homepage: 'ホームページ',
|
||||
'Proof of Work (difficulty {{minPow}})': 'プルーフオブワーク (難易度 {{minPow}})'
|
||||
'Proof of Work (difficulty {{minPow}})': 'プルーフオブワーク (難易度 {{minPow}})',
|
||||
'via {{client}}': '{{client}} 経由'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -402,6 +402,7 @@ export default {
|
||||
Compact: '간단',
|
||||
'Submit Relay': '릴레이 제출',
|
||||
Homepage: '홈페이지',
|
||||
'Proof of Work (difficulty {{minPow}})': '작업 증명 (난이도 {{minPow}})'
|
||||
'Proof of Work (difficulty {{minPow}})': '작업 증명 (난이도 {{minPow}})',
|
||||
'via {{client}}': '{{client}} 통해'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -406,6 +406,7 @@ export default {
|
||||
Compact: 'Zwięzły',
|
||||
'Submit Relay': 'Prześlij przekaźnik',
|
||||
Homepage: 'Strona główna',
|
||||
'Proof of Work (difficulty {{minPow}})': 'Dowód pracy (trudność {{minPow}})'
|
||||
'Proof of Work (difficulty {{minPow}})': 'Dowód pracy (trudność {{minPow}})',
|
||||
'via {{client}}': 'przez {{client}}'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -402,6 +402,7 @@ export default {
|
||||
Compact: 'Compacto',
|
||||
'Submit Relay': 'Enviar Relay',
|
||||
Homepage: 'Página inicial',
|
||||
'Proof of Work (difficulty {{minPow}})': 'Prova de Trabalho (dificuldade {{minPow}})'
|
||||
'Proof of Work (difficulty {{minPow}})': 'Prova de Trabalho (dificuldade {{minPow}})',
|
||||
'via {{client}}': 'via {{client}}'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -405,6 +405,7 @@ export default {
|
||||
Compact: 'Compacto',
|
||||
'Submit Relay': 'Enviar Relay',
|
||||
Homepage: 'Página inicial',
|
||||
'Proof of Work (difficulty {{minPow}})': 'Prova de Trabalho (dificuldade {{minPow}})'
|
||||
'Proof of Work (difficulty {{minPow}})': 'Prova de Trabalho (dificuldade {{minPow}})',
|
||||
'via {{client}}': 'via {{client}}'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -407,6 +407,7 @@ export default {
|
||||
Compact: 'Компактный',
|
||||
'Submit Relay': 'Отправить релей',
|
||||
Homepage: 'Домашняя страница',
|
||||
'Proof of Work (difficulty {{minPow}})': 'Доказательство работы (сложность {{minPow}})'
|
||||
'Proof of Work (difficulty {{minPow}})': 'Доказательство работы (сложность {{minPow}})',
|
||||
'via {{client}}': 'через {{client}}'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -397,6 +397,7 @@ export default {
|
||||
Compact: 'กะทัดรัด',
|
||||
'Submit Relay': 'ส่งรีเลย์',
|
||||
Homepage: 'หน้าแรก',
|
||||
'Proof of Work (difficulty {{minPow}})': 'หลักฐานการทำงาน (ความยาก {{minPow}})'
|
||||
'Proof of Work (difficulty {{minPow}})': 'หลักฐานการทำงาน (ความยาก {{minPow}})',
|
||||
'via {{client}}': 'ผ่าน {{client}}'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -395,6 +395,7 @@ export default {
|
||||
Compact: '紧凑',
|
||||
'Submit Relay': '提交服务器',
|
||||
Homepage: '主页',
|
||||
'Proof of Work (difficulty {{minPow}})': '工作量证明 (难度 {{minPow}})'
|
||||
'Proof of Work (difficulty {{minPow}})': '工作量证明 (难度 {{minPow}})',
|
||||
'via {{client}}': '来自 {{client}}'
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user