This commit is contained in:
Romain committed 2026-10-03 11:54:27 +02:00
1 parent 129c3dd164
commit fcc9670f29
10 files changed
+28 -4

No files matched your search

+19 -4
View File
@@ -1,5 +1,5 @@
import { locale, t } from '../i18n'
import { Check, Heart, ImagePlus, Loader2, Minus, Plus, Share2, Trash2, X } from 'lucide-react'
import { Check, ChevronDown, Heart, ImagePlus, Loader2, Minus, Plus, Share2, Trash2, X } from 'lucide-react'
import { useEffect, useMemo, useRef, useState, type ReactNode } from 'react'
import { CRITERIA, DEFAULT_FILM_MINUTES, MEDIA_TYPES, platformSuggestions as defaultPlatforms, STATUSES, TYPE_BY_VALUE } from '../lib/constants'
import { canonicalGenre, canonicalSubtype, genreLabel, genreSuggestions as defaultGenres, subtypeLabel, subtypeSuggestions } from '../lib/genres'
@@ -48,7 +48,7 @@ const METADATA_KEYS = [
function Section({ title, children }: { title: string; children: ReactNode }) {
return (
<section className="space-y-3">
<h3 className="eyebrow text-ink-2">{title}</h3>
{title && <h3 className="eyebrow text-ink-2">{title}</h3>}
{children}
</section>
)
@@ -140,6 +140,7 @@ export default function MediaForm({ item, onClose, onGoToSettings }: Props) {
const [filledFrom, setFilledFrom] = useState<string>()
const [posterError, setPosterError] = useState<string>()
const fileRef = useRef<HTMLInputElement>(null)
const [showInfo, setShowInfo] = useState(false)
const typeInfo = TYPE_BY_VALUE[form.type]
// Bloque le défilement de la page derrière la feuille
@@ -445,8 +446,21 @@ export default function MediaForm({ item, onClose, onGoToSettings }: Props) {
</Section>
)}
{/* Infos */}
<Section title={t('form.info')}>
{/* Infos : repliées par défaut (dates remplies selon le statut, année et genres par la recherche) */}
<button
type="button"
onClick={() => setShowInfo((v) => !v)}
aria-expanded={showInfo}
className="flex w-full items-center justify-between border-t border-line pt-5 text-left"
>
<span>
<span className="eyebrow block text-ink-2">{t('form.info')}</span>
<span className="mt-1 block text-xs text-ink-3">{t('form.infoHint')}</span>
</span>
<ChevronDown size={18} className={cx('shrink-0 text-ink-3 transition-transform', showInfo && 'rotate-180')} />
</button>
{showInfo && (
<Section title="">
<div className="grid grid-cols-2 gap-3">
<Field label={t('form.start')}>
<input className="field" type="date" value={form.startDate ?? ''} onChange={(e) => set('startDate', e.target.value || undefined)} />
@@ -478,6 +492,7 @@ export default function MediaForm({ item, onClose, onGoToSettings }: Props) {
/>
</div>
</Section>
)}
{(form.status === 'termine' || (form.rewatchDates?.length ?? 0) > 0) && (
<Section title={t('form.rewatches')}>
+1
View File
@@ -760,6 +760,7 @@ const dict: Translations = {
'welcome.later': "Später",
'social.watching': "Schaut gerade",
'social.watchlist': "Möchte sehen",
'form.infoHint': "Daten, Jahr, Plattform und Genres – werden automatisch ausgefüllt",
}
export default dict
+1
View File
@@ -760,6 +760,7 @@ const dict: Translations = {
'welcome.later': "Later",
'social.watching': "Watching",
'social.watchlist': "Wants to watch",
'form.infoHint': "Dates, year, platform and genres — filled in automatically",
}
export default dict
+1
View File
@@ -760,6 +760,7 @@ const dict: Translations = {
'welcome.later': "Más tarde",
'social.watching': "Viendo",
'social.watchlist': "Quiere ver",
'form.infoHint': "Fechas, año, plataforma y géneros — se rellenan solos",
}
export default dict
+1
View File
@@ -762,6 +762,7 @@ const dict = {
'welcome.later': "Plus tard",
'social.watching': "En cours",
'social.watchlist': "Envie de voir",
'form.infoHint': "Dates, année, plateforme et genres — remplis automatiquement",
}
export default dict
+1
View File
@@ -760,6 +760,7 @@ const dict: Translations = {
'welcome.later': "Più tardi",
'social.watching': "In corso",
'social.watchlist': "Vuole vedere",
'form.infoHint': "Date, anno, piattaforma e generi — compilati automaticamente",
}
export default dict
+1
View File
@@ -760,6 +760,7 @@ const dict: Translations = {
'welcome.later': "あとで",
'social.watching': "視聴中",
'social.watchlist': "見たい",
'form.infoHint': "日付・年・配信サービス・ジャンル — 自動で入力されます",
}
export default dict
+1
View File
@@ -760,6 +760,7 @@ const dict: Translations = {
'welcome.later': "나중에",
'social.watching': "보는 중",
'social.watchlist': "보고 싶어요",
'form.infoHint': "날짜, 연도, 플랫폼, 장르 — 자동으로 채워져요",
}
export default dict
+1
View File
@@ -760,6 +760,7 @@ const dict: Translations = {
'welcome.later': "Depois",
'social.watching': "Assistindo",
'social.watchlist': "Quer assistir",
'form.infoHint': "Datas, ano, plataforma e gêneros — preenchidos automaticamente",
}
export default dict
+1
View File
@@ -760,6 +760,7 @@ const dict: Translations = {
'welcome.later': "稍后",
'social.watching': "正在看",
'social.watchlist': "想看",
'form.infoHint': "日期、年份、平台和类型——自动填写",
}
export default dict