Modif
This commit is contained in:
1 parent
129c3dd164
commit
fcc9670f29
10 files changed
+28
-4
No files matched your search
@@ -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, ChevronDown, Heart, ImagePlus, Loader2, 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, platformSuggestions as defaultPlatforms, STATUSES, TYPE_BY_VALUE } from '../lib/constants'
|
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'
|
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 }) {
|
function Section({ title, children }: { title: string; children: ReactNode }) {
|
||||||
return (
|
return (
|
||||||
<section className="space-y-3">
|
<section className="space-y-3">
|
||||||
<h3 className="eyebrow text-ink-2">{title}</h3>
|
{title && <h3 className="eyebrow text-ink-2">{title}</h3>}
|
||||||
{children}
|
{children}
|
||||||
</section>
|
</section>
|
||||||
)
|
)
|
||||||
@@ -140,6 +140,7 @@ export default function MediaForm({ item, onClose, onGoToSettings }: Props) {
|
|||||||
const [filledFrom, setFilledFrom] = useState<string>()
|
const [filledFrom, setFilledFrom] = useState<string>()
|
||||||
const [posterError, setPosterError] = useState<string>()
|
const [posterError, setPosterError] = useState<string>()
|
||||||
const fileRef = useRef<HTMLInputElement>(null)
|
const fileRef = useRef<HTMLInputElement>(null)
|
||||||
|
const [showInfo, setShowInfo] = useState(false)
|
||||||
const typeInfo = TYPE_BY_VALUE[form.type]
|
const typeInfo = TYPE_BY_VALUE[form.type]
|
||||||
|
|
||||||
// Bloque le défilement de la page derrière la feuille
|
// Bloque le défilement de la page derrière la feuille
|
||||||
@@ -445,8 +446,21 @@ export default function MediaForm({ item, onClose, onGoToSettings }: Props) {
|
|||||||
</Section>
|
</Section>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Infos */}
|
{/* Infos : repliées par défaut (dates remplies selon le statut, année et genres par la recherche) */}
|
||||||
<Section title={t('form.info')}>
|
<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">
|
<div className="grid grid-cols-2 gap-3">
|
||||||
<Field label={t('form.start')}>
|
<Field label={t('form.start')}>
|
||||||
<input className="field" type="date" value={form.startDate ?? ''} onChange={(e) => set('startDate', e.target.value || undefined)} />
|
<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>
|
</div>
|
||||||
</Section>
|
</Section>
|
||||||
|
)}
|
||||||
|
|
||||||
{(form.status === 'termine' || (form.rewatchDates?.length ?? 0) > 0) && (
|
{(form.status === 'termine' || (form.rewatchDates?.length ?? 0) > 0) && (
|
||||||
<Section title={t('form.rewatches')}>
|
<Section title={t('form.rewatches')}>
|
||||||
|
|||||||
@@ -760,6 +760,7 @@ const dict: Translations = {
|
|||||||
'welcome.later': "Später",
|
'welcome.later': "Später",
|
||||||
'social.watching': "Schaut gerade",
|
'social.watching': "Schaut gerade",
|
||||||
'social.watchlist': "Möchte sehen",
|
'social.watchlist': "Möchte sehen",
|
||||||
|
'form.infoHint': "Daten, Jahr, Plattform und Genres – werden automatisch ausgefüllt",
|
||||||
}
|
}
|
||||||
|
|
||||||
export default dict
|
export default dict
|
||||||
@@ -760,6 +760,7 @@ const dict: Translations = {
|
|||||||
'welcome.later': "Later",
|
'welcome.later': "Later",
|
||||||
'social.watching': "Watching",
|
'social.watching': "Watching",
|
||||||
'social.watchlist': "Wants to watch",
|
'social.watchlist': "Wants to watch",
|
||||||
|
'form.infoHint': "Dates, year, platform and genres — filled in automatically",
|
||||||
}
|
}
|
||||||
|
|
||||||
export default dict
|
export default dict
|
||||||
@@ -760,6 +760,7 @@ const dict: Translations = {
|
|||||||
'welcome.later': "Más tarde",
|
'welcome.later': "Más tarde",
|
||||||
'social.watching': "Viendo",
|
'social.watching': "Viendo",
|
||||||
'social.watchlist': "Quiere ver",
|
'social.watchlist': "Quiere ver",
|
||||||
|
'form.infoHint': "Fechas, año, plataforma y géneros — se rellenan solos",
|
||||||
}
|
}
|
||||||
|
|
||||||
export default dict
|
export default dict
|
||||||
@@ -762,6 +762,7 @@ const dict = {
|
|||||||
'welcome.later': "Plus tard",
|
'welcome.later': "Plus tard",
|
||||||
'social.watching': "En cours",
|
'social.watching': "En cours",
|
||||||
'social.watchlist': "Envie de voir",
|
'social.watchlist': "Envie de voir",
|
||||||
|
'form.infoHint': "Dates, année, plateforme et genres — remplis automatiquement",
|
||||||
}
|
}
|
||||||
|
|
||||||
export default dict
|
export default dict
|
||||||
@@ -760,6 +760,7 @@ const dict: Translations = {
|
|||||||
'welcome.later': "Più tardi",
|
'welcome.later': "Più tardi",
|
||||||
'social.watching': "In corso",
|
'social.watching': "In corso",
|
||||||
'social.watchlist': "Vuole vedere",
|
'social.watchlist': "Vuole vedere",
|
||||||
|
'form.infoHint': "Date, anno, piattaforma e generi — compilati automaticamente",
|
||||||
}
|
}
|
||||||
|
|
||||||
export default dict
|
export default dict
|
||||||
@@ -760,6 +760,7 @@ const dict: Translations = {
|
|||||||
'welcome.later': "あとで",
|
'welcome.later': "あとで",
|
||||||
'social.watching': "視聴中",
|
'social.watching': "視聴中",
|
||||||
'social.watchlist': "見たい",
|
'social.watchlist': "見たい",
|
||||||
|
'form.infoHint': "日付・年・配信サービス・ジャンル — 自動で入力されます",
|
||||||
}
|
}
|
||||||
|
|
||||||
export default dict
|
export default dict
|
||||||
@@ -760,6 +760,7 @@ const dict: Translations = {
|
|||||||
'welcome.later': "나중에",
|
'welcome.later': "나중에",
|
||||||
'social.watching': "보는 중",
|
'social.watching': "보는 중",
|
||||||
'social.watchlist': "보고 싶어요",
|
'social.watchlist': "보고 싶어요",
|
||||||
|
'form.infoHint': "날짜, 연도, 플랫폼, 장르 — 자동으로 채워져요",
|
||||||
}
|
}
|
||||||
|
|
||||||
export default dict
|
export default dict
|
||||||
@@ -760,6 +760,7 @@ const dict: Translations = {
|
|||||||
'welcome.later': "Depois",
|
'welcome.later': "Depois",
|
||||||
'social.watching': "Assistindo",
|
'social.watching': "Assistindo",
|
||||||
'social.watchlist': "Quer assistir",
|
'social.watchlist': "Quer assistir",
|
||||||
|
'form.infoHint': "Datas, ano, plataforma e gêneros — preenchidos automaticamente",
|
||||||
}
|
}
|
||||||
|
|
||||||
export default dict
|
export default dict
|
||||||
@@ -760,6 +760,7 @@ const dict: Translations = {
|
|||||||
'welcome.later': "稍后",
|
'welcome.later': "稍后",
|
||||||
'social.watching': "正在看",
|
'social.watching': "正在看",
|
||||||
'social.watchlist': "想看",
|
'social.watchlist': "想看",
|
||||||
|
'form.infoHint': "日期、年份、平台和类型——自动填写",
|
||||||
}
|
}
|
||||||
|
|
||||||
export default dict
|
export default dict
|
||||||
Reference in new issue
Block a user