La fenêtre du profil restait au format téléphone sur ordinateur. Sheet accepte une option « wide » (pleine largeur à partir de lg) ; le profil l'utilise : bannière en plein bord, infos alignées à gauche, grilles d'affiches (Top 5, en cours, récents, à voir, bibliothèque) de 8 à 10 colonnes et statistiques sur 4 colonnes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVo1qxKoBQCaMd7Ue8PGbe
This commit is contained in:
2 files changed
+16
-15
No files matched your search
@@ -145,6 +145,7 @@ export default function ProfileView({ username, onClose }: { username: string; o
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Sheet
|
<Sheet
|
||||||
|
wide
|
||||||
label={t('social.profile')}
|
label={t('social.profile')}
|
||||||
title={profile ? `@${profile.username}` : ''}
|
title={profile ? `@${profile.username}` : ''}
|
||||||
onClose={onClose}
|
onClose={onClose}
|
||||||
@@ -167,11 +168,11 @@ export default function ProfileView({ username, onClose }: { username: string; o
|
|||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
{/* Bannière + photo */}
|
{/* Bannière + photo */}
|
||||||
<div className="relative aspect-[3/1] w-full overflow-hidden bg-surface-2">
|
<div className={cx('relative aspect-[3/1] w-full overflow-hidden bg-surface-2 lg:aspect-auto', profile.bannerUrl ? 'lg:h-[min(40vh,22rem)]' : 'lg:h-40')}>
|
||||||
{profile.bannerUrl && <img src={profile.bannerUrl} alt="" className="size-full object-cover" />}
|
{profile.bannerUrl && <img src={profile.bannerUrl} alt="" className="size-full object-cover" />}
|
||||||
</div>
|
</div>
|
||||||
<div className="px-4">
|
<div className="px-4 lg:px-10">
|
||||||
<div className="relative -mt-11 flex items-end justify-between gap-3">
|
<div className="relative -mt-11 flex items-end justify-between gap-3 lg:-mt-14">
|
||||||
<Avatar url={profile.avatarUrl} name={profile.displayName} size={88} className="border-4 border-bg" />
|
<Avatar url={profile.avatarUrl} name={profile.displayName} size={88} className="border-4 border-bg" />
|
||||||
{profile.isMe ? (
|
{profile.isMe ? (
|
||||||
<button onClick={social.openEdit} className="btn btn-ghost mb-1 px-4 py-2 text-sm">
|
<button onClick={social.openEdit} className="btn btn-ghost mb-1 px-4 py-2 text-sm">
|
||||||
@@ -211,9 +212,9 @@ export default function ProfileView({ username, onClose }: { username: string; o
|
|||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</p>
|
</p>
|
||||||
{profile.bio && <p className="mt-3 whitespace-pre-line text-sm leading-relaxed text-ink-2">{profile.bio}</p>}
|
{profile.bio && <p className="mt-3 whitespace-pre-line text-sm leading-relaxed text-ink-2 lg:max-w-3xl lg:text-base">{profile.bio}</p>}
|
||||||
|
|
||||||
<div className="mt-5 flex divide-x divide-line rounded-2xl border border-line py-3">
|
<div className="mt-5 flex divide-x divide-line rounded-2xl border border-line py-3 lg:max-w-2xl">
|
||||||
<Stat value={profile.visible ? (profile.stats?.finished ?? 0) : undefined} label={t('social.seen')} />
|
<Stat value={profile.visible ? (profile.stats?.finished ?? 0) : undefined} label={t('social.seen')} />
|
||||||
<Stat value={profile.followers} label={t('social.followers', { count: profile.followers })} onClick={profile.visible ? () => social.openFollowList(profile, 'followers') : undefined} />
|
<Stat value={profile.followers} label={t('social.followers', { count: profile.followers })} onClick={profile.visible ? () => social.openFollowList(profile, 'followers') : undefined} />
|
||||||
<Stat value={profile.following} label={t('social.followingCount', { count: profile.following })} onClick={profile.visible ? () => social.openFollowList(profile, 'following') : undefined} />
|
<Stat value={profile.following} label={t('social.followingCount', { count: profile.following })} onClick={profile.visible ? () => social.openFollowList(profile, 'following') : undefined} />
|
||||||
@@ -234,7 +235,7 @@ export default function ProfileView({ username, onClose }: { username: string; o
|
|||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<div className="mt-6 grid grid-cols-2 gap-1 rounded-full border border-line p-1">
|
<div className="mt-6 grid grid-cols-2 gap-1 rounded-full border border-line p-1 lg:max-w-md">
|
||||||
{(['profile', 'library'] as const).map((v) => (
|
{(['profile', 'library'] as const).map((v) => (
|
||||||
<button
|
<button
|
||||||
key={v}
|
key={v}
|
||||||
@@ -282,7 +283,7 @@ function ProfileTab({ profile, topByCategory, onOpen }: { profile: Profile; topB
|
|||||||
<SectionTitle>
|
<SectionTitle>
|
||||||
{t('social.top5')} · {c.label}
|
{t('social.top5')} · {c.label}
|
||||||
</SectionTitle>
|
</SectionTitle>
|
||||||
<div className="grid grid-cols-5 gap-2">
|
<div className="grid grid-cols-5 gap-2 lg:grid-cols-8 lg:gap-3 xl:grid-cols-10">
|
||||||
{c.items.map((item) => (
|
{c.items.map((item) => (
|
||||||
<div key={item.id} className="relative">
|
<div key={item.id} className="relative">
|
||||||
<PosterTile item={item} onOpen={() => onOpen(item)} />
|
<PosterTile item={item} onOpen={() => onOpen(item)} />
|
||||||
@@ -296,7 +297,7 @@ function ProfileTab({ profile, topByCategory, onOpen }: { profile: Profile; topB
|
|||||||
{profile.watching.length > 0 && (
|
{profile.watching.length > 0 && (
|
||||||
<>
|
<>
|
||||||
<SectionTitle>{t('social.watching')}</SectionTitle>
|
<SectionTitle>{t('social.watching')}</SectionTitle>
|
||||||
<div className="grid grid-cols-4 gap-2.5">
|
<div className="grid grid-cols-4 gap-2.5 sm:grid-cols-5 lg:grid-cols-8 lg:gap-3 xl:grid-cols-10">
|
||||||
{profile.watching.map((item) => (
|
{profile.watching.map((item) => (
|
||||||
<PosterTile key={item.id} item={item} onOpen={() => onOpen(item)} />
|
<PosterTile key={item.id} item={item} onOpen={() => onOpen(item)} />
|
||||||
))}
|
))}
|
||||||
@@ -306,7 +307,7 @@ function ProfileTab({ profile, topByCategory, onOpen }: { profile: Profile; topB
|
|||||||
|
|
||||||
<SectionTitle>{t('social.recent')}</SectionTitle>
|
<SectionTitle>{t('social.recent')}</SectionTitle>
|
||||||
{profile.recent.length ? (
|
{profile.recent.length ? (
|
||||||
<div className="grid grid-cols-4 gap-2.5">
|
<div className="grid grid-cols-4 gap-2.5 sm:grid-cols-5 lg:grid-cols-8 lg:gap-3 xl:grid-cols-10">
|
||||||
{profile.recent.map((item) => (
|
{profile.recent.map((item) => (
|
||||||
<PosterTile key={item.id} item={item} onOpen={() => onOpen(item)} />
|
<PosterTile key={item.id} item={item} onOpen={() => onOpen(item)} />
|
||||||
))}
|
))}
|
||||||
@@ -318,7 +319,7 @@ function ProfileTab({ profile, topByCategory, onOpen }: { profile: Profile; topB
|
|||||||
{profile.watchlist.length > 0 && (
|
{profile.watchlist.length > 0 && (
|
||||||
<>
|
<>
|
||||||
<SectionTitle>{t('social.watchlist')}</SectionTitle>
|
<SectionTitle>{t('social.watchlist')}</SectionTitle>
|
||||||
<div className="grid grid-cols-4 gap-2.5">
|
<div className="grid grid-cols-4 gap-2.5 sm:grid-cols-5 lg:grid-cols-8 lg:gap-3 xl:grid-cols-10">
|
||||||
{profile.watchlist.map((item) => (
|
{profile.watchlist.map((item) => (
|
||||||
<PosterTile key={item.id} item={item} onOpen={() => onOpen(item)} />
|
<PosterTile key={item.id} item={item} onOpen={() => onOpen(item)} />
|
||||||
))}
|
))}
|
||||||
@@ -329,7 +330,7 @@ function ProfileTab({ profile, topByCategory, onOpen }: { profile: Profile; topB
|
|||||||
{s && (
|
{s && (
|
||||||
<>
|
<>
|
||||||
<SectionTitle>{t('nav.stats')}</SectionTitle>
|
<SectionTitle>{t('nav.stats')}</SectionTitle>
|
||||||
<div className="grid grid-cols-2 gap-3">
|
<div className="grid grid-cols-2 gap-3 lg:grid-cols-4">
|
||||||
{[
|
{[
|
||||||
[s.finishedYear, t('social.statYear')],
|
[s.finishedYear, t('social.statYear')],
|
||||||
[s.films, t('social.statFilms')],
|
[s.films, t('social.statFilms')],
|
||||||
@@ -395,7 +396,7 @@ function LibraryTab({ profile, onOpen }: { profile: Profile; onOpen: (i: MediaIt
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
{list.length ? (
|
{list.length ? (
|
||||||
<div className="grid grid-cols-3 gap-3 sm:grid-cols-4">
|
<div className="grid grid-cols-3 gap-3 sm:grid-cols-4 lg:grid-cols-6 xl:grid-cols-8 2xl:grid-cols-10">
|
||||||
{list.map((item) => (
|
{list.map((item) => (
|
||||||
<PosterTile key={item.id} item={item} onOpen={() => onOpen(item)} />
|
<PosterTile key={item.id} item={item} onOpen={() => onOpen(item)} />
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -7,14 +7,14 @@ import { useEscape } from '../../lib/escape'
|
|||||||
import { cx } from '../../lib/utils'
|
import { cx } from '../../lib/utils'
|
||||||
|
|
||||||
/** Écran plein (profil, recherche…) avec en-tête et bouton fermer. */
|
/** Écran plein (profil, recherche…) avec en-tête et bouton fermer. */
|
||||||
export default function Sheet({ title, onClose, right, children, label, elevated }: { title: ReactNode; onClose: () => void; right?: ReactNode; children: ReactNode; label: string; elevated?: boolean }) {
|
export default function Sheet({ title, onClose, right, children, label, elevated, wide }: { title: ReactNode; onClose: () => void; right?: ReactNode; children: ReactNode; label: string; elevated?: boolean; /** Pleine largeur sur ordinateur (profil) */ wide?: boolean }) {
|
||||||
useScrollLock()
|
useScrollLock()
|
||||||
useEscape(onClose)
|
useEscape(onClose)
|
||||||
useBackToClose(onClose)
|
useBackToClose(onClose)
|
||||||
return (
|
return (
|
||||||
<div className={cx('sheet sheet-in', elevated && 'z-[70]')} role="dialog" aria-modal="true" aria-label={label}>
|
<div className={cx('sheet sheet-in', elevated && 'z-[70]')} role="dialog" aria-modal="true" aria-label={label}>
|
||||||
<header className="safe-top border-b border-line">
|
<header className="safe-top border-b border-line">
|
||||||
<div className="mx-auto flex max-w-2xl items-center gap-2 px-3 py-2.5">
|
<div className={cx('mx-auto flex max-w-2xl items-center gap-2 px-3 py-2.5', wide && 'lg:max-w-none lg:px-8')}>
|
||||||
<button onClick={onClose} className="grid size-10 place-items-center rounded-full text-ink-2" aria-label={t('common.close')}>
|
<button onClick={onClose} className="grid size-10 place-items-center rounded-full text-ink-2" aria-label={t('common.close')}>
|
||||||
<X size={22} />
|
<X size={22} />
|
||||||
</button>
|
</button>
|
||||||
@@ -23,7 +23,7 @@ export default function Sheet({ title, onClose, right, children, label, elevated
|
|||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
<div className="sheet-scroll">
|
<div className="sheet-scroll">
|
||||||
<div className="mx-auto max-w-2xl pb-[calc(6rem+env(safe-area-inset-bottom))]">{children}</div>
|
<div className={cx('mx-auto max-w-2xl pb-[calc(6rem+env(safe-area-inset-bottom))]', wide && 'lg:max-w-none')}>{children}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in new issue
Block a user