1 parent
04b5005e3b
commit
51a320b31f
29 files changed
+1139
-7
No files matched your search
@@ -0,0 +1,198 @@
|
|||||||
|
-- ════════════════════════════════════════════════════════════════════════════
|
||||||
|
-- AzuuCine — Avis par titre, réactions et notifications (5 octobre 2026)
|
||||||
|
-- 1. Voir tous les avis sur un titre (amis / autres).
|
||||||
|
-- 2. Réagir aux avis (emoji).
|
||||||
|
-- 3. Notifications (cloche) : abonnements, demandes acceptées, réactions reçues.
|
||||||
|
--
|
||||||
|
-- À coller dans Supabase → SQL Editor → Run. Idempotent (réexécutable sans risque).
|
||||||
|
-- ════════════════════════════════════════════════════════════════════════════
|
||||||
|
|
||||||
|
-- ── Tables ──
|
||||||
|
create table if not exists public.review_reactions (
|
||||||
|
author_id uuid not null references auth.users(id) on delete cascade, -- auteur de l'avis
|
||||||
|
item_id text not null,
|
||||||
|
user_id uuid not null default auth.uid() references auth.users(id) on delete cascade, -- qui réagit
|
||||||
|
emoji text not null,
|
||||||
|
created_at timestamptz not null default now(),
|
||||||
|
primary key (author_id, item_id, user_id)
|
||||||
|
);
|
||||||
|
create index if not exists review_reactions_target_idx on public.review_reactions (author_id, item_id);
|
||||||
|
alter table public.review_reactions enable row level security;
|
||||||
|
alter table public.review_reactions force row level security;
|
||||||
|
revoke all on public.review_reactions from anon, authenticated;
|
||||||
|
|
||||||
|
create table if not exists public.notifications (
|
||||||
|
id bigint generated always as identity primary key,
|
||||||
|
user_id uuid not null references auth.users(id) on delete cascade, -- destinataire
|
||||||
|
kind text not null check (kind in ('follow_request','follow_accepted','new_follower','reaction')),
|
||||||
|
actor_id uuid references auth.users(id) on delete cascade,
|
||||||
|
item_id text,
|
||||||
|
emoji text,
|
||||||
|
created_at timestamptz not null default now(),
|
||||||
|
read_at timestamptz
|
||||||
|
);
|
||||||
|
create index if not exists notifications_user_idx on public.notifications (user_id, created_at desc);
|
||||||
|
alter table public.notifications enable row level security;
|
||||||
|
alter table public.notifications force row level security;
|
||||||
|
revoke all on public.notifications from anon, authenticated;
|
||||||
|
|
||||||
|
-- ── Création de notifications + bornage de l'historique ──
|
||||||
|
create or replace function public.azuu_notify(p_user uuid, p_kind text, p_actor uuid, p_item text default null, p_emoji text default null)
|
||||||
|
returns void language plpgsql security definer set search_path = '' as $$
|
||||||
|
begin
|
||||||
|
if p_user is null or p_actor is null or p_user = p_actor then return; end if;
|
||||||
|
insert into public.notifications (user_id, kind, actor_id, item_id, emoji)
|
||||||
|
values (p_user, p_kind, p_actor, p_item, p_emoji);
|
||||||
|
delete from public.notifications
|
||||||
|
where user_id = p_user and id not in (
|
||||||
|
select id from public.notifications where user_id = p_user order by created_at desc limit 300
|
||||||
|
);
|
||||||
|
end;
|
||||||
|
$$;
|
||||||
|
|
||||||
|
-- Abonnement / demande -> notifie le compte suivi ; demande acceptée -> notifie le demandeur
|
||||||
|
create or replace function public.azuu_follow_notify()
|
||||||
|
returns trigger language plpgsql security definer set search_path = '' as $$
|
||||||
|
begin
|
||||||
|
if tg_op = 'INSERT' then
|
||||||
|
perform public.azuu_notify(new.following_id,
|
||||||
|
case when new.status = 'pending' then 'follow_request' else 'new_follower' end, new.follower_id);
|
||||||
|
elsif tg_op = 'UPDATE' and old.status = 'pending' and new.status = 'accepted' then
|
||||||
|
perform public.azuu_notify(new.follower_id, 'follow_accepted', new.following_id);
|
||||||
|
end if;
|
||||||
|
return null;
|
||||||
|
end;
|
||||||
|
$$;
|
||||||
|
drop trigger if exists follows_notify on public.follows;
|
||||||
|
create trigger follows_notify after insert or update on public.follows
|
||||||
|
for each row execute function public.azuu_follow_notify();
|
||||||
|
|
||||||
|
-- Réaction reçue -> notifie l'auteur de l'avis
|
||||||
|
create or replace function public.azuu_reaction_notify()
|
||||||
|
returns trigger language plpgsql security definer set search_path = '' as $$
|
||||||
|
begin
|
||||||
|
perform public.azuu_notify(new.author_id, 'reaction', new.user_id, new.item_id, new.emoji);
|
||||||
|
return null;
|
||||||
|
end;
|
||||||
|
$$;
|
||||||
|
drop trigger if exists reactions_notify on public.review_reactions;
|
||||||
|
create trigger reactions_notify after insert on public.review_reactions
|
||||||
|
for each row execute function public.azuu_reaction_notify();
|
||||||
|
|
||||||
|
-- ── Réagir à un avis ──
|
||||||
|
create or replace function public.react_to_review(p_author uuid, p_item text, p_emoji text)
|
||||||
|
returns jsonb language plpgsql security definer set search_path = '' as $$
|
||||||
|
begin
|
||||||
|
if auth.uid() is null then raise exception 'auth'; end if;
|
||||||
|
if p_author = auth.uid() then raise exception 'cannot react to your own review'; end if;
|
||||||
|
if p_emoji is null or p_emoji <> all (array['👍','❤️','🔥','😂','😮','😢']) then raise exception 'bad emoji'; end if;
|
||||||
|
if not public.can_view(p_author) or not exists (
|
||||||
|
select 1 from public.items i join public.profiles pr on pr.id = i.user_id
|
||||||
|
where i.user_id = p_author and i.id = p_item and not i.deleted
|
||||||
|
and coalesce(i.data->>'notes','') <> '' and not pr.suspended
|
||||||
|
) then
|
||||||
|
raise exception 'review not found';
|
||||||
|
end if;
|
||||||
|
insert into public.review_reactions (author_id, item_id, user_id, emoji)
|
||||||
|
values (p_author, p_item, auth.uid(), p_emoji)
|
||||||
|
on conflict (author_id, item_id, user_id) do update set emoji = excluded.emoji, created_at = now();
|
||||||
|
return jsonb_build_object('ok', true);
|
||||||
|
end;
|
||||||
|
$$;
|
||||||
|
|
||||||
|
create or replace function public.unreact_review(p_author uuid, p_item text)
|
||||||
|
returns jsonb language plpgsql security definer set search_path = '' as $$
|
||||||
|
begin
|
||||||
|
if auth.uid() is null then raise exception 'auth'; end if;
|
||||||
|
delete from public.review_reactions where author_id = p_author and item_id = p_item and user_id = auth.uid();
|
||||||
|
return jsonb_build_object('ok', true);
|
||||||
|
end;
|
||||||
|
$$;
|
||||||
|
|
||||||
|
-- ── Tous les avis sur un titre (amis / autres) ──
|
||||||
|
create or replace function public.title_reviews(p_external_id text, p_offset integer default 0)
|
||||||
|
returns jsonb language plpgsql stable security definer set search_path = '' as $$
|
||||||
|
declare me uuid := auth.uid(); res jsonb;
|
||||||
|
begin
|
||||||
|
if me is null or p_external_id !~ '^(tmdb:(movie|tv):[0-9]{1,10}|anilist:[0-9]{1,10})$' then
|
||||||
|
return jsonb_build_object('friends', '[]'::jsonb, 'others', '[]'::jsonb);
|
||||||
|
end if;
|
||||||
|
with revs as (
|
||||||
|
select i.user_id, i.id as item_id, i.updated_at,
|
||||||
|
nullif(i.data->>'rating','')::numeric as rating,
|
||||||
|
i.data->>'notes' as notes, pr,
|
||||||
|
exists(select 1 from public.follows f where f.follower_id = me and f.following_id = i.user_id and f.status = 'accepted') as friend
|
||||||
|
from public.items i
|
||||||
|
join public.profiles pr on pr.id = i.user_id
|
||||||
|
where i.data->>'externalId' = p_external_id
|
||||||
|
and not i.deleted and coalesce(i.data->>'notes','') <> ''
|
||||||
|
and i.user_id <> me and not pr.suspended
|
||||||
|
and (not pr.is_private
|
||||||
|
or exists(select 1 from public.follows f where f.follower_id = me and f.following_id = i.user_id and f.status = 'accepted'))
|
||||||
|
),
|
||||||
|
enriched as (
|
||||||
|
select r.*,
|
||||||
|
(select coalesce(jsonb_object_agg(e.emoji, e.c), '{}'::jsonb)
|
||||||
|
from (select emoji, count(*) c from public.review_reactions rr
|
||||||
|
where rr.author_id = r.user_id and rr.item_id = r.item_id group by emoji) e) as reactions,
|
||||||
|
(select count(*) from public.review_reactions rr where rr.author_id = r.user_id and rr.item_id = r.item_id) as total,
|
||||||
|
(select emoji from public.review_reactions rr where rr.author_id = r.user_id and rr.item_id = r.item_id and rr.user_id = me) as mine
|
||||||
|
from revs r
|
||||||
|
)
|
||||||
|
select jsonb_build_object(
|
||||||
|
'friends', coalesce((select jsonb_agg(entry order by total desc, updated_at desc) from (
|
||||||
|
select jsonb_build_object('user', public.profile_card(pr), 'user_id', user_id, 'item_id', item_id,
|
||||||
|
'updated_at', updated_at, 'rating', rating, 'notes', notes,
|
||||||
|
'reactions', reactions, 'total', total, 'mine', mine) entry, total, updated_at
|
||||||
|
from enriched where friend offset greatest(p_offset, 0) limit 40) f), '[]'::jsonb),
|
||||||
|
'others', coalesce((select jsonb_agg(entry order by total desc, updated_at desc) from (
|
||||||
|
select jsonb_build_object('user', public.profile_card(pr), 'user_id', user_id, 'item_id', item_id,
|
||||||
|
'updated_at', updated_at, 'rating', rating, 'notes', notes,
|
||||||
|
'reactions', reactions, 'total', total, 'mine', mine) entry, total, updated_at
|
||||||
|
from enriched where not friend offset greatest(p_offset, 0) limit 40) o), '[]'::jsonb)
|
||||||
|
) into res;
|
||||||
|
return res;
|
||||||
|
end;
|
||||||
|
$$;
|
||||||
|
|
||||||
|
-- ── Notifications ──
|
||||||
|
create or replace function public.get_notifications(p_offset integer default 0)
|
||||||
|
returns jsonb language sql stable security definer set search_path = '' as $$
|
||||||
|
select coalesce(jsonb_agg(x order by created_at desc), '[]'::jsonb)
|
||||||
|
from (
|
||||||
|
select n.id, n.kind, n.created_at, n.read_at, n.emoji, n.item_id,
|
||||||
|
case when p.id is null then null else
|
||||||
|
jsonb_build_object('username', p.username, 'display_name', p.display_name, 'avatar_url', p.avatar_url) end as actor,
|
||||||
|
case when n.kind = 'reaction'
|
||||||
|
then (select it.data->>'title' from public.items it where it.user_id = n.user_id and it.id = n.item_id) end as title
|
||||||
|
from public.notifications n
|
||||||
|
left join public.profiles p on p.id = n.actor_id
|
||||||
|
where n.user_id = auth.uid()
|
||||||
|
order by n.created_at desc
|
||||||
|
offset greatest(p_offset, 0) limit 30
|
||||||
|
) x
|
||||||
|
$$;
|
||||||
|
|
||||||
|
create or replace function public.notifications_unread()
|
||||||
|
returns integer language sql stable security definer set search_path = '' as $$
|
||||||
|
select count(*)::int from public.notifications where user_id = auth.uid() and read_at is null
|
||||||
|
$$;
|
||||||
|
|
||||||
|
create or replace function public.mark_notifications_read()
|
||||||
|
returns void language sql security definer set search_path = '' as $$
|
||||||
|
update public.notifications set read_at = now() where user_id = auth.uid() and read_at is null
|
||||||
|
$$;
|
||||||
|
|
||||||
|
-- ── Droits (gate interne : auth.uid() / can_view) ──
|
||||||
|
revoke all on function public.react_to_review(uuid, text, text) from public, anon;
|
||||||
|
revoke all on function public.unreact_review(uuid, text) from public, anon;
|
||||||
|
revoke all on function public.title_reviews(text, integer) from public, anon;
|
||||||
|
revoke all on function public.get_notifications(integer) from public, anon;
|
||||||
|
revoke all on function public.notifications_unread() from public, anon;
|
||||||
|
revoke all on function public.mark_notifications_read() from public, anon;
|
||||||
|
grant execute on function public.react_to_review(uuid, text, text) to authenticated;
|
||||||
|
grant execute on function public.unreact_review(uuid, text) to authenticated;
|
||||||
|
grant execute on function public.title_reviews(text, integer) to authenticated;
|
||||||
|
grant execute on function public.get_notifications(integer) to authenticated;
|
||||||
|
grant execute on function public.notifications_unread() to authenticated;
|
||||||
|
grant execute on function public.mark_notifications_read() to authenticated;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { locale, t } from '../i18n'
|
import { locale, t } from '../i18n'
|
||||||
import { Check, Heart, ImagePlus, Loader2, Minus, Plus, Share2, Trash2, X } from 'lucide-react'
|
import { Check, Heart, ImagePlus, Loader2, MessagesSquare, Minus, Plus, Share2, Trash2, X } from 'lucide-react'
|
||||||
import { useEffect, useMemo, useRef, useState, type ReactNode } from 'react'
|
import { useEffect, useMemo, useRef, useState, type ReactNode } from 'react'
|
||||||
import { CRITERIA, DEFAULT_FILM_MINUTES, MEDIA_TYPES, STATUSES, TYPE_BY_VALUE } from '../lib/constants'
|
import { CRITERIA, DEFAULT_FILM_MINUTES, MEDIA_TYPES, STATUSES, TYPE_BY_VALUE } from '../lib/constants'
|
||||||
import { canonicalGenre, canonicalSubtype, genreLabel, genreSuggestions as defaultGenres, subtypeLabel, subtypeSuggestions } from '../lib/genres'
|
import { canonicalGenre, canonicalSubtype, genreLabel, genreSuggestions as defaultGenres, subtypeLabel, subtypeSuggestions } from '../lib/genres'
|
||||||
@@ -18,6 +18,7 @@ import SharePreview from './SharePreview'
|
|||||||
import DatabaseSearch from './DatabaseSearch'
|
import DatabaseSearch from './DatabaseSearch'
|
||||||
import EpisodeList from './EpisodeList'
|
import EpisodeList from './EpisodeList'
|
||||||
import ItemHero, { type HeroAction } from './ItemHero'
|
import ItemHero, { type HeroAction } from './ItemHero'
|
||||||
|
import { useSocial } from './social/SocialProvider'
|
||||||
import { NewListForm } from './ListsView'
|
import { NewListForm } from './ListsView'
|
||||||
import Poster from './Poster'
|
import Poster from './Poster'
|
||||||
import { RatingInput } from './Rating'
|
import { RatingInput } from './Rating'
|
||||||
@@ -136,6 +137,7 @@ function Rewatches({ dates, onChange }: { dates: string[]; onChange: (d: string[
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default function MediaForm({ item, onClose, onGoToSettings, onOpenItem }: Props) {
|
export default function MediaForm({ item, onClose, onGoToSettings, onOpenItem }: Props) {
|
||||||
|
const social = useSocial()
|
||||||
const { add, update, remove, items, settings, lists, patchMany } = useMedia()
|
const { add, update, remove, items, settings, lists, patchMany } = useMedia()
|
||||||
const [form, setForm] = useState<MediaInput>(() => {
|
const [form, setForm] = useState<MediaInput>(() => {
|
||||||
if (!item) return EMPTY
|
if (!item) return EMPTY
|
||||||
@@ -597,6 +599,11 @@ export default function MediaForm({ item, onClose, onGoToSettings, onOpenItem }:
|
|||||||
|
|
||||||
<Section title={t('form.review')}>
|
<Section title={t('form.review')}>
|
||||||
<textarea className="field min-h-32 resize-y" value={form.notes ?? ''} onChange={(e) => set('notes', e.target.value)} placeholder={t('form.reviewPh')} />
|
<textarea className="field min-h-32 resize-y" value={form.notes ?? ''} onChange={(e) => set('notes', e.target.value)} placeholder={t('form.reviewPh')} />
|
||||||
|
{form.externalId && social.enabled && (
|
||||||
|
<button type="button" onClick={() => social.openReviews(form.externalId!, form.title)} className="mt-3 flex w-full items-center justify-center gap-2 rounded-xl border border-line py-2.5 text-sm font-medium text-ink-2 transition-colors active:bg-surface-2">
|
||||||
|
<MessagesSquare size={16} /> {t('reviews.seeAll')}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
</Section>
|
</Section>
|
||||||
|
|
||||||
<div className="space-y-2 border-t border-line pt-6">
|
<div className="space-y-2 border-t border-line pt-6">
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import { Check, Loader2, Plus, Star } from 'lucide-react'
|
import { Check, Loader2, MessagesSquare, Plus, Star } from 'lucide-react'
|
||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
import { t } from '../../i18n'
|
import { t } from '../../i18n'
|
||||||
import { genreLabel } from '../../lib/genres'
|
import { genreLabel } from '../../lib/genres'
|
||||||
import { useScrollLock } from '../../lib/scrollLock'
|
import { useScrollLock } from '../../lib/scrollLock'
|
||||||
|
import { useSocial } from './SocialProvider'
|
||||||
import { cx, formatDate, formatRating, normalizeText } from '../../lib/utils'
|
import { cx, formatDate, formatRating, normalizeText } from '../../lib/utils'
|
||||||
import { useMedia } from '../../store'
|
import { useMedia } from '../../store'
|
||||||
import type { MediaInput, MediaItem } from '../../types'
|
import type { MediaInput, MediaItem } from '../../types'
|
||||||
@@ -20,6 +21,7 @@ export interface PeekOwner {
|
|||||||
/** Aperçu d'un titre de quelqu'un d'autre : sa note, son avis public, et ajout à ma liste « À voir ». */
|
/** Aperçu d'un titre de quelqu'un d'autre : sa note, son avis public, et ajout à ma liste « À voir ». */
|
||||||
export default function ItemPeek({ item, owner, onClose }: { item: MediaItem; owner?: PeekOwner; onClose: () => void }) {
|
export default function ItemPeek({ item, owner, onClose }: { item: MediaItem; owner?: PeekOwner; onClose: () => void }) {
|
||||||
const { items, add, settings } = useMedia()
|
const { items, add, settings } = useMedia()
|
||||||
|
const social = useSocial()
|
||||||
const [busy, setBusy] = useState(false)
|
const [busy, setBusy] = useState(false)
|
||||||
const [added, setAdded] = useState(false)
|
const [added, setAdded] = useState(false)
|
||||||
const owned = items.some(
|
const owned = items.some(
|
||||||
@@ -107,6 +109,12 @@ export default function ItemPeek({ item, owner, onClose }: { item: MediaItem; ow
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{item.externalId && (
|
||||||
|
<button onClick={() => social.openReviews(item.externalId!, item.title)} className="mt-4 flex w-full items-center justify-center gap-2 rounded-xl border border-line py-2.5 text-sm font-medium text-ink-2 transition-colors active:bg-surface-2">
|
||||||
|
<MessagesSquare size={16} /> {t('reviews.seeAll')}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
|
||||||
{item.overview && <p className="mt-4 line-clamp-5 text-sm leading-relaxed text-ink-2">{item.overview}</p>}
|
{item.overview && <p className="mt-4 line-clamp-5 text-sm leading-relaxed text-ink-2">{item.overview}</p>}
|
||||||
|
|
||||||
<div className="mt-5 grid grid-cols-2 gap-2">
|
<div className="mt-5 grid grid-cols-2 gap-2">
|
||||||
|
|||||||
@@ -0,0 +1,127 @@
|
|||||||
|
import { Loader2 } from 'lucide-react'
|
||||||
|
import { useEffect, useState } from 'react'
|
||||||
|
import { t } from '../../i18n'
|
||||||
|
import { listNotifications, markNotificationsRead, type AppNotification, type NotificationKind } from '../../lib/cloud/notifications'
|
||||||
|
import { cx, formatDate } from '../../lib/utils'
|
||||||
|
import { EmptyState } from '../ui'
|
||||||
|
import Avatar from './Avatar'
|
||||||
|
import Sheet from './Sheet'
|
||||||
|
|
||||||
|
const PAGE = 30
|
||||||
|
const FOLLOW_KINDS: NotificationKind[] = ['follow_request', 'follow_accepted', 'new_follower']
|
||||||
|
|
||||||
|
const VERB: Record<NotificationKind, () => string> = {
|
||||||
|
follow_request: () => t('notif.follow_request'),
|
||||||
|
follow_accepted: () => t('notif.follow_accepted'),
|
||||||
|
new_follower: () => t('notif.new_follower'),
|
||||||
|
reaction: () => t('notif.reaction'),
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Liste des notifications (abonnements, demandes acceptées, réactions). Marque comme lues à l'ouverture. */
|
||||||
|
export default function Notifications({ onClose, onOpenProfile }: { onClose: () => void; onOpenProfile: (username: string) => void }) {
|
||||||
|
const [items, setItems] = useState<AppNotification[] | undefined>(undefined)
|
||||||
|
const [done, setDone] = useState(false)
|
||||||
|
const [loadingMore, setLoadingMore] = useState(false)
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
let alive = true
|
||||||
|
void (async () => {
|
||||||
|
try {
|
||||||
|
const page = await listNotifications(0)
|
||||||
|
if (!alive) return
|
||||||
|
setItems(page)
|
||||||
|
setDone(page.length < PAGE)
|
||||||
|
} catch {
|
||||||
|
if (alive) {
|
||||||
|
setItems([])
|
||||||
|
setDone(true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Marque comme lu (feu et oubli) pour vider le badge
|
||||||
|
markNotificationsRead().catch(() => {})
|
||||||
|
})()
|
||||||
|
return () => {
|
||||||
|
alive = false
|
||||||
|
}
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
const loadMore = async () => {
|
||||||
|
if (!items || loadingMore) return
|
||||||
|
setLoadingMore(true)
|
||||||
|
try {
|
||||||
|
const page = await listNotifications(items.length)
|
||||||
|
setItems((prev) => [...(prev ?? []), ...page])
|
||||||
|
setDone(page.length < PAGE)
|
||||||
|
} catch {
|
||||||
|
setDone(true)
|
||||||
|
} finally {
|
||||||
|
setLoadingMore(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Sheet title={t('notif.title')} label={t('notif.title')} onClose={onClose}>
|
||||||
|
{items === undefined ? (
|
||||||
|
<p className="flex items-center justify-center py-16 text-ink-3">
|
||||||
|
<Loader2 size={20} className="animate-spin" />
|
||||||
|
</p>
|
||||||
|
) : items.length === 0 ? (
|
||||||
|
<div className="px-4">
|
||||||
|
<EmptyState title={t('notif.empty')} />
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<ul>
|
||||||
|
{items.map((n) => (
|
||||||
|
<Row key={n.id} n={n} onOpenProfile={onOpenProfile} />
|
||||||
|
))}
|
||||||
|
{!done && (
|
||||||
|
<li className="p-4">
|
||||||
|
<button onClick={loadMore} disabled={loadingMore} className="btn btn-ghost w-full">
|
||||||
|
{loadingMore ? <Loader2 size={15} className="animate-spin" /> : t('social.loadMore')}
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
)}
|
||||||
|
</ul>
|
||||||
|
)}
|
||||||
|
</Sheet>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
function Row({ n, onOpenProfile }: { n: AppNotification; onOpenProfile: (username: string) => void }) {
|
||||||
|
const actor = n.actor
|
||||||
|
const actorName = actor?.display_name ?? t('notif.someone')
|
||||||
|
const unread = n.read_at === null
|
||||||
|
const username = actor?.username
|
||||||
|
const target = username != null && FOLLOW_KINDS.includes(n.kind) ? username : null
|
||||||
|
|
||||||
|
const inner = (
|
||||||
|
<>
|
||||||
|
{unread && <span className="size-2 shrink-0 rounded-full bg-accent-fill" aria-hidden="true" />}
|
||||||
|
<Avatar url={actor?.avatar_url ?? undefined} name={actorName} size={38} />
|
||||||
|
<span className="min-w-0 flex-1 text-sm leading-snug text-ink-2">
|
||||||
|
<b className="text-ink">{actorName}</b> {VERB[n.kind]()}
|
||||||
|
{n.kind === 'reaction' && (
|
||||||
|
<>
|
||||||
|
{n.emoji ? ` ${n.emoji}` : ''}
|
||||||
|
{n.title ? ` ${t('notif.on', { title: n.title })}` : ''}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
<span className="shrink-0 text-xs text-ink-3">{formatDate(n.created_at)}</span>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
|
||||||
|
const base = cx('flex items-center gap-3 border-b border-line px-4 py-3 text-start', unread && 'bg-surface-2')
|
||||||
|
|
||||||
|
return (
|
||||||
|
<li>
|
||||||
|
{target != null ? (
|
||||||
|
<button onClick={() => onOpenProfile(target)} className={cx(base, 'w-full')}>
|
||||||
|
{inner}
|
||||||
|
</button>
|
||||||
|
) : (
|
||||||
|
<div className={base}>{inner}</div>
|
||||||
|
)}
|
||||||
|
</li>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
import { createContext, useCallback, useContext, useEffect, useMemo, useState, type ReactNode } from 'react'
|
import { createContext, useCallback, useContext, useEffect, useMemo, useState, type ReactNode } from 'react'
|
||||||
import { getFollowRequests, getMyProfile, type Profile, type ProfileCard } from '../../lib/cloud/social'
|
import { getFollowRequests, getMyProfile, type Profile, type ProfileCard } from '../../lib/cloud/social'
|
||||||
|
import { markNotificationsRead, unreadCount } from '../../lib/cloud/notifications'
|
||||||
import { useMedia } from '../../store'
|
import { useMedia } from '../../store'
|
||||||
import type { MediaItem } from '../../types'
|
import type { MediaItem } from '../../types'
|
||||||
import EditProfile from './EditProfile'
|
import EditProfile from './EditProfile'
|
||||||
@@ -7,6 +8,8 @@ import FollowList from './FollowList'
|
|||||||
import ItemPeek, { type PeekOwner } from './ItemPeek'
|
import ItemPeek, { type PeekOwner } from './ItemPeek'
|
||||||
import PeopleSearch from './PeopleSearch'
|
import PeopleSearch from './PeopleSearch'
|
||||||
import ProfileView from './ProfileView'
|
import ProfileView from './ProfileView'
|
||||||
|
import TitleReviews from './TitleReviews'
|
||||||
|
import Notifications from './Notifications'
|
||||||
import { useOnResume } from '../../lib/onResume'
|
import { useOnResume } from '../../lib/onResume'
|
||||||
import WelcomeProfile, { RANDOM_USERNAME } from './WelcomeProfile'
|
import WelcomeProfile, { RANDOM_USERNAME } from './WelcomeProfile'
|
||||||
|
|
||||||
@@ -20,6 +23,12 @@ interface SocialApi {
|
|||||||
openSearch: () => void
|
openSearch: () => void
|
||||||
openEdit: () => void
|
openEdit: () => void
|
||||||
openFollowList: (profile: Profile, kind: 'followers' | 'following') => void
|
openFollowList: (profile: Profile, kind: 'followers' | 'following') => void
|
||||||
|
/** Tous les avis sur un titre (amis / autres) */
|
||||||
|
openReviews: (externalId: string, title: string) => void
|
||||||
|
/** Panneau des notifications */
|
||||||
|
openNotifications: () => void
|
||||||
|
/** Notifications non lues */
|
||||||
|
unread: number
|
||||||
peek: (item: MediaItem, owner?: PeekOwner) => void
|
peek: (item: MediaItem, owner?: PeekOwner) => void
|
||||||
/** Ouvre la fiche si elle est à moi, sinon l'aperçu */
|
/** Ouvre la fiche si elle est à moi, sinon l'aperçu */
|
||||||
openItem: (item: MediaItem, owner?: PeekOwner) => void
|
openItem: (item: MediaItem, owner?: PeekOwner) => void
|
||||||
@@ -34,6 +43,9 @@ const SocialContext = createContext<SocialApi>({
|
|||||||
openSearch: () => {},
|
openSearch: () => {},
|
||||||
openEdit: () => {},
|
openEdit: () => {},
|
||||||
openFollowList: () => {},
|
openFollowList: () => {},
|
||||||
|
openReviews: () => {},
|
||||||
|
openNotifications: () => {},
|
||||||
|
unread: 0,
|
||||||
peek: () => {},
|
peek: () => {},
|
||||||
openItem: () => {},
|
openItem: () => {},
|
||||||
})
|
})
|
||||||
@@ -45,6 +57,8 @@ type Overlay =
|
|||||||
| { kind: 'search' }
|
| { kind: 'search' }
|
||||||
| { kind: 'edit' }
|
| { kind: 'edit' }
|
||||||
| { kind: 'follows'; profile: Profile; list: 'followers' | 'following' }
|
| { kind: 'follows'; profile: Profile; list: 'followers' | 'following' }
|
||||||
|
| { kind: 'reviews'; externalId: string; title: string }
|
||||||
|
| { kind: 'notifications' }
|
||||||
|
|
||||||
/** Profils, recherche et aperçus : affichés par-dessus l'app, empilés (le bouton fermer revient au précédent). */
|
/** Profils, recherche et aperçus : affichés par-dessus l'app, empilés (le bouton fermer revient au précédent). */
|
||||||
export function SocialProvider({ children, onOpenOwnItem }: { children: ReactNode; onOpenOwnItem: (item: MediaItem) => void }) {
|
export function SocialProvider({ children, onOpenOwnItem }: { children: ReactNode; onOpenOwnItem: (item: MediaItem) => void }) {
|
||||||
@@ -52,6 +66,7 @@ export function SocialProvider({ children, onOpenOwnItem }: { children: ReactNod
|
|||||||
const enabled = !!account
|
const enabled = !!account
|
||||||
const [me, setMe] = useState<Profile | null>(null)
|
const [me, setMe] = useState<Profile | null>(null)
|
||||||
const [requests, setRequests] = useState<ProfileCard[]>([])
|
const [requests, setRequests] = useState<ProfileCard[]>([])
|
||||||
|
const [unread, setUnread] = useState(0)
|
||||||
const [stack, setStack] = useState<Overlay[]>([])
|
const [stack, setStack] = useState<Overlay[]>([])
|
||||||
const [peeked, setPeeked] = useState<{ item: MediaItem; owner?: PeekOwner }>()
|
const [peeked, setPeeked] = useState<{ item: MediaItem; owner?: PeekOwner }>()
|
||||||
// « Plus tard » sur le choix du pseudo : redemandé au prochain lancement
|
// « Plus tard » sur le choix du pseudo : redemandé au prochain lancement
|
||||||
@@ -74,9 +89,10 @@ export function SocialProvider({ children, onOpenOwnItem }: { children: ReactNod
|
|||||||
const refresh = useCallback(async () => {
|
const refresh = useCallback(async () => {
|
||||||
if (!enabled || !navigator.onLine) return
|
if (!enabled || !navigator.onLine) return
|
||||||
try {
|
try {
|
||||||
const [p, r] = await Promise.all([getMyProfile(), getFollowRequests()])
|
const [p, r, u] = await Promise.all([getMyProfile(), getFollowRequests(), unreadCount()])
|
||||||
setMe(p)
|
setMe(p)
|
||||||
setRequests(r)
|
setRequests(r)
|
||||||
|
setUnread(u)
|
||||||
} catch {
|
} catch {
|
||||||
/* hors-ligne / serveur pas encore à jour : le reste de l'app fonctionne */
|
/* hors-ligne / serveur pas encore à jour : le reste de l'app fonctionne */
|
||||||
}
|
}
|
||||||
@@ -125,10 +141,17 @@ export function SocialProvider({ children, onOpenOwnItem }: { children: ReactNod
|
|||||||
openSearch: () => push({ kind: 'search' }),
|
openSearch: () => push({ kind: 'search' }),
|
||||||
openEdit: () => push({ kind: 'edit' }),
|
openEdit: () => push({ kind: 'edit' }),
|
||||||
openFollowList: (profile, list) => push({ kind: 'follows', profile, list }),
|
openFollowList: (profile, list) => push({ kind: 'follows', profile, list }),
|
||||||
|
openReviews: (externalId, title) => push({ kind: 'reviews', externalId, title }),
|
||||||
|
openNotifications: () => {
|
||||||
|
setUnread(0)
|
||||||
|
void markNotificationsRead().catch(() => {})
|
||||||
|
push({ kind: 'notifications' })
|
||||||
|
},
|
||||||
|
unread,
|
||||||
peek: (item, owner) => setPeeked({ item, owner }),
|
peek: (item, owner) => setPeeked({ item, owner }),
|
||||||
openItem,
|
openItem,
|
||||||
}),
|
}),
|
||||||
[enabled, me, requests, refresh, push, openItem],
|
[enabled, me, requests, unread, refresh, push, openItem],
|
||||||
)
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -142,8 +165,12 @@ export function SocialProvider({ children, onOpenOwnItem }: { children: ReactNod
|
|||||||
<PeopleSearch key={k} onClose={pop} />
|
<PeopleSearch key={k} onClose={pop} />
|
||||||
) : o.kind === 'edit' ? (
|
) : o.kind === 'edit' ? (
|
||||||
<EditProfile key={k} onClose={pop} />
|
<EditProfile key={k} onClose={pop} />
|
||||||
) : (
|
) : o.kind === 'follows' ? (
|
||||||
<FollowList key={k} profile={o.profile} initial={o.list} onClose={pop} />
|
<FollowList key={k} profile={o.profile} initial={o.list} onClose={pop} />
|
||||||
|
) : o.kind === 'reviews' ? (
|
||||||
|
<TitleReviews key={k} externalId={o.externalId} title={o.title} onClose={pop} onOpenProfile={(u) => push({ kind: 'profile', username: u })} />
|
||||||
|
) : (
|
||||||
|
<Notifications key={k} onClose={pop} onOpenProfile={(u) => push({ kind: 'profile', username: u })} />
|
||||||
),
|
),
|
||||||
)}
|
)}
|
||||||
{children}
|
{children}
|
||||||
|
|||||||
@@ -0,0 +1,131 @@
|
|||||||
|
import { Loader2, Star } from 'lucide-react'
|
||||||
|
import { useEffect, useState } from 'react'
|
||||||
|
import { t } from '../../i18n'
|
||||||
|
import { REACTION_EMOJIS, reactToReview, titleReviews, unreactReview, type ReactionEmoji, type TitleReview, type TitleReviews as TitleReviewsData } from '../../lib/cloud/reviews'
|
||||||
|
import { cx, formatRating } from '../../lib/utils'
|
||||||
|
import { useMedia } from '../../store'
|
||||||
|
import Avatar from './Avatar'
|
||||||
|
import Sheet from './Sheet'
|
||||||
|
|
||||||
|
/** Écran plein : tous les avis sur un même titre (amis / autres membres) avec réactions. */
|
||||||
|
export default function TitleReviews({ externalId, title, onClose, onOpenProfile }: { externalId: string; title: string; onClose: () => void; onOpenProfile: (username: string) => void }) {
|
||||||
|
const [data, setData] = useState<TitleReviewsData>()
|
||||||
|
const [error, setError] = useState(false)
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
let alive = true
|
||||||
|
titleReviews(externalId)
|
||||||
|
.then((d) => alive && setData(d))
|
||||||
|
.catch(() => alive && setError(true))
|
||||||
|
return () => {
|
||||||
|
alive = false
|
||||||
|
}
|
||||||
|
}, [externalId])
|
||||||
|
|
||||||
|
const bothEmpty = !!data && data.friends.length === 0 && data.others.length === 0
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Sheet title={title} label={t('reviews.title')} onClose={onClose}>
|
||||||
|
<p className="eyebrow px-4 pt-4">{t('reviews.title')}</p>
|
||||||
|
{data === undefined && !error ? (
|
||||||
|
<p className="flex items-center justify-center gap-2 px-4 py-16 text-sm text-ink-3">
|
||||||
|
<Loader2 size={16} className="animate-spin" /> {t('social.loading')}
|
||||||
|
</p>
|
||||||
|
) : !data || error || bothEmpty ? (
|
||||||
|
<p className="px-4 py-16 text-center text-sm text-ink-3">{t('reviews.none')}</p>
|
||||||
|
) : (
|
||||||
|
<div className="grid grid-cols-1 gap-4 px-4 pt-4 sm:grid-cols-2">
|
||||||
|
<ReviewColumn heading={t('reviews.friends')} empty={t('reviews.noneFriends')} list={data.friends} onOpenProfile={onOpenProfile} />
|
||||||
|
<ReviewColumn heading={t('reviews.others')} empty={t('reviews.noneOthers')} list={data.others} onOpenProfile={onOpenProfile} />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</Sheet>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
function ReviewColumn({ heading, empty, list, onOpenProfile }: { heading: string; empty: string; list: TitleReview[]; onOpenProfile: (username: string) => void }) {
|
||||||
|
return (
|
||||||
|
<section>
|
||||||
|
<p className="eyebrow mb-2">{heading}</p>
|
||||||
|
{list.length === 0 ? (
|
||||||
|
<p className="text-sm text-ink-3">{empty}</p>
|
||||||
|
) : (
|
||||||
|
<div className="space-y-3">
|
||||||
|
{list.map((r) => (
|
||||||
|
<ReviewCard key={`${r.user_id}-${r.item_id}`} r={r} onOpenProfile={onOpenProfile} />
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</section>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
function ReviewCard({ r, onOpenProfile }: { r: TitleReview; onOpenProfile: (username: string) => void }) {
|
||||||
|
const { settings } = useMedia()
|
||||||
|
const [reactions, setReactions] = useState<Record<string, number>>(r.reactions)
|
||||||
|
const [mine, setMine] = useState<string | null>(r.mine)
|
||||||
|
const [busy, setBusy] = useState(false)
|
||||||
|
|
||||||
|
const toggle = async (emoji: ReactionEmoji) => {
|
||||||
|
if (busy) return
|
||||||
|
const prev = { reactions, mine }
|
||||||
|
const next: Record<string, number> = { ...reactions }
|
||||||
|
if (mine === emoji) {
|
||||||
|
next[emoji] = Math.max(0, (next[emoji] ?? 0) - 1)
|
||||||
|
setReactions(next)
|
||||||
|
setMine(null)
|
||||||
|
} else {
|
||||||
|
if (mine) next[mine] = Math.max(0, (next[mine] ?? 0) - 1)
|
||||||
|
next[emoji] = (next[emoji] ?? 0) + 1
|
||||||
|
setReactions(next)
|
||||||
|
setMine(emoji)
|
||||||
|
}
|
||||||
|
setBusy(true)
|
||||||
|
try {
|
||||||
|
if (prev.mine === emoji) await unreactReview(r.user_id, r.item_id)
|
||||||
|
else await reactToReview(r.user_id, r.item_id, emoji)
|
||||||
|
} catch {
|
||||||
|
setReactions(prev.reactions)
|
||||||
|
setMine(prev.mine)
|
||||||
|
} finally {
|
||||||
|
setBusy(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<article className="card p-3.5">
|
||||||
|
<div className="flex items-center gap-2.5">
|
||||||
|
<Avatar url={r.user.avatar_url ?? undefined} name={r.user.display_name} size={34} />
|
||||||
|
<button onClick={() => onOpenProfile(r.user.username)} className="min-w-0 flex-1 text-start">
|
||||||
|
<p className="truncate text-sm font-semibold">{r.user.display_name}</p>
|
||||||
|
<p className="truncate text-xs text-ink-3">@{r.user.username}</p>
|
||||||
|
</button>
|
||||||
|
{r.rating != null && (
|
||||||
|
<span className="flex shrink-0 items-center gap-0.5 text-sm font-semibold text-ink-2">
|
||||||
|
<Star size={12} className="fill-accent text-accent" />
|
||||||
|
{formatRating(r.rating, settings.ratingScale)}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
{r.notes && <p className="mt-2 line-clamp-6 whitespace-pre-line text-sm leading-relaxed text-ink-2">{r.notes}</p>}
|
||||||
|
<div className="mt-3 flex flex-wrap gap-1.5">
|
||||||
|
{REACTION_EMOJIS.map((emoji) => {
|
||||||
|
const count = reactions[emoji] ?? 0
|
||||||
|
const on = mine === emoji
|
||||||
|
return (
|
||||||
|
<button
|
||||||
|
key={emoji}
|
||||||
|
onClick={() => void toggle(emoji)}
|
||||||
|
disabled={busy}
|
||||||
|
aria-pressed={on}
|
||||||
|
className={cx('inline-flex items-center gap-1 rounded-full border px-2 py-1 text-sm transition-colors disabled:opacity-60', on ? 'border-accent text-ink' : 'border-line text-ink-2')}
|
||||||
|
>
|
||||||
|
<span>{emoji}</span>
|
||||||
|
{count > 0 && <span className="text-xs font-medium">{count}</span>}
|
||||||
|
</button>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -234,6 +234,24 @@ const dict: Translations = {
|
|||||||
'settings.installApp': 'تثبيت التطبيق',
|
'settings.installApp': 'تثبيت التطبيق',
|
||||||
'settings.installHint': 'أضِف AzuuCine إلى شاشتك الرئيسية أو سطح المكتب.',
|
'settings.installHint': 'أضِف AzuuCine إلى شاشتك الرئيسية أو سطح المكتب.',
|
||||||
'settings.installed': 'تم تثبيت التطبيق',
|
'settings.installed': 'تم تثبيت التطبيق',
|
||||||
|
'reviews.title': 'التقييمات',
|
||||||
|
'reviews.friends': 'أصدقاؤك',
|
||||||
|
'reviews.others': 'أعضاء آخرون',
|
||||||
|
'reviews.noneFriends': 'لا تقييمات من أصدقائك',
|
||||||
|
'reviews.noneOthers': 'لا توجد تقييمات أخرى',
|
||||||
|
'reviews.none': 'لا توجد تقييمات بعد',
|
||||||
|
'reviews.seeAll': 'عرض كل التقييمات',
|
||||||
|
'reviews.react': 'تفاعل',
|
||||||
|
'notif.title': 'الإشعارات',
|
||||||
|
'notif.empty': 'لا إشعارات',
|
||||||
|
'notif.someone': 'شخص ما',
|
||||||
|
'notif.follow_request': 'يريد متابعتك',
|
||||||
|
'notif.follow_accepted': 'قبل طلبك',
|
||||||
|
'notif.new_follower': 'بدأ بمتابعتك',
|
||||||
|
'notif.reaction': 'تفاعل مع تقييمك',
|
||||||
|
'notif.on': 'على {title}',
|
||||||
|
'home.notifications': 'الإشعارات',
|
||||||
|
'home.notificationsN': '{count} إشعارات',
|
||||||
'settings.admin': 'Administration',
|
'settings.admin': 'Administration',
|
||||||
'admin.title': 'Administration',
|
'admin.title': 'Administration',
|
||||||
'admin.tabOverview': 'Overview',
|
'admin.tabOverview': 'Overview',
|
||||||
|
|||||||
@@ -228,6 +228,24 @@ const dict: Translations = {
|
|||||||
'settings.installApp': 'App installieren',
|
'settings.installApp': 'App installieren',
|
||||||
'settings.installHint': 'Füge AzuuCine zum Startbildschirm oder Desktop hinzu.',
|
'settings.installHint': 'Füge AzuuCine zum Startbildschirm oder Desktop hinzu.',
|
||||||
'settings.installed': 'App installiert',
|
'settings.installed': 'App installiert',
|
||||||
|
'reviews.title': 'Rezensionen',
|
||||||
|
'reviews.friends': 'Deine Freunde',
|
||||||
|
'reviews.others': 'Andere Mitglieder',
|
||||||
|
'reviews.noneFriends': 'Keine Rezensionen deiner Freunde',
|
||||||
|
'reviews.noneOthers': 'Keine weiteren Rezensionen',
|
||||||
|
'reviews.none': 'Noch keine Rezensionen',
|
||||||
|
'reviews.seeAll': 'Alle Rezensionen ansehen',
|
||||||
|
'reviews.react': 'Reagieren',
|
||||||
|
'notif.title': 'Mitteilungen',
|
||||||
|
'notif.empty': 'Keine Mitteilungen',
|
||||||
|
'notif.someone': 'Jemand',
|
||||||
|
'notif.follow_request': 'möchte dir folgen',
|
||||||
|
'notif.follow_accepted': 'hat deine Anfrage angenommen',
|
||||||
|
'notif.new_follower': 'folgt dir jetzt',
|
||||||
|
'notif.reaction': 'hat auf deine Rezension reagiert',
|
||||||
|
'notif.on': 'zu {title}',
|
||||||
|
'home.notifications': 'Mitteilungen',
|
||||||
|
'home.notificationsN': '{count} Mitteilungen',
|
||||||
'settings.admin': 'Administration',
|
'settings.admin': 'Administration',
|
||||||
'admin.title': 'Administration',
|
'admin.title': 'Administration',
|
||||||
'admin.tabOverview': 'Overview',
|
'admin.tabOverview': 'Overview',
|
||||||
|
|||||||
@@ -228,6 +228,24 @@ const dict: Translations = {
|
|||||||
'settings.installApp': 'Install the app',
|
'settings.installApp': 'Install the app',
|
||||||
'settings.installHint': 'Add AzuuCine to your home screen or desktop.',
|
'settings.installHint': 'Add AzuuCine to your home screen or desktop.',
|
||||||
'settings.installed': 'App installed',
|
'settings.installed': 'App installed',
|
||||||
|
'reviews.title': 'Reviews',
|
||||||
|
'reviews.friends': 'Your friends',
|
||||||
|
'reviews.others': 'Other members',
|
||||||
|
'reviews.noneFriends': 'No reviews from your friends',
|
||||||
|
'reviews.noneOthers': 'No other reviews',
|
||||||
|
'reviews.none': 'No reviews yet',
|
||||||
|
'reviews.seeAll': 'See all reviews',
|
||||||
|
'reviews.react': 'React',
|
||||||
|
'notif.title': 'Notifications',
|
||||||
|
'notif.empty': 'No notifications',
|
||||||
|
'notif.someone': 'Someone',
|
||||||
|
'notif.follow_request': 'wants to follow you',
|
||||||
|
'notif.follow_accepted': 'accepted your request',
|
||||||
|
'notif.new_follower': 'started following you',
|
||||||
|
'notif.reaction': 'reacted to your review',
|
||||||
|
'notif.on': 'on {title}',
|
||||||
|
'home.notifications': 'Notifications',
|
||||||
|
'home.notificationsN': '{count} notifications',
|
||||||
'settings.admin': 'Administration',
|
'settings.admin': 'Administration',
|
||||||
'admin.title': 'Administration',
|
'admin.title': 'Administration',
|
||||||
'admin.tabOverview': 'Overview',
|
'admin.tabOverview': 'Overview',
|
||||||
|
|||||||
@@ -228,6 +228,24 @@ const dict: Translations = {
|
|||||||
'settings.installApp': 'Instalar la aplicación',
|
'settings.installApp': 'Instalar la aplicación',
|
||||||
'settings.installHint': 'Añade AzuuCine a tu pantalla de inicio o escritorio.',
|
'settings.installHint': 'Añade AzuuCine a tu pantalla de inicio o escritorio.',
|
||||||
'settings.installed': 'Aplicación instalada',
|
'settings.installed': 'Aplicación instalada',
|
||||||
|
'reviews.title': 'Opiniones',
|
||||||
|
'reviews.friends': 'Tus amigos',
|
||||||
|
'reviews.others': 'Otros miembros',
|
||||||
|
'reviews.noneFriends': 'Ningún opinión de tus amigos',
|
||||||
|
'reviews.noneOthers': 'Ninguna otra opinión',
|
||||||
|
'reviews.none': 'Aún no hay opiniones',
|
||||||
|
'reviews.seeAll': 'Ver todas las opiniones',
|
||||||
|
'reviews.react': 'Reaccionar',
|
||||||
|
'notif.title': 'Notificaciones',
|
||||||
|
'notif.empty': 'Sin notificaciones',
|
||||||
|
'notif.someone': 'Alguien',
|
||||||
|
'notif.follow_request': 'quiere seguirte',
|
||||||
|
'notif.follow_accepted': 'aceptó tu solicitud',
|
||||||
|
'notif.new_follower': 'empezó a seguirte',
|
||||||
|
'notif.reaction': 'reaccionó a tu opinión',
|
||||||
|
'notif.on': 'en {title}',
|
||||||
|
'home.notifications': 'Notificaciones',
|
||||||
|
'home.notificationsN': '{count} notificaciones',
|
||||||
'settings.admin': 'Administration',
|
'settings.admin': 'Administration',
|
||||||
'admin.title': 'Administration',
|
'admin.title': 'Administration',
|
||||||
'admin.tabOverview': 'Overview',
|
'admin.tabOverview': 'Overview',
|
||||||
|
|||||||
@@ -230,6 +230,24 @@ const dict = {
|
|||||||
'settings.installApp': 'Installer l\'application',
|
'settings.installApp': 'Installer l\'application',
|
||||||
'settings.installHint': 'Ajoute AzuuCine à ton écran d\'accueil ou ton bureau.',
|
'settings.installHint': 'Ajoute AzuuCine à ton écran d\'accueil ou ton bureau.',
|
||||||
'settings.installed': 'Application installée',
|
'settings.installed': 'Application installée',
|
||||||
|
'reviews.title': 'Avis',
|
||||||
|
'reviews.friends': 'Tes amis',
|
||||||
|
'reviews.others': 'Autres membres',
|
||||||
|
'reviews.noneFriends': 'Aucun avis de tes amis',
|
||||||
|
'reviews.noneOthers': 'Aucun autre avis',
|
||||||
|
'reviews.none': 'Aucun avis pour le moment',
|
||||||
|
'reviews.seeAll': 'Voir tous les avis',
|
||||||
|
'reviews.react': 'Réagir',
|
||||||
|
'notif.title': 'Notifications',
|
||||||
|
'notif.empty': 'Aucune notification',
|
||||||
|
'notif.someone': 'Quelqu’un',
|
||||||
|
'notif.follow_request': 'veut s’abonner à toi',
|
||||||
|
'notif.follow_accepted': 'a accepté ta demande',
|
||||||
|
'notif.new_follower': 's’est abonné à toi',
|
||||||
|
'notif.reaction': 'a réagi à ton avis',
|
||||||
|
'notif.on': 'sur {title}',
|
||||||
|
'home.notifications': 'Notifications',
|
||||||
|
'home.notificationsN': '{count} notifications',
|
||||||
'settings.admin': 'Administration',
|
'settings.admin': 'Administration',
|
||||||
'admin.title': 'Administration',
|
'admin.title': 'Administration',
|
||||||
'admin.tabOverview': 'Vue d\'ensemble',
|
'admin.tabOverview': 'Vue d\'ensemble',
|
||||||
|
|||||||
@@ -228,6 +228,24 @@ const dict: Translations = {
|
|||||||
'settings.installApp': 'ऐप इंस्टॉल करें',
|
'settings.installApp': 'ऐप इंस्टॉल करें',
|
||||||
'settings.installHint': 'AzuuCine को अपनी होम स्क्रीन या डेस्कटॉप पर जोड़ें।',
|
'settings.installHint': 'AzuuCine को अपनी होम स्क्रीन या डेस्कटॉप पर जोड़ें।',
|
||||||
'settings.installed': 'ऐप इंस्टॉल हो गया',
|
'settings.installed': 'ऐप इंस्टॉल हो गया',
|
||||||
|
'reviews.title': 'समीक्षाएँ',
|
||||||
|
'reviews.friends': 'तुम्हारे दोस्त',
|
||||||
|
'reviews.others': 'अन्य सदस्य',
|
||||||
|
'reviews.noneFriends': 'तुम्हारे दोस्तों की कोई समीक्षा नहीं',
|
||||||
|
'reviews.noneOthers': 'कोई अन्य समीक्षा नहीं',
|
||||||
|
'reviews.none': 'अभी कोई समीक्षा नहीं',
|
||||||
|
'reviews.seeAll': 'सभी समीक्षाएँ देखें',
|
||||||
|
'reviews.react': 'प्रतिक्रिया दें',
|
||||||
|
'notif.title': 'सूचनाएँ',
|
||||||
|
'notif.empty': 'कोई सूचना नहीं',
|
||||||
|
'notif.someone': 'किसी ने',
|
||||||
|
'notif.follow_request': 'तुम्हें फ़ॉलो करना चाहता है',
|
||||||
|
'notif.follow_accepted': 'तुम्हारा अनुरोध स्वीकार किया',
|
||||||
|
'notif.new_follower': 'तुम्हें फ़ॉलो करने लगा',
|
||||||
|
'notif.reaction': 'तुम्हारी समीक्षा पर प्रतिक्रिया दी',
|
||||||
|
'notif.on': '{title} पर',
|
||||||
|
'home.notifications': 'सूचनाएँ',
|
||||||
|
'home.notificationsN': '{count} सूचनाएँ',
|
||||||
'settings.admin': 'Administration',
|
'settings.admin': 'Administration',
|
||||||
'admin.title': 'Administration',
|
'admin.title': 'Administration',
|
||||||
'admin.tabOverview': 'Overview',
|
'admin.tabOverview': 'Overview',
|
||||||
|
|||||||
@@ -228,6 +228,24 @@ const dict: Translations = {
|
|||||||
'settings.installApp': 'Pasang aplikasi',
|
'settings.installApp': 'Pasang aplikasi',
|
||||||
'settings.installHint': 'Tambahkan AzuuCine ke layar utama atau desktop kamu.',
|
'settings.installHint': 'Tambahkan AzuuCine ke layar utama atau desktop kamu.',
|
||||||
'settings.installed': 'Aplikasi terpasang',
|
'settings.installed': 'Aplikasi terpasang',
|
||||||
|
'reviews.title': 'Ulasan',
|
||||||
|
'reviews.friends': 'Teman kamu',
|
||||||
|
'reviews.others': 'Anggota lain',
|
||||||
|
'reviews.noneFriends': 'Tidak ada ulasan dari temanmu',
|
||||||
|
'reviews.noneOthers': 'Tidak ada ulasan lain',
|
||||||
|
'reviews.none': 'Belum ada ulasan',
|
||||||
|
'reviews.seeAll': 'Lihat semua ulasan',
|
||||||
|
'reviews.react': 'Reaksi',
|
||||||
|
'notif.title': 'Notifikasi',
|
||||||
|
'notif.empty': 'Tidak ada notifikasi',
|
||||||
|
'notif.someone': 'Seseorang',
|
||||||
|
'notif.follow_request': 'ingin mengikutimu',
|
||||||
|
'notif.follow_accepted': 'menerima permintaanmu',
|
||||||
|
'notif.new_follower': 'mulai mengikutimu',
|
||||||
|
'notif.reaction': 'bereaksi pada ulasanmu',
|
||||||
|
'notif.on': 'di {title}',
|
||||||
|
'home.notifications': 'Notifikasi',
|
||||||
|
'home.notificationsN': '{count} notifikasi',
|
||||||
'settings.admin': 'Administration',
|
'settings.admin': 'Administration',
|
||||||
'admin.title': 'Administration',
|
'admin.title': 'Administration',
|
||||||
'admin.tabOverview': 'Overview',
|
'admin.tabOverview': 'Overview',
|
||||||
|
|||||||
@@ -228,6 +228,24 @@ const dict: Translations = {
|
|||||||
'settings.installApp': 'Installa l\'app',
|
'settings.installApp': 'Installa l\'app',
|
||||||
'settings.installHint': 'Aggiungi AzuuCine alla schermata home o al desktop.',
|
'settings.installHint': 'Aggiungi AzuuCine alla schermata home o al desktop.',
|
||||||
'settings.installed': 'App installata',
|
'settings.installed': 'App installata',
|
||||||
|
'reviews.title': 'Recensioni',
|
||||||
|
'reviews.friends': 'I tuoi amici',
|
||||||
|
'reviews.others': 'Altri membri',
|
||||||
|
'reviews.noneFriends': 'Nessuna recensione dei tuoi amici',
|
||||||
|
'reviews.noneOthers': 'Nessun’altra recensione',
|
||||||
|
'reviews.none': 'Ancora nessuna recensione',
|
||||||
|
'reviews.seeAll': 'Vedi tutte le recensioni',
|
||||||
|
'reviews.react': 'Reagisci',
|
||||||
|
'notif.title': 'Notifiche',
|
||||||
|
'notif.empty': 'Nessuna notifica',
|
||||||
|
'notif.someone': 'Qualcuno',
|
||||||
|
'notif.follow_request': 'vuole seguirti',
|
||||||
|
'notif.follow_accepted': 'ha accettato la tua richiesta',
|
||||||
|
'notif.new_follower': 'ha iniziato a seguirti',
|
||||||
|
'notif.reaction': 'ha reagito alla tua recensione',
|
||||||
|
'notif.on': 'su {title}',
|
||||||
|
'home.notifications': 'Notifiche',
|
||||||
|
'home.notificationsN': '{count} notifiche',
|
||||||
'settings.admin': 'Administration',
|
'settings.admin': 'Administration',
|
||||||
'admin.title': 'Administration',
|
'admin.title': 'Administration',
|
||||||
'admin.tabOverview': 'Overview',
|
'admin.tabOverview': 'Overview',
|
||||||
|
|||||||
@@ -228,6 +228,24 @@ const dict: Translations = {
|
|||||||
'settings.installApp': 'アプリをインストール',
|
'settings.installApp': 'アプリをインストール',
|
||||||
'settings.installHint': 'AzuuCine をホーム画面やデスクトップに追加します。',
|
'settings.installHint': 'AzuuCine をホーム画面やデスクトップに追加します。',
|
||||||
'settings.installed': 'アプリをインストール済み',
|
'settings.installed': 'アプリをインストール済み',
|
||||||
|
'reviews.title': 'レビュー',
|
||||||
|
'reviews.friends': '友だち',
|
||||||
|
'reviews.others': 'ほかのメンバー',
|
||||||
|
'reviews.noneFriends': '友だちのレビューはありません',
|
||||||
|
'reviews.noneOthers': 'ほかのレビューはありません',
|
||||||
|
'reviews.none': 'まだレビューがありません',
|
||||||
|
'reviews.seeAll': 'すべてのレビューを見る',
|
||||||
|
'reviews.react': 'リアクション',
|
||||||
|
'notif.title': '通知',
|
||||||
|
'notif.empty': '通知はありません',
|
||||||
|
'notif.someone': '誰か',
|
||||||
|
'notif.follow_request': 'があなたをフォローしたがっています',
|
||||||
|
'notif.follow_accepted': 'があなたのリクエストを承認しました',
|
||||||
|
'notif.new_follower': 'があなたをフォローしました',
|
||||||
|
'notif.reaction': 'があなたのレビューにリアクションしました',
|
||||||
|
'notif.on': '「{title}」に',
|
||||||
|
'home.notifications': '通知',
|
||||||
|
'home.notificationsN': '{count}件の通知',
|
||||||
'settings.admin': 'Administration',
|
'settings.admin': 'Administration',
|
||||||
'admin.title': 'Administration',
|
'admin.title': 'Administration',
|
||||||
'admin.tabOverview': 'Overview',
|
'admin.tabOverview': 'Overview',
|
||||||
|
|||||||
@@ -228,6 +228,24 @@ const dict: Translations = {
|
|||||||
'settings.installApp': '앱 설치',
|
'settings.installApp': '앱 설치',
|
||||||
'settings.installHint': 'AzuuCine을 홈 화면이나 바탕화면에 추가하세요.',
|
'settings.installHint': 'AzuuCine을 홈 화면이나 바탕화면에 추가하세요.',
|
||||||
'settings.installed': '앱 설치됨',
|
'settings.installed': '앱 설치됨',
|
||||||
|
'reviews.title': '리뷰',
|
||||||
|
'reviews.friends': '내 친구',
|
||||||
|
'reviews.others': '다른 회원',
|
||||||
|
'reviews.noneFriends': '친구의 리뷰가 없어요',
|
||||||
|
'reviews.noneOthers': '다른 리뷰가 없어요',
|
||||||
|
'reviews.none': '아직 리뷰가 없어요',
|
||||||
|
'reviews.seeAll': '리뷰 모두 보기',
|
||||||
|
'reviews.react': '반응하기',
|
||||||
|
'notif.title': '알림',
|
||||||
|
'notif.empty': '알림이 없어요',
|
||||||
|
'notif.someone': '누군가',
|
||||||
|
'notif.follow_request': '님이 당신을 팔로우하고 싶어 해요',
|
||||||
|
'notif.follow_accepted': '님이 요청을 수락했어요',
|
||||||
|
'notif.new_follower': '님이 당신을 팔로우했어요',
|
||||||
|
'notif.reaction': '님이 당신의 리뷰에 반응했어요',
|
||||||
|
'notif.on': '{title}에',
|
||||||
|
'home.notifications': '알림',
|
||||||
|
'home.notificationsN': '알림 {count}개',
|
||||||
'settings.admin': 'Administration',
|
'settings.admin': 'Administration',
|
||||||
'admin.title': 'Administration',
|
'admin.title': 'Administration',
|
||||||
'admin.tabOverview': 'Overview',
|
'admin.tabOverview': 'Overview',
|
||||||
|
|||||||
@@ -228,6 +228,24 @@ const dict: Translations = {
|
|||||||
'settings.installApp': 'App installeren',
|
'settings.installApp': 'App installeren',
|
||||||
'settings.installHint': 'Voeg AzuuCine toe aan je startscherm of bureaublad.',
|
'settings.installHint': 'Voeg AzuuCine toe aan je startscherm of bureaublad.',
|
||||||
'settings.installed': 'App geïnstalleerd',
|
'settings.installed': 'App geïnstalleerd',
|
||||||
|
'reviews.title': 'Recensies',
|
||||||
|
'reviews.friends': 'Je vrienden',
|
||||||
|
'reviews.others': 'Andere leden',
|
||||||
|
'reviews.noneFriends': 'Geen recensies van je vrienden',
|
||||||
|
'reviews.noneOthers': 'Geen andere recensies',
|
||||||
|
'reviews.none': 'Nog geen recensies',
|
||||||
|
'reviews.seeAll': 'Alle recensies bekijken',
|
||||||
|
'reviews.react': 'Reageren',
|
||||||
|
'notif.title': 'Meldingen',
|
||||||
|
'notif.empty': 'Geen meldingen',
|
||||||
|
'notif.someone': 'Iemand',
|
||||||
|
'notif.follow_request': 'wil je volgen',
|
||||||
|
'notif.follow_accepted': 'heeft je verzoek geaccepteerd',
|
||||||
|
'notif.new_follower': 'volgt je nu',
|
||||||
|
'notif.reaction': 'heeft op je recensie gereageerd',
|
||||||
|
'notif.on': 'op {title}',
|
||||||
|
'home.notifications': 'Meldingen',
|
||||||
|
'home.notificationsN': '{count} meldingen',
|
||||||
'settings.admin': 'Administration',
|
'settings.admin': 'Administration',
|
||||||
'admin.title': 'Administration',
|
'admin.title': 'Administration',
|
||||||
'admin.tabOverview': 'Overview',
|
'admin.tabOverview': 'Overview',
|
||||||
|
|||||||
@@ -232,6 +232,24 @@ const dict: Translations = {
|
|||||||
'settings.installApp': 'Zainstaluj aplikację',
|
'settings.installApp': 'Zainstaluj aplikację',
|
||||||
'settings.installHint': 'Dodaj AzuuCine do ekranu głównego lub pulpitu.',
|
'settings.installHint': 'Dodaj AzuuCine do ekranu głównego lub pulpitu.',
|
||||||
'settings.installed': 'Aplikacja zainstalowana',
|
'settings.installed': 'Aplikacja zainstalowana',
|
||||||
|
'reviews.title': 'Recenzje',
|
||||||
|
'reviews.friends': 'Twoi znajomi',
|
||||||
|
'reviews.others': 'Inni użytkownicy',
|
||||||
|
'reviews.noneFriends': 'Brak recenzji od znajomych',
|
||||||
|
'reviews.noneOthers': 'Brak innych recenzji',
|
||||||
|
'reviews.none': 'Jeszcze nie ma recenzji',
|
||||||
|
'reviews.seeAll': 'Zobacz wszystkie recenzje',
|
||||||
|
'reviews.react': 'Zareaguj',
|
||||||
|
'notif.title': 'Powiadomienia',
|
||||||
|
'notif.empty': 'Brak powiadomień',
|
||||||
|
'notif.someone': 'Ktoś',
|
||||||
|
'notif.follow_request': 'chce Cię obserwować',
|
||||||
|
'notif.follow_accepted': 'zaakceptował Twoją prośbę',
|
||||||
|
'notif.new_follower': 'zaczął Cię obserwować',
|
||||||
|
'notif.reaction': 'zareagował na Twoją recenzję',
|
||||||
|
'notif.on': 'w {title}',
|
||||||
|
'home.notifications': 'Powiadomienia',
|
||||||
|
'home.notificationsN': 'Powiadomienia: {count}',
|
||||||
'settings.admin': 'Administration',
|
'settings.admin': 'Administration',
|
||||||
'admin.title': 'Administration',
|
'admin.title': 'Administration',
|
||||||
'admin.tabOverview': 'Overview',
|
'admin.tabOverview': 'Overview',
|
||||||
|
|||||||
@@ -228,6 +228,24 @@ const dict: Translations = {
|
|||||||
'settings.installApp': 'Instalar o app',
|
'settings.installApp': 'Instalar o app',
|
||||||
'settings.installHint': 'Adicione o AzuuCine à tela inicial ou à área de trabalho.',
|
'settings.installHint': 'Adicione o AzuuCine à tela inicial ou à área de trabalho.',
|
||||||
'settings.installed': 'App instalado',
|
'settings.installed': 'App instalado',
|
||||||
|
'reviews.title': 'Avaliações',
|
||||||
|
'reviews.friends': 'Teus amigos',
|
||||||
|
'reviews.others': 'Outros membros',
|
||||||
|
'reviews.noneFriends': 'Nenhuma avaliação dos teus amigos',
|
||||||
|
'reviews.noneOthers': 'Nenhuma outra avaliação',
|
||||||
|
'reviews.none': 'Ainda sem avaliações',
|
||||||
|
'reviews.seeAll': 'Ver todas as avaliações',
|
||||||
|
'reviews.react': 'Reagir',
|
||||||
|
'notif.title': 'Notificações',
|
||||||
|
'notif.empty': 'Sem notificações',
|
||||||
|
'notif.someone': 'Alguém',
|
||||||
|
'notif.follow_request': 'quer te seguir',
|
||||||
|
'notif.follow_accepted': 'aceitou teu pedido',
|
||||||
|
'notif.new_follower': 'começou a te seguir',
|
||||||
|
'notif.reaction': 'reagiu à tua avaliação',
|
||||||
|
'notif.on': 'em {title}',
|
||||||
|
'home.notifications': 'Notificações',
|
||||||
|
'home.notificationsN': '{count} notificações',
|
||||||
'settings.admin': 'Administration',
|
'settings.admin': 'Administration',
|
||||||
'admin.title': 'Administration',
|
'admin.title': 'Administration',
|
||||||
'admin.tabOverview': 'Overview',
|
'admin.tabOverview': 'Overview',
|
||||||
|
|||||||
@@ -232,6 +232,24 @@ const dict: Translations = {
|
|||||||
'settings.installApp': 'Установить приложение',
|
'settings.installApp': 'Установить приложение',
|
||||||
'settings.installHint': 'Добавь AzuuCine на главный экран или рабочий стол.',
|
'settings.installHint': 'Добавь AzuuCine на главный экран или рабочий стол.',
|
||||||
'settings.installed': 'Приложение установлено',
|
'settings.installed': 'Приложение установлено',
|
||||||
|
'reviews.title': 'Отзывы',
|
||||||
|
'reviews.friends': 'Твои друзья',
|
||||||
|
'reviews.others': 'Другие участники',
|
||||||
|
'reviews.noneFriends': 'Нет отзывов от друзей',
|
||||||
|
'reviews.noneOthers': 'Других отзывов нет',
|
||||||
|
'reviews.none': 'Пока нет отзывов',
|
||||||
|
'reviews.seeAll': 'Смотреть все отзывы',
|
||||||
|
'reviews.react': 'Отреагировать',
|
||||||
|
'notif.title': 'Уведомления',
|
||||||
|
'notif.empty': 'Нет уведомлений',
|
||||||
|
'notif.someone': 'Кто-то',
|
||||||
|
'notif.follow_request': 'хочет подписаться на тебя',
|
||||||
|
'notif.follow_accepted': 'принял(а) твою заявку',
|
||||||
|
'notif.new_follower': 'подписался(ась) на тебя',
|
||||||
|
'notif.reaction': 'отреагировал(а) на твой отзыв',
|
||||||
|
'notif.on': 'к «{title}»',
|
||||||
|
'home.notifications': 'Уведомления',
|
||||||
|
'home.notificationsN': 'Уведомлений: {count}',
|
||||||
'settings.admin': 'Administration',
|
'settings.admin': 'Administration',
|
||||||
'admin.title': 'Administration',
|
'admin.title': 'Administration',
|
||||||
'admin.tabOverview': 'Overview',
|
'admin.tabOverview': 'Overview',
|
||||||
|
|||||||
@@ -228,6 +228,24 @@ const dict: Translations = {
|
|||||||
'settings.installApp': 'ติดตั้งแอป',
|
'settings.installApp': 'ติดตั้งแอป',
|
||||||
'settings.installHint': 'เพิ่ม AzuuCine ไปที่หน้าจอหลักหรือเดสก์ท็อปของคุณ',
|
'settings.installHint': 'เพิ่ม AzuuCine ไปที่หน้าจอหลักหรือเดสก์ท็อปของคุณ',
|
||||||
'settings.installed': 'ติดตั้งแอปแล้ว',
|
'settings.installed': 'ติดตั้งแอปแล้ว',
|
||||||
|
'reviews.title': 'รีวิว',
|
||||||
|
'reviews.friends': 'เพื่อนของคุณ',
|
||||||
|
'reviews.others': 'สมาชิกอื่น',
|
||||||
|
'reviews.noneFriends': 'ไม่มีรีวิวจากเพื่อน',
|
||||||
|
'reviews.noneOthers': 'ไม่มีรีวิวอื่น',
|
||||||
|
'reviews.none': 'ยังไม่มีรีวิว',
|
||||||
|
'reviews.seeAll': 'ดูรีวิวทั้งหมด',
|
||||||
|
'reviews.react': 'แสดงความรู้สึก',
|
||||||
|
'notif.title': 'การแจ้งเตือน',
|
||||||
|
'notif.empty': 'ไม่มีการแจ้งเตือน',
|
||||||
|
'notif.someone': 'มีคน',
|
||||||
|
'notif.follow_request': 'ต้องการติดตามคุณ',
|
||||||
|
'notif.follow_accepted': 'ยอมรับคำขอของคุณ',
|
||||||
|
'notif.new_follower': 'เริ่มติดตามคุณ',
|
||||||
|
'notif.reaction': 'แสดงความรู้สึกต่อรีวิวของคุณ',
|
||||||
|
'notif.on': 'ใน {title}',
|
||||||
|
'home.notifications': 'การแจ้งเตือน',
|
||||||
|
'home.notificationsN': '{count} การแจ้งเตือน',
|
||||||
'settings.admin': 'Administration',
|
'settings.admin': 'Administration',
|
||||||
'admin.title': 'Administration',
|
'admin.title': 'Administration',
|
||||||
'admin.tabOverview': 'Overview',
|
'admin.tabOverview': 'Overview',
|
||||||
|
|||||||
@@ -228,6 +228,24 @@ const dict: Translations = {
|
|||||||
'settings.installApp': 'Uygulamayı yükle',
|
'settings.installApp': 'Uygulamayı yükle',
|
||||||
'settings.installHint': 'AzuuCine’i ana ekranına veya masaüstüne ekle.',
|
'settings.installHint': 'AzuuCine’i ana ekranına veya masaüstüne ekle.',
|
||||||
'settings.installed': 'Uygulama yüklendi',
|
'settings.installed': 'Uygulama yüklendi',
|
||||||
|
'reviews.title': 'Yorumlar',
|
||||||
|
'reviews.friends': 'Arkadaşların',
|
||||||
|
'reviews.others': 'Diğer üyeler',
|
||||||
|
'reviews.noneFriends': 'Arkadaşlarından yorum yok',
|
||||||
|
'reviews.noneOthers': 'Başka yorum yok',
|
||||||
|
'reviews.none': 'Henüz yorum yok',
|
||||||
|
'reviews.seeAll': 'Tüm yorumları gör',
|
||||||
|
'reviews.react': 'Tepki ver',
|
||||||
|
'notif.title': 'Bildirimler',
|
||||||
|
'notif.empty': 'Bildirim yok',
|
||||||
|
'notif.someone': 'Biri',
|
||||||
|
'notif.follow_request': 'seni takip etmek istiyor',
|
||||||
|
'notif.follow_accepted': 'isteğini kabul etti',
|
||||||
|
'notif.new_follower': 'seni takip etmeye başladı',
|
||||||
|
'notif.reaction': 'yorumuna tepki verdi',
|
||||||
|
'notif.on': '{title} için',
|
||||||
|
'home.notifications': 'Bildirimler',
|
||||||
|
'home.notificationsN': '{count} bildirim',
|
||||||
'settings.admin': 'Administration',
|
'settings.admin': 'Administration',
|
||||||
'admin.title': 'Administration',
|
'admin.title': 'Administration',
|
||||||
'admin.tabOverview': 'Overview',
|
'admin.tabOverview': 'Overview',
|
||||||
|
|||||||
@@ -228,6 +228,24 @@ const dict: Translations = {
|
|||||||
'settings.installApp': 'Cài đặt ứng dụng',
|
'settings.installApp': 'Cài đặt ứng dụng',
|
||||||
'settings.installHint': 'Thêm AzuuCine vào màn hình chính hoặc màn hình nền của bạn.',
|
'settings.installHint': 'Thêm AzuuCine vào màn hình chính hoặc màn hình nền của bạn.',
|
||||||
'settings.installed': 'Đã cài ứng dụng',
|
'settings.installed': 'Đã cài ứng dụng',
|
||||||
|
'reviews.title': 'Đánh giá',
|
||||||
|
'reviews.friends': 'Bạn bè của bạn',
|
||||||
|
'reviews.others': 'Thành viên khác',
|
||||||
|
'reviews.noneFriends': 'Chưa có đánh giá từ bạn bè',
|
||||||
|
'reviews.noneOthers': 'Không có đánh giá khác',
|
||||||
|
'reviews.none': 'Chưa có đánh giá',
|
||||||
|
'reviews.seeAll': 'Xem tất cả đánh giá',
|
||||||
|
'reviews.react': 'Bày tỏ cảm xúc',
|
||||||
|
'notif.title': 'Thông báo',
|
||||||
|
'notif.empty': 'Không có thông báo',
|
||||||
|
'notif.someone': 'Ai đó',
|
||||||
|
'notif.follow_request': 'muốn theo dõi bạn',
|
||||||
|
'notif.follow_accepted': 'đã chấp nhận yêu cầu của bạn',
|
||||||
|
'notif.new_follower': 'đã theo dõi bạn',
|
||||||
|
'notif.reaction': 'đã bày tỏ cảm xúc với đánh giá của bạn',
|
||||||
|
'notif.on': 'về {title}',
|
||||||
|
'home.notifications': 'Thông báo',
|
||||||
|
'home.notificationsN': '{count} thông báo',
|
||||||
'settings.admin': 'Administration',
|
'settings.admin': 'Administration',
|
||||||
'admin.title': 'Administration',
|
'admin.title': 'Administration',
|
||||||
'admin.tabOverview': 'Overview',
|
'admin.tabOverview': 'Overview',
|
||||||
|
|||||||
@@ -228,6 +228,24 @@ const dict: Translations = {
|
|||||||
'settings.installApp': '安装应用',
|
'settings.installApp': '安装应用',
|
||||||
'settings.installHint': '将 AzuuCine 添加到主屏幕或桌面。',
|
'settings.installHint': '将 AzuuCine 添加到主屏幕或桌面。',
|
||||||
'settings.installed': '应用已安装',
|
'settings.installed': '应用已安装',
|
||||||
|
'reviews.title': '评价',
|
||||||
|
'reviews.friends': '你的好友',
|
||||||
|
'reviews.others': '其他用户',
|
||||||
|
'reviews.noneFriends': '好友暂无评价',
|
||||||
|
'reviews.noneOthers': '暂无其他评价',
|
||||||
|
'reviews.none': '还没有评价',
|
||||||
|
'reviews.seeAll': '查看全部评价',
|
||||||
|
'reviews.react': '回应',
|
||||||
|
'notif.title': '通知',
|
||||||
|
'notif.empty': '暂无通知',
|
||||||
|
'notif.someone': '有人',
|
||||||
|
'notif.follow_request': '想关注你',
|
||||||
|
'notif.follow_accepted': '接受了你的请求',
|
||||||
|
'notif.new_follower': '开始关注你',
|
||||||
|
'notif.reaction': '回应了你的评价',
|
||||||
|
'notif.on': '关于《{title}》',
|
||||||
|
'home.notifications': '通知',
|
||||||
|
'home.notificationsN': '{count} 条通知',
|
||||||
'settings.admin': 'Administration',
|
'settings.admin': 'Administration',
|
||||||
'admin.title': 'Administration',
|
'admin.title': 'Administration',
|
||||||
'admin.tabOverview': 'Overview',
|
'admin.tabOverview': 'Overview',
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
import { t } from '../../i18n'
|
||||||
|
import { cloudFetch } from './api'
|
||||||
|
|
||||||
|
/** Notifications (cloche) : abonnements, demandes acceptées, réactions reçues. */
|
||||||
|
|
||||||
|
export type NotificationKind = 'follow_request' | 'follow_accepted' | 'new_follower' | 'reaction'
|
||||||
|
|
||||||
|
export interface AppNotification {
|
||||||
|
id: number
|
||||||
|
kind: NotificationKind
|
||||||
|
created_at: string
|
||||||
|
read_at: string | null
|
||||||
|
emoji: string | null
|
||||||
|
item_id: string | null
|
||||||
|
actor: { username: string; display_name: string; avatar_url: string | null } | null
|
||||||
|
/** Titre de la fiche concernée (réactions) */
|
||||||
|
title: string | null
|
||||||
|
}
|
||||||
|
|
||||||
|
async function rpc<T>(name: string, args: Record<string, unknown> = {}): Promise<T> {
|
||||||
|
const res = await cloudFetch(`/rest/v1/rpc/${name}`, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: { 'Content-Type': 'application/json' },
|
||||||
|
body: JSON.stringify(args),
|
||||||
|
})
|
||||||
|
if (!res.ok) throw new Error(t('social.err.server', { status: res.status }))
|
||||||
|
return res.json() as Promise<T>
|
||||||
|
}
|
||||||
|
|
||||||
|
export const listNotifications = (offset = 0) => rpc<AppNotification[]>('get_notifications', { p_offset: offset })
|
||||||
|
|
||||||
|
export async function unreadCount(): Promise<number> {
|
||||||
|
try {
|
||||||
|
const n = await rpc<number>('notifications_unread')
|
||||||
|
return typeof n === 'number' ? n : 0
|
||||||
|
} catch {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function markNotificationsRead(): Promise<void> {
|
||||||
|
await rpc('mark_notifications_read')
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
import { t } from '../../i18n'
|
||||||
|
import { cloudFetch } from './api'
|
||||||
|
|
||||||
|
/** Avis des autres membres sur un même titre, et réactions (emoji). */
|
||||||
|
|
||||||
|
export const REACTION_EMOJIS = ['👍', '❤️', '🔥', '😂', '😮', '😢'] as const
|
||||||
|
export type ReactionEmoji = (typeof REACTION_EMOJIS)[number]
|
||||||
|
|
||||||
|
export interface ReviewAuthor {
|
||||||
|
id: string
|
||||||
|
username: string
|
||||||
|
display_name: string
|
||||||
|
avatar_url: string | null
|
||||||
|
is_private: boolean
|
||||||
|
relation: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface TitleReview {
|
||||||
|
user: ReviewAuthor
|
||||||
|
user_id: string
|
||||||
|
item_id: string
|
||||||
|
updated_at: string
|
||||||
|
rating: number | null
|
||||||
|
notes: string
|
||||||
|
/** emoji -> nombre */
|
||||||
|
reactions: Record<string, number>
|
||||||
|
total: number
|
||||||
|
/** mon emoji sur cet avis, ou null */
|
||||||
|
mine: string | null
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface TitleReviews {
|
||||||
|
friends: TitleReview[]
|
||||||
|
others: TitleReview[]
|
||||||
|
}
|
||||||
|
|
||||||
|
async function rpc<T>(name: string, args: Record<string, unknown> = {}): Promise<T> {
|
||||||
|
const res = await cloudFetch(`/rest/v1/rpc/${name}`, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: { 'Content-Type': 'application/json' },
|
||||||
|
body: JSON.stringify(args),
|
||||||
|
})
|
||||||
|
if (!res.ok) throw new Error(t('social.err.server', { status: res.status }))
|
||||||
|
return res.json() as Promise<T>
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Tous les avis publics sur un titre (séparés : amis / autres). */
|
||||||
|
export const titleReviews = (externalId: string, offset = 0) =>
|
||||||
|
rpc<TitleReviews>('title_reviews', { p_external_id: externalId, p_offset: offset })
|
||||||
|
|
||||||
|
export async function reactToReview(author: string, item: string, emoji: ReactionEmoji): Promise<void> {
|
||||||
|
await rpc('react_to_review', { p_author: author, p_item: item, p_emoji: emoji })
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function unreactReview(author: string, item: string): Promise<void> {
|
||||||
|
await rpc('unreact_review', { p_author: author, p_item: item })
|
||||||
|
}
|
||||||
+13
-1
@@ -1,6 +1,6 @@
|
|||||||
import { useSocial } from '../components/social/SocialProvider'
|
import { useSocial } from '../components/social/SocialProvider'
|
||||||
import { t } from '../i18n'
|
import { t } from '../i18n'
|
||||||
import { CalendarDays, Dices, Plus } from 'lucide-react'
|
import { Bell, CalendarDays, Dices, Plus } from 'lucide-react'
|
||||||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
||||||
import { TYPE_BY_VALUE } from '../lib/constants'
|
import { TYPE_BY_VALUE } from '../lib/constants'
|
||||||
import Avatar from '../components/social/Avatar'
|
import Avatar from '../components/social/Avatar'
|
||||||
@@ -132,6 +132,18 @@ export default function HomePage({ onOpen, onAdd, onNavigate, onRoulette, onCale
|
|||||||
<span className="absolute -end-1 -top-1 grid min-w-5 place-items-center rounded-full bg-accent-fill px-1 text-[10px] font-bold text-on-accent">{soon}</span>
|
<span className="absolute -end-1 -top-1 grid min-w-5 place-items-center rounded-full bg-accent-fill px-1 text-[10px] font-bold text-on-accent">{soon}</span>
|
||||||
)}
|
)}
|
||||||
</button>
|
</button>
|
||||||
|
{social.enabled && (
|
||||||
|
<button
|
||||||
|
onClick={social.openNotifications}
|
||||||
|
className="relative grid size-11 shrink-0 place-items-center rounded-full border border-line text-ink-2 transition-colors active:bg-surface-2"
|
||||||
|
aria-label={social.unread > 0 ? t('home.notificationsN', { count: social.unread }) : t('home.notifications')}
|
||||||
|
>
|
||||||
|
<Bell size={20} />
|
||||||
|
{social.unread > 0 && (
|
||||||
|
<span className="absolute -end-1 -top-1 grid min-w-5 place-items-center rounded-full bg-accent-fill px-1 text-[10px] font-bold text-on-accent">{social.unread}</span>
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
{social.enabled && (
|
{social.enabled && (
|
||||||
<button onClick={() => (social.me ? social.openProfile(social.me.username) : social.openSearch())} className="relative shrink-0 rounded-full" aria-label={t('social.myProfile')}>
|
<button onClick={() => (social.me ? social.openProfile(social.me.username) : social.openSearch())} className="relative shrink-0 rounded-full" aria-label={t('social.myProfile')}>
|
||||||
<Avatar url={social.me?.avatarUrl} name={social.me?.displayName ?? '?'} size={44} />
|
<Avatar url={social.me?.avatarUrl} name={social.me?.displayName ?? '?'} size={44} />
|
||||||
|
|||||||
@@ -0,0 +1,198 @@
|
|||||||
|
-- ════════════════════════════════════════════════════════════════════════════
|
||||||
|
-- AzuuCine — Avis par titre, réactions et notifications (5 octobre 2026)
|
||||||
|
-- 1. Voir tous les avis sur un titre (amis / autres).
|
||||||
|
-- 2. Réagir aux avis (emoji).
|
||||||
|
-- 3. Notifications (cloche) : abonnements, demandes acceptées, réactions reçues.
|
||||||
|
--
|
||||||
|
-- À coller dans Supabase → SQL Editor → Run. Idempotent (réexécutable sans risque).
|
||||||
|
-- ════════════════════════════════════════════════════════════════════════════
|
||||||
|
|
||||||
|
-- ── Tables ──
|
||||||
|
create table if not exists public.review_reactions (
|
||||||
|
author_id uuid not null references auth.users(id) on delete cascade, -- auteur de l'avis
|
||||||
|
item_id text not null,
|
||||||
|
user_id uuid not null default auth.uid() references auth.users(id) on delete cascade, -- qui réagit
|
||||||
|
emoji text not null,
|
||||||
|
created_at timestamptz not null default now(),
|
||||||
|
primary key (author_id, item_id, user_id)
|
||||||
|
);
|
||||||
|
create index if not exists review_reactions_target_idx on public.review_reactions (author_id, item_id);
|
||||||
|
alter table public.review_reactions enable row level security;
|
||||||
|
alter table public.review_reactions force row level security;
|
||||||
|
revoke all on public.review_reactions from anon, authenticated;
|
||||||
|
|
||||||
|
create table if not exists public.notifications (
|
||||||
|
id bigint generated always as identity primary key,
|
||||||
|
user_id uuid not null references auth.users(id) on delete cascade, -- destinataire
|
||||||
|
kind text not null check (kind in ('follow_request','follow_accepted','new_follower','reaction')),
|
||||||
|
actor_id uuid references auth.users(id) on delete cascade,
|
||||||
|
item_id text,
|
||||||
|
emoji text,
|
||||||
|
created_at timestamptz not null default now(),
|
||||||
|
read_at timestamptz
|
||||||
|
);
|
||||||
|
create index if not exists notifications_user_idx on public.notifications (user_id, created_at desc);
|
||||||
|
alter table public.notifications enable row level security;
|
||||||
|
alter table public.notifications force row level security;
|
||||||
|
revoke all on public.notifications from anon, authenticated;
|
||||||
|
|
||||||
|
-- ── Création de notifications + bornage de l'historique ──
|
||||||
|
create or replace function public.azuu_notify(p_user uuid, p_kind text, p_actor uuid, p_item text default null, p_emoji text default null)
|
||||||
|
returns void language plpgsql security definer set search_path = '' as $$
|
||||||
|
begin
|
||||||
|
if p_user is null or p_actor is null or p_user = p_actor then return; end if;
|
||||||
|
insert into public.notifications (user_id, kind, actor_id, item_id, emoji)
|
||||||
|
values (p_user, p_kind, p_actor, p_item, p_emoji);
|
||||||
|
delete from public.notifications
|
||||||
|
where user_id = p_user and id not in (
|
||||||
|
select id from public.notifications where user_id = p_user order by created_at desc limit 300
|
||||||
|
);
|
||||||
|
end;
|
||||||
|
$$;
|
||||||
|
|
||||||
|
-- Abonnement / demande -> notifie le compte suivi ; demande acceptée -> notifie le demandeur
|
||||||
|
create or replace function public.azuu_follow_notify()
|
||||||
|
returns trigger language plpgsql security definer set search_path = '' as $$
|
||||||
|
begin
|
||||||
|
if tg_op = 'INSERT' then
|
||||||
|
perform public.azuu_notify(new.following_id,
|
||||||
|
case when new.status = 'pending' then 'follow_request' else 'new_follower' end, new.follower_id);
|
||||||
|
elsif tg_op = 'UPDATE' and old.status = 'pending' and new.status = 'accepted' then
|
||||||
|
perform public.azuu_notify(new.follower_id, 'follow_accepted', new.following_id);
|
||||||
|
end if;
|
||||||
|
return null;
|
||||||
|
end;
|
||||||
|
$$;
|
||||||
|
drop trigger if exists follows_notify on public.follows;
|
||||||
|
create trigger follows_notify after insert or update on public.follows
|
||||||
|
for each row execute function public.azuu_follow_notify();
|
||||||
|
|
||||||
|
-- Réaction reçue -> notifie l'auteur de l'avis
|
||||||
|
create or replace function public.azuu_reaction_notify()
|
||||||
|
returns trigger language plpgsql security definer set search_path = '' as $$
|
||||||
|
begin
|
||||||
|
perform public.azuu_notify(new.author_id, 'reaction', new.user_id, new.item_id, new.emoji);
|
||||||
|
return null;
|
||||||
|
end;
|
||||||
|
$$;
|
||||||
|
drop trigger if exists reactions_notify on public.review_reactions;
|
||||||
|
create trigger reactions_notify after insert on public.review_reactions
|
||||||
|
for each row execute function public.azuu_reaction_notify();
|
||||||
|
|
||||||
|
-- ── Réagir à un avis ──
|
||||||
|
create or replace function public.react_to_review(p_author uuid, p_item text, p_emoji text)
|
||||||
|
returns jsonb language plpgsql security definer set search_path = '' as $$
|
||||||
|
begin
|
||||||
|
if auth.uid() is null then raise exception 'auth'; end if;
|
||||||
|
if p_author = auth.uid() then raise exception 'cannot react to your own review'; end if;
|
||||||
|
if p_emoji is null or p_emoji <> all (array['👍','❤️','🔥','😂','😮','😢']) then raise exception 'bad emoji'; end if;
|
||||||
|
if not public.can_view(p_author) or not exists (
|
||||||
|
select 1 from public.items i join public.profiles pr on pr.id = i.user_id
|
||||||
|
where i.user_id = p_author and i.id = p_item and not i.deleted
|
||||||
|
and coalesce(i.data->>'notes','') <> '' and not pr.suspended
|
||||||
|
) then
|
||||||
|
raise exception 'review not found';
|
||||||
|
end if;
|
||||||
|
insert into public.review_reactions (author_id, item_id, user_id, emoji)
|
||||||
|
values (p_author, p_item, auth.uid(), p_emoji)
|
||||||
|
on conflict (author_id, item_id, user_id) do update set emoji = excluded.emoji, created_at = now();
|
||||||
|
return jsonb_build_object('ok', true);
|
||||||
|
end;
|
||||||
|
$$;
|
||||||
|
|
||||||
|
create or replace function public.unreact_review(p_author uuid, p_item text)
|
||||||
|
returns jsonb language plpgsql security definer set search_path = '' as $$
|
||||||
|
begin
|
||||||
|
if auth.uid() is null then raise exception 'auth'; end if;
|
||||||
|
delete from public.review_reactions where author_id = p_author and item_id = p_item and user_id = auth.uid();
|
||||||
|
return jsonb_build_object('ok', true);
|
||||||
|
end;
|
||||||
|
$$;
|
||||||
|
|
||||||
|
-- ── Tous les avis sur un titre (amis / autres) ──
|
||||||
|
create or replace function public.title_reviews(p_external_id text, p_offset integer default 0)
|
||||||
|
returns jsonb language plpgsql stable security definer set search_path = '' as $$
|
||||||
|
declare me uuid := auth.uid(); res jsonb;
|
||||||
|
begin
|
||||||
|
if me is null or p_external_id !~ '^(tmdb:(movie|tv):[0-9]{1,10}|anilist:[0-9]{1,10})$' then
|
||||||
|
return jsonb_build_object('friends', '[]'::jsonb, 'others', '[]'::jsonb);
|
||||||
|
end if;
|
||||||
|
with revs as (
|
||||||
|
select i.user_id, i.id as item_id, i.updated_at,
|
||||||
|
nullif(i.data->>'rating','')::numeric as rating,
|
||||||
|
i.data->>'notes' as notes, pr,
|
||||||
|
exists(select 1 from public.follows f where f.follower_id = me and f.following_id = i.user_id and f.status = 'accepted') as friend
|
||||||
|
from public.items i
|
||||||
|
join public.profiles pr on pr.id = i.user_id
|
||||||
|
where i.data->>'externalId' = p_external_id
|
||||||
|
and not i.deleted and coalesce(i.data->>'notes','') <> ''
|
||||||
|
and i.user_id <> me and not pr.suspended
|
||||||
|
and (not pr.is_private
|
||||||
|
or exists(select 1 from public.follows f where f.follower_id = me and f.following_id = i.user_id and f.status = 'accepted'))
|
||||||
|
),
|
||||||
|
enriched as (
|
||||||
|
select r.*,
|
||||||
|
(select coalesce(jsonb_object_agg(e.emoji, e.c), '{}'::jsonb)
|
||||||
|
from (select emoji, count(*) c from public.review_reactions rr
|
||||||
|
where rr.author_id = r.user_id and rr.item_id = r.item_id group by emoji) e) as reactions,
|
||||||
|
(select count(*) from public.review_reactions rr where rr.author_id = r.user_id and rr.item_id = r.item_id) as total,
|
||||||
|
(select emoji from public.review_reactions rr where rr.author_id = r.user_id and rr.item_id = r.item_id and rr.user_id = me) as mine
|
||||||
|
from revs r
|
||||||
|
)
|
||||||
|
select jsonb_build_object(
|
||||||
|
'friends', coalesce((select jsonb_agg(entry order by total desc, updated_at desc) from (
|
||||||
|
select jsonb_build_object('user', public.profile_card(pr), 'user_id', user_id, 'item_id', item_id,
|
||||||
|
'updated_at', updated_at, 'rating', rating, 'notes', notes,
|
||||||
|
'reactions', reactions, 'total', total, 'mine', mine) entry, total, updated_at
|
||||||
|
from enriched where friend offset greatest(p_offset, 0) limit 40) f), '[]'::jsonb),
|
||||||
|
'others', coalesce((select jsonb_agg(entry order by total desc, updated_at desc) from (
|
||||||
|
select jsonb_build_object('user', public.profile_card(pr), 'user_id', user_id, 'item_id', item_id,
|
||||||
|
'updated_at', updated_at, 'rating', rating, 'notes', notes,
|
||||||
|
'reactions', reactions, 'total', total, 'mine', mine) entry, total, updated_at
|
||||||
|
from enriched where not friend offset greatest(p_offset, 0) limit 40) o), '[]'::jsonb)
|
||||||
|
) into res;
|
||||||
|
return res;
|
||||||
|
end;
|
||||||
|
$$;
|
||||||
|
|
||||||
|
-- ── Notifications ──
|
||||||
|
create or replace function public.get_notifications(p_offset integer default 0)
|
||||||
|
returns jsonb language sql stable security definer set search_path = '' as $$
|
||||||
|
select coalesce(jsonb_agg(x order by created_at desc), '[]'::jsonb)
|
||||||
|
from (
|
||||||
|
select n.id, n.kind, n.created_at, n.read_at, n.emoji, n.item_id,
|
||||||
|
case when p.id is null then null else
|
||||||
|
jsonb_build_object('username', p.username, 'display_name', p.display_name, 'avatar_url', p.avatar_url) end as actor,
|
||||||
|
case when n.kind = 'reaction'
|
||||||
|
then (select it.data->>'title' from public.items it where it.user_id = n.user_id and it.id = n.item_id) end as title
|
||||||
|
from public.notifications n
|
||||||
|
left join public.profiles p on p.id = n.actor_id
|
||||||
|
where n.user_id = auth.uid()
|
||||||
|
order by n.created_at desc
|
||||||
|
offset greatest(p_offset, 0) limit 30
|
||||||
|
) x
|
||||||
|
$$;
|
||||||
|
|
||||||
|
create or replace function public.notifications_unread()
|
||||||
|
returns integer language sql stable security definer set search_path = '' as $$
|
||||||
|
select count(*)::int from public.notifications where user_id = auth.uid() and read_at is null
|
||||||
|
$$;
|
||||||
|
|
||||||
|
create or replace function public.mark_notifications_read()
|
||||||
|
returns void language sql security definer set search_path = '' as $$
|
||||||
|
update public.notifications set read_at = now() where user_id = auth.uid() and read_at is null
|
||||||
|
$$;
|
||||||
|
|
||||||
|
-- ── Droits (gate interne : auth.uid() / can_view) ──
|
||||||
|
revoke all on function public.react_to_review(uuid, text, text) from public, anon;
|
||||||
|
revoke all on function public.unreact_review(uuid, text) from public, anon;
|
||||||
|
revoke all on function public.title_reviews(text, integer) from public, anon;
|
||||||
|
revoke all on function public.get_notifications(integer) from public, anon;
|
||||||
|
revoke all on function public.notifications_unread() from public, anon;
|
||||||
|
revoke all on function public.mark_notifications_read() from public, anon;
|
||||||
|
grant execute on function public.react_to_review(uuid, text, text) to authenticated;
|
||||||
|
grant execute on function public.unreact_review(uuid, text) to authenticated;
|
||||||
|
grant execute on function public.title_reviews(text, integer) to authenticated;
|
||||||
|
grant execute on function public.get_notifications(integer) to authenticated;
|
||||||
|
grant execute on function public.notifications_unread() to authenticated;
|
||||||
|
grant execute on function public.mark_notifications_read() to authenticated;
|
||||||
@@ -1 +1 @@
|
|||||||
{"root":["./src/App.tsx","./src/Root.tsx","./src/main.tsx","./src/store.tsx","./src/types.ts","./src/vite-env.d.ts","./src/components/AccountSection.tsx","./src/components/AuthScreen.tsx","./src/components/Badges.tsx","./src/components/BottomNav.tsx","./src/components/CalendarView.tsx","./src/components/ConfirmDialog.tsx","./src/components/DatabaseSearch.tsx","./src/components/Disagreements.tsx","./src/components/EpisodeList.tsx","./src/components/HomeHero.tsx","./src/components/ItemHero.tsx","./src/components/JournalView.tsx","./src/components/ListsView.tsx","./src/components/MediaCard.tsx","./src/components/MediaForm.tsx","./src/components/Poster.tsx","./src/components/Rating.tsx","./src/components/Recommendations.tsx","./src/components/Roulette.tsx","./src/components/SharePreview.tsx","./src/components/SideNav.tsx","./src/components/TagInput.tsx","./src/components/TopFive.tsx","./src/components/TopFiveEditor.tsx","./src/components/ui.tsx","./src/components/social/Avatar.tsx","./src/components/social/EditProfile.tsx","./src/components/social/FollowList.tsx","./src/components/social/FriendsFeed.tsx","./src/components/social/ItemPeek.tsx","./src/components/social/PeopleSearch.tsx","./src/components/social/PersonRow.tsx","./src/components/social/ProfileView.tsx","./src/components/social/Sheet.tsx","./src/components/social/SocialProvider.tsx","./src/components/social/WelcomeProfile.tsx","./src/i18n/index.ts","./src/i18n/react.tsx","./src/i18n/locales/ar.ts","./src/i18n/locales/de.ts","./src/i18n/locales/en.ts","./src/i18n/locales/es.ts","./src/i18n/locales/fr.ts","./src/i18n/locales/hi.ts","./src/i18n/locales/id.ts","./src/i18n/locales/it.ts","./src/i18n/locales/ja.ts","./src/i18n/locales/ko.ts","./src/i18n/locales/nl.ts","./src/i18n/locales/pl.ts","./src/i18n/locales/pt.ts","./src/i18n/locales/ru.ts","./src/i18n/locales/th.ts","./src/i18n/locales/tr.ts","./src/i18n/locales/vi.ts","./src/i18n/locales/zh.ts","./src/lib/airing.ts","./src/lib/backup.ts","./src/lib/catalogApi.ts","./src/lib/constants.ts","./src/lib/db.ts","./src/lib/dragScroll.ts","./src/lib/escape.ts","./src/lib/franchise.ts","./src/lib/genres.ts","./src/lib/globalReleases.ts","./src/lib/image.ts","./src/lib/legacyImport.ts","./src/lib/onResume.ts","./src/lib/publicRatings.ts","./src/lib/pwa.ts","./src/lib/releases.ts","./src/lib/roulette.ts","./src/lib/scope.ts","./src/lib/scrollLock.ts","./src/lib/security.ts","./src/lib/shareCard.ts","./src/lib/stats.ts","./src/lib/theme.ts","./src/lib/timeAgo.ts","./src/lib/utils.ts","./src/lib/cloud/admin.ts","./src/lib/cloud/api.ts","./src/lib/cloud/auth.ts","./src/lib/cloud/config.ts","./src/lib/cloud/social.ts","./src/lib/cloud/sync.ts","./src/pages/AdminPage.tsx","./src/pages/CatalogPage.tsx","./src/pages/HomePage.tsx","./src/pages/SettingsPage.tsx","./src/pages/StatsPage.tsx","./vite.config.ts"],"version":"5.9.3"}
|
{"root":["./src/App.tsx","./src/Root.tsx","./src/main.tsx","./src/store.tsx","./src/types.ts","./src/vite-env.d.ts","./src/components/AccountSection.tsx","./src/components/AuthScreen.tsx","./src/components/Badges.tsx","./src/components/BottomNav.tsx","./src/components/CalendarView.tsx","./src/components/ConfirmDialog.tsx","./src/components/DatabaseSearch.tsx","./src/components/Disagreements.tsx","./src/components/EpisodeList.tsx","./src/components/HomeHero.tsx","./src/components/ItemHero.tsx","./src/components/JournalView.tsx","./src/components/ListsView.tsx","./src/components/MediaCard.tsx","./src/components/MediaForm.tsx","./src/components/Poster.tsx","./src/components/Rating.tsx","./src/components/Recommendations.tsx","./src/components/Roulette.tsx","./src/components/SharePreview.tsx","./src/components/SideNav.tsx","./src/components/TagInput.tsx","./src/components/TopFive.tsx","./src/components/TopFiveEditor.tsx","./src/components/ui.tsx","./src/components/social/Avatar.tsx","./src/components/social/EditProfile.tsx","./src/components/social/FollowList.tsx","./src/components/social/FriendsFeed.tsx","./src/components/social/ItemPeek.tsx","./src/components/social/Notifications.tsx","./src/components/social/PeopleSearch.tsx","./src/components/social/PersonRow.tsx","./src/components/social/ProfileView.tsx","./src/components/social/Sheet.tsx","./src/components/social/SocialProvider.tsx","./src/components/social/TitleReviews.tsx","./src/components/social/WelcomeProfile.tsx","./src/i18n/index.ts","./src/i18n/react.tsx","./src/i18n/locales/ar.ts","./src/i18n/locales/de.ts","./src/i18n/locales/en.ts","./src/i18n/locales/es.ts","./src/i18n/locales/fr.ts","./src/i18n/locales/hi.ts","./src/i18n/locales/id.ts","./src/i18n/locales/it.ts","./src/i18n/locales/ja.ts","./src/i18n/locales/ko.ts","./src/i18n/locales/nl.ts","./src/i18n/locales/pl.ts","./src/i18n/locales/pt.ts","./src/i18n/locales/ru.ts","./src/i18n/locales/th.ts","./src/i18n/locales/tr.ts","./src/i18n/locales/vi.ts","./src/i18n/locales/zh.ts","./src/lib/airing.ts","./src/lib/backup.ts","./src/lib/catalogApi.ts","./src/lib/constants.ts","./src/lib/db.ts","./src/lib/dragScroll.ts","./src/lib/escape.ts","./src/lib/franchise.ts","./src/lib/genres.ts","./src/lib/globalReleases.ts","./src/lib/image.ts","./src/lib/legacyImport.ts","./src/lib/onResume.ts","./src/lib/publicRatings.ts","./src/lib/pwa.ts","./src/lib/releases.ts","./src/lib/roulette.ts","./src/lib/scope.ts","./src/lib/scrollLock.ts","./src/lib/security.ts","./src/lib/shareCard.ts","./src/lib/stats.ts","./src/lib/theme.ts","./src/lib/timeAgo.ts","./src/lib/utils.ts","./src/lib/cloud/admin.ts","./src/lib/cloud/api.ts","./src/lib/cloud/auth.ts","./src/lib/cloud/config.ts","./src/lib/cloud/notifications.ts","./src/lib/cloud/reviews.ts","./src/lib/cloud/social.ts","./src/lib/cloud/sync.ts","./src/pages/AdminPage.tsx","./src/pages/CatalogPage.tsx","./src/pages/HomePage.tsx","./src/pages/SettingsPage.tsx","./src/pages/StatsPage.tsx","./vite.config.ts"],"version":"5.9.3"}
|
||||||
Reference in new issue
Block a user