Notifications : réactions et commentaires sur mes avis, activité des comptes suivis
deploy / deploy (push) Successful in 39s
deploy / deploy (push) Successful in 39s
- Quelqu'un réagit (emoji) ou commente mon avis → notification avec le titre ; la toucher ouvre ma fiche - Un compte que je suis donne son avis, commence une série / un anime / un drama, ou ajoute un titre à « À voir » → notification avec l'affiche ; la toucher ouvre sa fiche - Serveur (migration 20261128180000, appliquée) : déclencheurs sur réactions, commentaires et fiches ; rafales (import, ajouts en série) regroupées en une seule notification par personne et par type sur 3 h ; jamais entre comptes bloqués ni d'un compte suspendu ; une réaction retirée retire sa notification - Pas de notification pour les listes perso : elles sont privées - Textes dans les 18 langues Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVo1qxKoBQCaMd7Ue8PGbe
This commit is contained in:
22 files changed
+322
-27
No files matched your search
@@ -1,7 +1,8 @@
|
||||
import { Loader2 } from 'lucide-react'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { t, type TKey } from '../../i18n'
|
||||
import { acceptFollower, getNotifications, markNotificationsRead, removeFollower, type FollowNotification } from '../../lib/cloud/social'
|
||||
import { acceptFollower, getNotifications, markNotificationsRead, MINE_ITEM_KINDS, removeFollower, type FollowNotification } from '../../lib/cloud/social'
|
||||
import Poster from '../Poster'
|
||||
import { timeAgo } from '../../lib/timeAgo'
|
||||
import { cx } from '../../lib/utils'
|
||||
import Avatar from './Avatar'
|
||||
@@ -13,9 +14,17 @@ const TEXT: Record<FollowNotification['kind'], TKey> = {
|
||||
follow_request: 'notif.followRequest',
|
||||
unfollow: 'notif.unfollow',
|
||||
follow_accepted: 'notif.followAccepted',
|
||||
reaction: 'notif.reaction',
|
||||
review_comment: 'notif.reviewComment',
|
||||
friend_review: 'notif.friendReview',
|
||||
friend_started: 'notif.friendStarted',
|
||||
friend_added: 'notif.friendAdded',
|
||||
}
|
||||
|
||||
/** Qui s'est abonné, désabonné, a demandé à s'abonner ou a accepté ma demande. Ouvrir la liste la marque comme lue. */
|
||||
/**
|
||||
* Abonnements (qui s'abonne, se désabonne, demande, accepte), réactions et commentaires sur mes avis,
|
||||
* et activité des comptes que je suis (avis, série commencée, titre ajouté). Ouvrir la liste la marque comme lue.
|
||||
*/
|
||||
export default function NotificationsSheet({ onClose, onSeen }: { onClose: () => void; onSeen: () => void }) {
|
||||
const social = useSocial()
|
||||
const [list, setList] = useState<FollowNotification[]>()
|
||||
@@ -38,6 +47,13 @@ export default function NotificationsSheet({ onClose, onSeen }: { onClose: () =>
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [])
|
||||
|
||||
// Toucher une notification : le titre concerné s'il y en a un (le mien ou celui de la personne), sinon son profil
|
||||
const open = (n: FollowNotification) => {
|
||||
if (!n.item) return social.openProfile(n.actor.username)
|
||||
if (MINE_ITEM_KINDS.includes(n.kind)) social.openItem(n.item)
|
||||
else social.openItem(n.item, { username: n.actor.username, displayName: n.actor.displayName, avatarUrl: n.actor.avatarUrl })
|
||||
}
|
||||
|
||||
const pending = new Set(social.requests.map((r) => r.id))
|
||||
const answer = async (id: string, accept: boolean) => {
|
||||
setBusy(id)
|
||||
@@ -68,20 +84,25 @@ export default function NotificationsSheet({ onClose, onSeen }: { onClose: () =>
|
||||
<ul className="divide-y divide-line">
|
||||
{list.map((n) => (
|
||||
<li key={n.id} className="flex items-center gap-3 py-3">
|
||||
<button onClick={() => social.openProfile(n.actor.username)} className="flex min-w-0 flex-1 items-center gap-3 text-start">
|
||||
<button onClick={() => open(n)} className="flex min-w-0 flex-1 items-center gap-3 text-start">
|
||||
<span className="relative shrink-0">
|
||||
<Avatar url={n.actor.avatarUrl} name={n.actor.displayName} size={44} />
|
||||
{!n.read && <span className="absolute -end-0.5 -top-0.5 size-3 rounded-full border-2 border-bg bg-accent-fill" aria-hidden="true" />}
|
||||
</span>
|
||||
<span className="min-w-0 flex-1">
|
||||
<span className={cx('block text-sm leading-snug', n.kind === 'unfollow' ? 'text-ink-2' : 'text-ink')}>
|
||||
{t(TEXT[n.kind], { name: n.actor.displayName })}
|
||||
{t(TEXT[n.kind], { name: n.actor.displayName, title: n.item?.title ?? '', emoji: n.emoji ?? '' })}
|
||||
</span>
|
||||
<span className="mt-0.5 flex gap-2 text-xs text-ink-3">
|
||||
<span className="truncate">@{n.actor.username}</span>
|
||||
<span className="shrink-0">{timeAgo(n.createdAt)}</span>
|
||||
</span>
|
||||
</span>
|
||||
{n.item && (
|
||||
<span className="w-10 shrink-0">
|
||||
<Poster src={n.item.poster} title={n.item.title} />
|
||||
</span>
|
||||
)}
|
||||
</button>
|
||||
{n.kind === 'follow_request' && pending.has(n.actor.id) && (
|
||||
<span className="flex shrink-0 gap-1.5">
|
||||
|
||||
@@ -715,12 +715,17 @@ const dict: Translations = {
|
||||
'social.noFollowing': 'لا تتابع أحدًا بعد.',
|
||||
'social.noFollowers': 'لا متابعين بعد.',
|
||||
'notif.title': 'الإشعارات',
|
||||
'notif.empty': 'عندما يتابعك أحد أو يلغي متابعتك، ستراه هنا.',
|
||||
'notif.empty': "ستظهر هنا المتابعات والتفاعلات مع مراجعاتك ونشاط من تتابعهم.",
|
||||
'notif.error': 'تعذّر تحميل الإشعارات.',
|
||||
'notif.newFollower': '{name} يتابعك',
|
||||
'notif.followRequest': '{name} يطلب متابعتك',
|
||||
'notif.unfollow': '{name} ألغى متابعتك',
|
||||
'notif.followAccepted': '{name} قبل طلبك',
|
||||
'notif.reaction': "تفاعل {name} بـ {emoji} مع مراجعتك لـ {title}",
|
||||
'notif.reviewComment': "علّق {name} على مراجعتك لـ {title}",
|
||||
'notif.friendReview': "كتب {name} مراجعة عن {title}",
|
||||
'notif.friendStarted': "بدأ {name} مشاهدة {title}",
|
||||
'notif.friendAdded': "يريد {name} مشاهدة {title}",
|
||||
'notif.unread_one': '{count} إشعار جديد',
|
||||
'notif.unread_other': '{count} إشعارات جديدة',
|
||||
'notif.unread_two': 'إشعاران جديدان',
|
||||
|
||||
@@ -631,12 +631,17 @@ const dict: Translations = {
|
||||
'social.noFollowing': 'Du folgst noch niemandem.',
|
||||
'social.noFollowers': 'Noch keine Follower.',
|
||||
'notif.title': 'Benachrichtigungen',
|
||||
'notif.empty': 'Wenn dir jemand folgt oder entfolgt, siehst du es hier.',
|
||||
'notif.empty': "Hier erscheinen Follows, Reaktionen auf deine Kritiken und Aktivitäten der Leute, denen du folgst.",
|
||||
'notif.error': 'Benachrichtigungen konnten nicht geladen werden.',
|
||||
'notif.newFollower': '{name} folgt dir',
|
||||
'notif.followRequest': '{name} möchte dir folgen',
|
||||
'notif.unfollow': '{name} folgt dir nicht mehr',
|
||||
'notif.followAccepted': '{name} hat deine Anfrage angenommen',
|
||||
'notif.reaction': "{name} hat mit {emoji} auf deine Kritik zu {title} reagiert",
|
||||
'notif.reviewComment': "{name} hat deine Kritik zu {title} kommentiert",
|
||||
'notif.friendReview': "{name} hat {title} rezensiert",
|
||||
'notif.friendStarted': "{name} hat mit {title} angefangen",
|
||||
'notif.friendAdded': "{name} will {title} sehen",
|
||||
'notif.unread_one': '{count} neue Benachrichtigung',
|
||||
'notif.unread_other': '{count} neue Benachrichtigungen',
|
||||
'social.accept': 'Annehmen',
|
||||
|
||||
@@ -631,12 +631,17 @@ const dict: Translations = {
|
||||
'social.noFollowing': 'Not following anyone yet.',
|
||||
'social.noFollowers': 'No followers yet.',
|
||||
'notif.title': 'Notifications',
|
||||
'notif.empty': 'When someone follows or unfollows you, you\'ll see it here.',
|
||||
'notif.empty': "Follows, reactions to your reviews and activity from people you follow will show up here.",
|
||||
'notif.error': 'Couldn\'t load notifications.',
|
||||
'notif.newFollower': '{name} followed you',
|
||||
'notif.followRequest': '{name} asked to follow you',
|
||||
'notif.unfollow': '{name} unfollowed you',
|
||||
'notif.followAccepted': '{name} accepted your request',
|
||||
'notif.reaction': "{name} reacted {emoji} to your review of {title}",
|
||||
'notif.reviewComment': "{name} commented on your review of {title}",
|
||||
'notif.friendReview': "{name} reviewed {title}",
|
||||
'notif.friendStarted': "{name} started {title}",
|
||||
'notif.friendAdded': "{name} wants to watch {title}",
|
||||
'notif.unread_one': '{count} new notification',
|
||||
'notif.unread_other': '{count} new notifications',
|
||||
'social.accept': 'Accept',
|
||||
|
||||
@@ -631,12 +631,17 @@ const dict: Translations = {
|
||||
'social.noFollowing': 'Todavía no sigues a nadie.',
|
||||
'social.noFollowers': 'Todavía no tienes seguidores.',
|
||||
'notif.title': 'Notificaciones',
|
||||
'notif.empty': 'Cuando alguien te siga o deje de seguirte, lo verás aquí.',
|
||||
'notif.empty': "Aquí verás seguidores, reacciones a tus reseñas y la actividad de quienes sigues.",
|
||||
'notif.error': 'No se pudieron cargar las notificaciones.',
|
||||
'notif.newFollower': '{name} te sigue',
|
||||
'notif.followRequest': '{name} quiere seguirte',
|
||||
'notif.unfollow': '{name} ya no te sigue',
|
||||
'notif.followAccepted': '{name} aceptó tu solicitud',
|
||||
'notif.reaction': "{name} reaccionó {emoji} a tu reseña de {title}",
|
||||
'notif.reviewComment': "{name} comentó tu reseña de {title}",
|
||||
'notif.friendReview': "{name} reseñó {title}",
|
||||
'notif.friendStarted': "{name} empezó {title}",
|
||||
'notif.friendAdded': "{name} quiere ver {title}",
|
||||
'notif.unread_one': '{count} notificación nueva',
|
||||
'notif.unread_other': '{count} notificaciones nuevas',
|
||||
'social.accept': 'Aceptar',
|
||||
|
||||
@@ -633,12 +633,17 @@ const dict = {
|
||||
'social.noFollowing': 'Aucun abonnement pour l\'instant.',
|
||||
'social.noFollowers': 'Aucun abonné pour l\'instant.',
|
||||
'notif.title': 'Notifications',
|
||||
'notif.empty': 'Quand quelqu\'un s\'abonne ou se désabonne, tu le verras ici.',
|
||||
'notif.empty': "Les abonnements, les réactions à tes avis et l'activité des comptes que tu suis apparaîtront ici.",
|
||||
'notif.error': 'Impossible de charger les notifications.',
|
||||
'notif.newFollower': '{name} te suit',
|
||||
'notif.followRequest': '{name} demande à te suivre',
|
||||
'notif.unfollow': '{name} ne te suit plus',
|
||||
'notif.followAccepted': '{name} a accepté ta demande',
|
||||
'notif.reaction': "{name} a réagi {emoji} à ton avis sur {title}",
|
||||
'notif.reviewComment': "{name} a commenté ton avis sur {title}",
|
||||
'notif.friendReview': "{name} a donné son avis sur {title}",
|
||||
'notif.friendStarted': "{name} a commencé {title}",
|
||||
'notif.friendAdded': "{name} veut voir {title}",
|
||||
'notif.unread_one': '{count} nouvelle notification',
|
||||
'notif.unread_other': '{count} nouvelles notifications',
|
||||
'social.accept': 'Accepter',
|
||||
|
||||
@@ -631,12 +631,17 @@ const dict: Translations = {
|
||||
'social.noFollowing': 'अभी आप किसी को फ़ॉलो नहीं कर रहे।',
|
||||
'social.noFollowers': 'अभी कोई फ़ॉलोअर नहीं।',
|
||||
'notif.title': 'सूचनाएँ',
|
||||
'notif.empty': 'जब कोई आपको फ़ॉलो या अनफ़ॉलो करेगा, आप उसे यहाँ देखेंगे।',
|
||||
'notif.empty': "फ़ॉलो, आपकी समीक्षाओं पर प्रतिक्रियाएँ और आप जिन्हें फ़ॉलो करते हैं उनकी गतिविधि यहाँ दिखेगी।",
|
||||
'notif.error': 'सूचनाएँ लोड नहीं हो सकीं।',
|
||||
'notif.newFollower': '{name} आपको फ़ॉलो करते हैं',
|
||||
'notif.followRequest': '{name} आपको फ़ॉलो करना चाहते हैं',
|
||||
'notif.unfollow': '{name} ने आपको अनफ़ॉलो किया',
|
||||
'notif.followAccepted': '{name} ने आपका अनुरोध स्वीकार किया',
|
||||
'notif.reaction': "{name} ने {title} पर आपकी समीक्षा पर {emoji} प्रतिक्रिया दी",
|
||||
'notif.reviewComment': "{name} ने {title} पर आपकी समीक्षा पर टिप्पणी की",
|
||||
'notif.friendReview': "{name} ने {title} की समीक्षा की",
|
||||
'notif.friendStarted': "{name} ने {title} देखना शुरू किया",
|
||||
'notif.friendAdded': "{name} {title} देखना चाहते हैं",
|
||||
'notif.unread_one': '{count} नई सूचना',
|
||||
'notif.unread_other': '{count} नई सूचनाएँ',
|
||||
'social.accept': 'स्वीकार करें',
|
||||
|
||||
@@ -631,12 +631,17 @@ const dict: Translations = {
|
||||
'social.noFollowing': 'Belum mengikuti siapa pun.',
|
||||
'social.noFollowers': 'Belum ada pengikut.',
|
||||
'notif.title': 'Notifikasi',
|
||||
'notif.empty': 'Saat seseorang mengikuti atau berhenti mengikutimu, kamu akan melihatnya di sini.',
|
||||
'notif.empty': "Pengikut, reaksi pada ulasanmu, dan aktivitas orang yang kamu ikuti akan muncul di sini.",
|
||||
'notif.error': 'Notifikasi tidak dapat dimuat.',
|
||||
'notif.newFollower': '{name} mengikutimu',
|
||||
'notif.followRequest': '{name} ingin mengikutimu',
|
||||
'notif.unfollow': '{name} berhenti mengikutimu',
|
||||
'notif.followAccepted': '{name} menerima permintaanmu',
|
||||
'notif.reaction': "{name} memberi reaksi {emoji} pada ulasanmu tentang {title}",
|
||||
'notif.reviewComment': "{name} mengomentari ulasanmu tentang {title}",
|
||||
'notif.friendReview': "{name} mengulas {title}",
|
||||
'notif.friendStarted': "{name} mulai menonton {title}",
|
||||
'notif.friendAdded': "{name} ingin menonton {title}",
|
||||
'notif.unread_one': '{count} notifikasi baru',
|
||||
'notif.unread_other': '{count} notifikasi baru',
|
||||
'social.accept': 'Terima',
|
||||
|
||||
@@ -631,12 +631,17 @@ const dict: Translations = {
|
||||
'social.noFollowing': 'Non segui ancora nessuno.',
|
||||
'social.noFollowers': 'Ancora nessun follower.',
|
||||
'notif.title': 'Notifiche',
|
||||
'notif.empty': 'Quando qualcuno inizia o smette di seguirti, lo vedrai qui.',
|
||||
'notif.empty': "Qui vedrai i follower, le reazioni alle tue recensioni e l'attività di chi segui.",
|
||||
'notif.error': 'Impossibile caricare le notifiche.',
|
||||
'notif.newFollower': '{name} ti segue',
|
||||
'notif.followRequest': '{name} chiede di seguirti',
|
||||
'notif.unfollow': '{name} non ti segue più',
|
||||
'notif.followAccepted': '{name} ha accettato la tua richiesta',
|
||||
'notif.reaction': "{name} ha reagito {emoji} alla tua recensione di {title}",
|
||||
'notif.reviewComment': "{name} ha commentato la tua recensione di {title}",
|
||||
'notif.friendReview': "{name} ha recensito {title}",
|
||||
'notif.friendStarted': "{name} ha iniziato {title}",
|
||||
'notif.friendAdded': "{name} vuole vedere {title}",
|
||||
'notif.unread_one': '{count} nuova notifica',
|
||||
'notif.unread_other': '{count} nuove notifiche',
|
||||
'social.accept': 'Accetta',
|
||||
|
||||
@@ -631,12 +631,17 @@ const dict: Translations = {
|
||||
'social.noFollowing': 'まだ誰もフォローしていません。',
|
||||
'social.noFollowers': 'まだフォロワーはいません。',
|
||||
'notif.title': '通知',
|
||||
'notif.empty': '誰かにフォローまたはフォロー解除されると、ここに表示されます。',
|
||||
'notif.empty': "フォロー、レビューへのリアクション、フォロー中の人のアクティビティがここに表示されます。",
|
||||
'notif.error': '通知を読み込めませんでした。',
|
||||
'notif.newFollower': '{name}さんがあなたをフォローしました',
|
||||
'notif.followRequest': '{name}さんがフォローをリクエストしました',
|
||||
'notif.unfollow': '{name}さんがフォローを解除しました',
|
||||
'notif.followAccepted': '{name}さんがリクエストを承認しました',
|
||||
'notif.reaction': "{name}さんが「{title}」のあなたのレビューに{emoji}でリアクションしました",
|
||||
'notif.reviewComment': "{name}さんが「{title}」のあなたのレビューにコメントしました",
|
||||
'notif.friendReview': "{name}さんが「{title}」をレビューしました",
|
||||
'notif.friendStarted': "{name}さんが「{title}」を見始めました",
|
||||
'notif.friendAdded': "{name}さんが「{title}」を見たいリストに追加しました",
|
||||
'notif.unread_one': '新しい通知 {count} 件',
|
||||
'notif.unread_other': '新しい通知 {count} 件',
|
||||
'social.accept': '承認',
|
||||
|
||||
@@ -631,12 +631,17 @@ const dict: Translations = {
|
||||
'social.noFollowing': '아직 팔로우한 사람이 없어요.',
|
||||
'social.noFollowers': '아직 팔로워가 없어요.',
|
||||
'notif.title': '알림',
|
||||
'notif.empty': '누군가 나를 팔로우하거나 언팔로우하면 여기에 표시돼요.',
|
||||
'notif.empty': "팔로우, 리뷰 반응, 팔로우한 사람들의 활동이 여기에 표시돼요.",
|
||||
'notif.error': '알림을 불러오지 못했어요.',
|
||||
'notif.newFollower': '{name}님이 나를 팔로우해요',
|
||||
'notif.followRequest': '{name}님이 팔로우를 요청했어요',
|
||||
'notif.unfollow': '{name}님이 언팔로우했어요',
|
||||
'notif.followAccepted': '{name}님이 요청을 수락했어요',
|
||||
'notif.reaction': "{name}님이 {title} 리뷰에 {emoji} 반응을 남겼어요",
|
||||
'notif.reviewComment': "{name}님이 {title} 리뷰에 댓글을 달았어요",
|
||||
'notif.friendReview': "{name}님이 {title} 리뷰를 남겼어요",
|
||||
'notif.friendStarted': "{name}님이 {title} 시청을 시작했어요",
|
||||
'notif.friendAdded': "{name}님이 {title}을(를) 보고 싶어 해요",
|
||||
'notif.unread_one': '새 알림 {count}개',
|
||||
'notif.unread_other': '새 알림 {count}개',
|
||||
'social.accept': '수락',
|
||||
|
||||
@@ -631,12 +631,17 @@ const dict: Translations = {
|
||||
'social.noFollowing': 'Je volgt nog niemand.',
|
||||
'social.noFollowers': 'Nog geen volgers.',
|
||||
'notif.title': 'Meldingen',
|
||||
'notif.empty': 'Als iemand je volgt of ontvolgt, zie je het hier.',
|
||||
'notif.empty': "Volgers, reacties op je recensies en activiteit van wie je volgt verschijnen hier.",
|
||||
'notif.error': 'Meldingen konden niet worden geladen.',
|
||||
'notif.newFollower': '{name} volgt je',
|
||||
'notif.followRequest': '{name} wil je volgen',
|
||||
'notif.unfollow': '{name} volgt je niet meer',
|
||||
'notif.followAccepted': '{name} heeft je verzoek geaccepteerd',
|
||||
'notif.reaction': "{name} reageerde {emoji} op je recensie van {title}",
|
||||
'notif.reviewComment': "{name} reageerde op je recensie van {title}",
|
||||
'notif.friendReview': "{name} recenseerde {title}",
|
||||
'notif.friendStarted': "{name} is begonnen aan {title}",
|
||||
'notif.friendAdded': "{name} wil {title} zien",
|
||||
'notif.unread_one': '{count} nieuwe melding',
|
||||
'notif.unread_other': '{count} nieuwe meldingen',
|
||||
'social.accept': 'Accepteren',
|
||||
|
||||
@@ -687,12 +687,17 @@ const dict: Translations = {
|
||||
'social.noFollowing': 'Na razie nikogo nie obserwujesz.',
|
||||
'social.noFollowers': 'Na razie brak obserwujących.',
|
||||
'notif.title': 'Powiadomienia',
|
||||
'notif.empty': 'Gdy ktoś zacznie lub przestanie cię obserwować, zobaczysz to tutaj.',
|
||||
'notif.empty': "Tu pojawią się obserwacje, reakcje na twoje recenzje i aktywność osób, które obserwujesz.",
|
||||
'notif.error': 'Nie udało się wczytać powiadomień.',
|
||||
'notif.newFollower': '{name} obserwuje cię',
|
||||
'notif.followRequest': '{name} prosi o możliwość obserwowania',
|
||||
'notif.unfollow': '{name} już cię nie obserwuje',
|
||||
'notif.followAccepted': '{name} zaakceptował(a) twoją prośbę',
|
||||
'notif.reaction': "{name} zareagował(a) {emoji} na twoją recenzję {title}",
|
||||
'notif.reviewComment': "{name} skomentował(a) twoją recenzję {title}",
|
||||
'notif.friendReview': "{name} zrecenzował(a) {title}",
|
||||
'notif.friendStarted': "{name} zaczął/zaczęła {title}",
|
||||
'notif.friendAdded': "{name} chce obejrzeć {title}",
|
||||
'notif.unread_one': '{count} nowe powiadomienie',
|
||||
'notif.unread_other': '{count} nowych powiadomień',
|
||||
'notif.unread_few': '{count} nowe powiadomienia',
|
||||
|
||||
@@ -631,12 +631,17 @@ const dict: Translations = {
|
||||
'social.noFollowing': 'Você ainda não segue ninguém.',
|
||||
'social.noFollowers': 'Nenhum seguidor por enquanto.',
|
||||
'notif.title': 'Notificações',
|
||||
'notif.empty': 'Quando alguém te seguir ou deixar de seguir, verás aqui.',
|
||||
'notif.empty': "Aqui vais ver seguidores, reações às tuas críticas e a atividade de quem segues.",
|
||||
'notif.error': 'Não foi possível carregar as notificações.',
|
||||
'notif.newFollower': '{name} segue-te',
|
||||
'notif.followRequest': '{name} pediu para te seguir',
|
||||
'notif.unfollow': '{name} deixou de te seguir',
|
||||
'notif.followAccepted': '{name} aceitou o teu pedido',
|
||||
'notif.reaction': "{name} reagiu {emoji} à tua crítica de {title}",
|
||||
'notif.reviewComment': "{name} comentou a tua crítica de {title}",
|
||||
'notif.friendReview': "{name} deu a sua opinião sobre {title}",
|
||||
'notif.friendStarted': "{name} começou {title}",
|
||||
'notif.friendAdded': "{name} quer ver {title}",
|
||||
'notif.unread_one': '{count} nova notificação',
|
||||
'notif.unread_other': '{count} novas notificações',
|
||||
'social.accept': 'Aceitar',
|
||||
|
||||
@@ -687,12 +687,17 @@ const dict: Translations = {
|
||||
'social.noFollowing': 'Ты пока ни на кого не подписан.',
|
||||
'social.noFollowers': 'Подписчиков пока нет.',
|
||||
'notif.title': 'Уведомления',
|
||||
'notif.empty': 'Когда кто-то подпишется или отпишется, ты увидишь это здесь.',
|
||||
'notif.empty': "Здесь появятся подписки, реакции на твои отзывы и активность тех, на кого ты подписан(а).",
|
||||
'notif.error': 'Не удалось загрузить уведомления.',
|
||||
'notif.newFollower': '{name} подписался(-ась) на тебя',
|
||||
'notif.followRequest': '{name} хочет подписаться на тебя',
|
||||
'notif.unfollow': '{name} отписался(-ась) от тебя',
|
||||
'notif.followAccepted': '{name} принял(а) твой запрос',
|
||||
'notif.reaction': "{name} отреагировал(а) {emoji} на твой отзыв о {title}",
|
||||
'notif.reviewComment': "{name} прокомментировал(а) твой отзыв о {title}",
|
||||
'notif.friendReview': "{name} оставил(а) отзыв о {title}",
|
||||
'notif.friendStarted': "{name} начал(а) смотреть {title}",
|
||||
'notif.friendAdded': "{name} хочет посмотреть {title}",
|
||||
'notif.unread_one': '{count} новое уведомление',
|
||||
'notif.unread_other': 'Новых уведомлений: {count}',
|
||||
'notif.unread_few': '{count} новых уведомления',
|
||||
|
||||
@@ -631,12 +631,17 @@ const dict: Translations = {
|
||||
'social.noFollowing': 'ยังไม่ได้ติดตามใคร',
|
||||
'social.noFollowers': 'ยังไม่มีผู้ติดตาม',
|
||||
'notif.title': 'การแจ้งเตือน',
|
||||
'notif.empty': 'เมื่อมีคนติดตามหรือเลิกติดตามคุณ คุณจะเห็นที่นี่',
|
||||
'notif.empty': "การติดตาม ความรู้สึกต่อรีวิวของคุณ และกิจกรรมของคนที่คุณติดตามจะแสดงที่นี่",
|
||||
'notif.error': 'โหลดการแจ้งเตือนไม่ได้',
|
||||
'notif.newFollower': '{name} ติดตามคุณ',
|
||||
'notif.followRequest': '{name} ขอติดตามคุณ',
|
||||
'notif.unfollow': '{name} เลิกติดตามคุณ',
|
||||
'notif.followAccepted': '{name} ยอมรับคำขอของคุณ',
|
||||
'notif.reaction': "{name} แสดงความรู้สึก {emoji} ต่อรีวิว {title} ของคุณ",
|
||||
'notif.reviewComment': "{name} แสดงความคิดเห็นในรีวิว {title} ของคุณ",
|
||||
'notif.friendReview': "{name} รีวิว {title}",
|
||||
'notif.friendStarted': "{name} เริ่มดู {title}",
|
||||
'notif.friendAdded': "{name} อยากดู {title}",
|
||||
'notif.unread_one': 'การแจ้งเตือนใหม่ {count} รายการ',
|
||||
'notif.unread_other': 'การแจ้งเตือนใหม่ {count} รายการ',
|
||||
'social.accept': 'ยอมรับ',
|
||||
|
||||
@@ -631,12 +631,17 @@ const dict: Translations = {
|
||||
'social.noFollowing': 'Henüz kimseyi takip etmiyorsun.',
|
||||
'social.noFollowers': 'Henüz takipçi yok.',
|
||||
'notif.title': 'Bildirimler',
|
||||
'notif.empty': 'Biri seni takip ettiğinde veya takibi bıraktığında burada göreceksin.',
|
||||
'notif.empty': "Takipler, yorumlarına gelen tepkiler ve takip ettiklerinin etkinlikleri burada görünecek.",
|
||||
'notif.error': 'Bildirimler yüklenemedi.',
|
||||
'notif.newFollower': '{name} seni takip ediyor',
|
||||
'notif.followRequest': '{name} seni takip etmek istiyor',
|
||||
'notif.unfollow': '{name} seni takip etmeyi bıraktı',
|
||||
'notif.followAccepted': '{name} isteğini kabul etti',
|
||||
'notif.reaction': "{name}, {title} yorumuna {emoji} tepkisi verdi",
|
||||
'notif.reviewComment': "{name}, {title} yorumuna yorum yaptı",
|
||||
'notif.friendReview': "{name}, {title} hakkında yorum yazdı",
|
||||
'notif.friendStarted': "{name}, {title} izlemeye başladı",
|
||||
'notif.friendAdded': "{name}, {title} izlemek istiyor",
|
||||
'notif.unread_one': '{count} yeni bildirim',
|
||||
'notif.unread_other': '{count} yeni bildirim',
|
||||
'social.accept': 'Kabul et',
|
||||
|
||||
@@ -631,12 +631,17 @@ const dict: Translations = {
|
||||
'social.noFollowing': 'Bạn chưa theo dõi ai.',
|
||||
'social.noFollowers': 'Chưa có người theo dõi.',
|
||||
'notif.title': 'Thông báo',
|
||||
'notif.empty': 'Khi ai đó theo dõi hoặc bỏ theo dõi bạn, bạn sẽ thấy ở đây.',
|
||||
'notif.empty': "Lượt theo dõi, phản hồi đánh giá của bạn và hoạt động của người bạn theo dõi sẽ hiện ở đây.",
|
||||
'notif.error': 'Không tải được thông báo.',
|
||||
'notif.newFollower': '{name} đã theo dõi bạn',
|
||||
'notif.followRequest': '{name} muốn theo dõi bạn',
|
||||
'notif.unfollow': '{name} đã bỏ theo dõi bạn',
|
||||
'notif.followAccepted': '{name} đã chấp nhận yêu cầu của bạn',
|
||||
'notif.reaction': "{name} đã bày tỏ {emoji} với đánh giá {title} của bạn",
|
||||
'notif.reviewComment': "{name} đã bình luận đánh giá {title} của bạn",
|
||||
'notif.friendReview': "{name} đã đánh giá {title}",
|
||||
'notif.friendStarted': "{name} đã bắt đầu xem {title}",
|
||||
'notif.friendAdded': "{name} muốn xem {title}",
|
||||
'notif.unread_one': '{count} thông báo mới',
|
||||
'notif.unread_other': '{count} thông báo mới',
|
||||
'social.accept': 'Chấp nhận',
|
||||
|
||||
@@ -631,12 +631,17 @@ const dict: Translations = {
|
||||
'social.noFollowing': '还没有关注任何人。',
|
||||
'social.noFollowers': '还没有粉丝。',
|
||||
'notif.title': '通知',
|
||||
'notif.empty': '有人关注或取消关注你时,会显示在这里。',
|
||||
'notif.empty': "关注、对你评价的回应以及你关注的人的动态都会显示在这里。",
|
||||
'notif.error': '无法加载通知。',
|
||||
'notif.newFollower': '{name} 关注了你',
|
||||
'notif.followRequest': '{name} 请求关注你',
|
||||
'notif.unfollow': '{name} 取消关注了你',
|
||||
'notif.followAccepted': '{name} 接受了你的请求',
|
||||
'notif.reaction': "{name} 用 {emoji} 回应了你对《{title}》的评价",
|
||||
'notif.reviewComment': "{name} 评论了你对《{title}》的评价",
|
||||
'notif.friendReview': "{name} 评价了《{title}》",
|
||||
'notif.friendStarted': "{name} 开始看《{title}》",
|
||||
'notif.friendAdded': "{name} 想看《{title}》",
|
||||
'notif.unread_one': '{count} 条新通知',
|
||||
'notif.unread_other': '{count} 条新通知',
|
||||
'social.accept': '同意',
|
||||
|
||||
+22
-3
@@ -199,8 +199,19 @@ export const getFollowRequests = async () => toCards(await rpc('get_follow_reque
|
||||
|
||||
// ─── Notifications (abonnements uniquement) ───
|
||||
|
||||
export type NotificationKind = 'new_follower' | 'follow_request' | 'unfollow' | 'follow_accepted'
|
||||
const NOTIFICATION_KINDS: NotificationKind[] = ['new_follower', 'follow_request', 'unfollow', 'follow_accepted']
|
||||
export type NotificationKind =
|
||||
| 'new_follower'
|
||||
| 'follow_request'
|
||||
| 'unfollow'
|
||||
| 'follow_accepted'
|
||||
| 'reaction'
|
||||
| 'review_comment'
|
||||
| 'friend_review'
|
||||
| 'friend_started'
|
||||
| 'friend_added'
|
||||
const NOTIFICATION_KINDS: NotificationKind[] = ['new_follower', 'follow_request', 'unfollow', 'follow_accepted', 'reaction', 'review_comment', 'friend_review', 'friend_started', 'friend_added']
|
||||
/** Notifications liées à un titre : celui de la personne, ou le mien (réaction / commentaire sur mon avis) */
|
||||
export const MINE_ITEM_KINDS: NotificationKind[] = ['reaction', 'review_comment']
|
||||
|
||||
export interface FollowNotification {
|
||||
id: number
|
||||
@@ -208,6 +219,10 @@ export interface FollowNotification {
|
||||
createdAt: string
|
||||
read: boolean
|
||||
actor: ProfileCard
|
||||
/** Titre concerné (fiche publique) */
|
||||
item?: MediaItem
|
||||
/** Réaction choisie */
|
||||
emoji?: string
|
||||
}
|
||||
|
||||
export async function getNotifications(): Promise<FollowNotification[]> {
|
||||
@@ -217,7 +232,11 @@ export async function getNotifications(): Promise<FollowNotification[]> {
|
||||
if (!isPlainObject(n) || typeof n.id !== 'number' || !NOTIFICATION_KINDS.includes(n.kind as NotificationKind)) return []
|
||||
const actor = toCard(n.actor)
|
||||
const createdAt = safeIso(n.created_at)
|
||||
return actor && createdAt ? [{ id: n.id, kind: n.kind as NotificationKind, createdAt, read: n.read === true, actor }] : []
|
||||
const item = n.item == null ? undefined : (othersItem(n.item) ?? undefined)
|
||||
// Notification liée à un titre devenu invisible : on ne l'affiche pas
|
||||
if (n.item != null && !item) return []
|
||||
const emoji = typeof n.emoji === 'string' && n.emoji.length <= 16 ? n.emoji : undefined
|
||||
return actor && createdAt ? [{ id: n.id, kind: n.kind as NotificationKind, createdAt, read: n.read === true, actor, item, emoji }] : []
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user