- Écran de connexion : « Explorer sans compte ». Recherche, fiches, casting, pages des acteurs, où regarder… en lecture seule, dans un espace à part (vide, jamais mélangé à un compte ni aux données locales de l'appareil). - Noter, ajouter, écrire un avis, listes… ouvrent « Crée ton compte pour continuer » (Créer un compte / Connexion) ; rien n'est enregistré. - Bandeau discret + carte « Mon compte » dans les réglages. - Proxy tmdb : appels anonymes acceptés, limités à 200 / 10 min par IP (600 pour un compte). Redéployé (v12). 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:
28 files changed
+290
-25
No files matched your search
@@ -49,8 +49,8 @@ function Shell({ children, subtitle }: { children: ReactNode; subtitle: string }
|
||||
}
|
||||
|
||||
/** Écran de connexion / inscription (affiché quand les comptes sont activés et qu'on n'est pas connecté). */
|
||||
export default function AuthScreen({ notice }: { notice?: string }) {
|
||||
const [mode, setMode] = useState<Mode>('login')
|
||||
export default function AuthScreen({ notice, onExplore, initialMode = 'login' }: { notice?: string; /** Mode découverte : regarder l'app sans compte */ onExplore?: () => void; initialMode?: 'login' | 'signup' }) {
|
||||
const [mode, setMode] = useState<Mode>(initialMode)
|
||||
const [email, setEmail] = useState('')
|
||||
const [username, setUsername] = useState('')
|
||||
const [password, setPassword] = useState('')
|
||||
@@ -201,6 +201,12 @@ export default function AuthScreen({ notice }: { notice?: string }) {
|
||||
{mode === 'signup' && <p className="text-center text-xs leading-relaxed text-ink-3">{t('auth.consent')}</p>}
|
||||
</form>
|
||||
|
||||
{onExplore && mode !== 'forgot' && (
|
||||
<button type="button" onClick={onExplore} className="mt-4 w-full rounded-full py-2.5 text-sm font-medium text-ink-2 transition-colors hover:text-ink">
|
||||
{t('guest.explore')} <span className="text-accent rtl:-scale-x-100">→</span>
|
||||
</button>
|
||||
)}
|
||||
|
||||
<div className="mt-5 text-center text-sm">
|
||||
{mode === 'login' && (
|
||||
<button type="button" onClick={() => switchTo('forgot')} className="text-ink-3">
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
import { X } from 'lucide-react'
|
||||
import { t } from '../../i18n'
|
||||
import { useBackToClose } from '../../lib/backNav'
|
||||
import { useEscape } from '../../lib/escape'
|
||||
|
||||
/** Mode découverte : un geste qui demande un compte (noter, ajouter, suivre…). */
|
||||
export default function GuestPrompt({ onSignIn, onSignUp, onClose }: { onSignIn: () => void; onSignUp: () => void; onClose: () => void }) {
|
||||
useEscape(onClose)
|
||||
useBackToClose(onClose)
|
||||
return (
|
||||
<div className="fixed inset-0 z-[80] flex items-end justify-center bg-black/60 sm:items-center" onClick={onClose}>
|
||||
<div
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
aria-labelledby="guest-prompt-title"
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
className="safe-bottom relative w-full max-w-sm rounded-t-3xl border border-line bg-surface p-6 sm:rounded-3xl"
|
||||
>
|
||||
<button onClick={onClose} className="absolute end-3 top-3 grid size-9 place-items-center rounded-full text-ink-3" aria-label={t('common.close')}>
|
||||
<X size={18} />
|
||||
</button>
|
||||
<p className="text-2xl font-bold">
|
||||
Azuu<span className="text-accent">Cine</span>
|
||||
</p>
|
||||
<h2 id="guest-prompt-title" className="mt-3 text-lg font-semibold">
|
||||
{t('guest.promptTitle')}
|
||||
</h2>
|
||||
<p className="mt-1.5 text-sm leading-relaxed text-ink-2">{t('guest.promptText')}</p>
|
||||
<div className="mt-6 space-y-2">
|
||||
<button onClick={onSignUp} className="btn btn-primary w-full py-3">
|
||||
{t('auth.signupTab')}
|
||||
</button>
|
||||
<button onClick={onSignIn} className="btn btn-ghost w-full py-3">
|
||||
{t('auth.loginTab')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
/** Bandeau discret en haut de l'app en mode découverte. */
|
||||
export function GuestBanner({ onSignIn }: { onSignIn: () => void }) {
|
||||
return (
|
||||
<div className="safe-top border-b border-line bg-surface lg:ps-60">
|
||||
<div className="mx-auto flex max-w-2xl items-center gap-3 px-4 py-2 lg:max-w-none lg:px-10">
|
||||
<p className="min-w-0 flex-1 truncate text-xs text-ink-2">{t('guest.banner')}</p>
|
||||
<button onClick={onSignIn} className="shrink-0 rounded-full bg-accent-fill px-3 py-1.5 text-xs font-semibold text-on-accent">
|
||||
{t('auth.loginTab')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import { canonicalGenre, canonicalSubtype, genreLabel, genreSuggestions as defau
|
||||
import { fileToPosterDataURL } from '../../lib/image'
|
||||
import { useScrollLock } from '../../lib/scrollLock'
|
||||
import { cx } from '../../lib/utils'
|
||||
import { useMedia } from '../../store'
|
||||
import { GuestError, useMedia } from '../../store'
|
||||
import type { MediaInput, MediaItem } from '../../types'
|
||||
import Poster from '../Poster'
|
||||
import TagInput from '../TagInput'
|
||||
@@ -101,7 +101,7 @@ export default function EditDetails({
|
||||
onCreated?.(created)
|
||||
}
|
||||
} catch (e) {
|
||||
setSaveError((e as Error).message)
|
||||
if (!(e instanceof GuestError)) setSaveError((e as Error).message)
|
||||
} finally {
|
||||
setSaving(false)
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import { useScrollLock } from '../../lib/scrollLock'
|
||||
import { backdropSrcSet, tmdbSized } from '../../lib/tmdbImage'
|
||||
import { renderItemCard, slug } from '../../lib/shareCard'
|
||||
import { cx, formatDate, formatDuration, formatRating, todayISO } from '../../lib/utils'
|
||||
import { useMedia } from '../../store'
|
||||
import { GuestError, useMedia } from '../../store'
|
||||
import { allTags, cleanTag } from '../../lib/bulk'
|
||||
import { useLibraryActions } from '../library/useLibraryActions'
|
||||
import TagInput from '../TagInput'
|
||||
@@ -171,7 +171,8 @@ export default function TitleSheet({ item: initial, seed, onClose, onGoToSetting
|
||||
pendingRef.current = {}
|
||||
if (Object.keys(pending).length) await update(created.id, pending)
|
||||
} catch (e) {
|
||||
setToast((e as Error).message)
|
||||
// Mode découverte : la demande de compte est déjà ouverte
|
||||
if (!(e instanceof GuestError)) setToast((e as Error).message)
|
||||
} finally {
|
||||
addingRef.current = false
|
||||
setBusy(false)
|
||||
|
||||
Reference in new issue
Block a user