feat(ui): glass layout, icon actions and new icon set (#21)
CD — Deployment / deploy (push) Successful in 33s
CD — Deployment / deploy (push) Successful in 33s
PR automatique de feat/ui-glass-layout-icons vers main. --------- Co-authored-by: xEsiah <[email protected]> Reviewed-on: #21 Reviewed-by: Esiah <[email protected]> Co-authored-by: Gitea Actions <-[email protected]>
This commit was merged in pull request #21.
This commit is contained in:
@@ -129,13 +129,11 @@ export const AdminUsers = () => {
|
||||
title={t("Comptes")}
|
||||
description={t("Créer des membres, ajustez leurs quotas et gérez les accès.")}
|
||||
actions={
|
||||
<Button
|
||||
size="sm"
|
||||
iconLeading={<PlusIcon className="h-3.5 w-3.5" />}
|
||||
<IconAction
|
||||
label={t("Nouveau membre")}
|
||||
icon={<PlusIcon className="h-4 w-4" />}
|
||||
onClick={() => setCreateOpen(true)}
|
||||
>
|
||||
{t("Nouveau membre")}
|
||||
</Button>
|
||||
/>
|
||||
}
|
||||
toolbar={
|
||||
<>
|
||||
@@ -210,18 +208,20 @@ export const AdminUsers = () => {
|
||||
</span>
|
||||
|
||||
<div className="flex items-center gap-1">
|
||||
<Button variant="ghost" size="sm" onClick={() => setEdit(user)}>
|
||||
{t("Modifier")}
|
||||
</Button>
|
||||
<IconAction
|
||||
label={t("Modifier")}
|
||||
icon={<img src="/icons/edit-pencil.png" alt="" className="h-4 w-4 object-contain" />}
|
||||
onClick={() => setEdit(user)}
|
||||
/>
|
||||
<IconAction
|
||||
label={user.is_active ? t("Désactiver") : t("Réactiver")}
|
||||
icon={<HardDriveIcon className="h-4 w-4" />}
|
||||
icon={<img src="/icons/deactivate.png" alt="" className="h-4 w-4 object-contain" />}
|
||||
isLoading={busy === user.id}
|
||||
onClick={() => void toggleActive(user)}
|
||||
/>
|
||||
<IconAction
|
||||
label={t("Réinitialiser le mot de passe")}
|
||||
icon={<ActivityIcon className="h-4 w-4" />}
|
||||
icon={<img src="/icons/password-reset.png" alt="" className="h-4 w-4 object-contain" />}
|
||||
isLoading={busy === user.id}
|
||||
onClick={() => void resetPassword(user)}
|
||||
/>
|
||||
@@ -505,13 +505,11 @@ export const AdminStorage = () => {
|
||||
title={t("Emplacements de stockage")}
|
||||
description={t("Volumes montés utilisés pour stocker les fichiers.")}
|
||||
actions={
|
||||
<Button
|
||||
size="sm"
|
||||
iconLeading={<PlusIcon className="h-3.5 w-3.5" />}
|
||||
<IconAction
|
||||
label={t("Nouvel emplacement")}
|
||||
icon={<PlusIcon className="h-4 w-4" />}
|
||||
onClick={() => setCreateOpen(true)}
|
||||
>
|
||||
{t("Nouvel emplacement")}
|
||||
</Button>
|
||||
/>
|
||||
}
|
||||
/>
|
||||
|
||||
@@ -544,9 +542,11 @@ export const AdminStorage = () => {
|
||||
: t("{used} Go utilisés", { used: toGb(location.used_bytes) })}
|
||||
</span>
|
||||
</span>
|
||||
<Button variant="ghost" size="sm" onClick={() => void toggle(location)}>
|
||||
{location.is_active ? t("Désactiver") : t("Réactiver")}
|
||||
</Button>
|
||||
<IconAction
|
||||
label={location.is_active ? t("Désactiver") : t("Réactiver")}
|
||||
icon={<img src={location.is_active ? "/icons/close.png" : "/icons/synchronize.png"} alt="" className="h-4 w-4 object-contain" />}
|
||||
onClick={() => void toggle(location)}
|
||||
/>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
useState,
|
||||
type DragEvent,
|
||||
} from "react";
|
||||
import { Button, Card, Spinner, cn } from "../ui/index.js";
|
||||
import { Card, Spinner, cn } from "../ui/index.js";
|
||||
import {
|
||||
ApiError,
|
||||
api,
|
||||
@@ -17,7 +17,7 @@ import { useSession } from "../lib/session.js";
|
||||
import { useI18n } from "../lib/i18n.js";
|
||||
import { getLocale } from "../lib/locale.js";
|
||||
import { mediaKind } from "../lib/media.js";
|
||||
import { Badge, EmptyState, PageHeader } from "../components/feedback.js";
|
||||
import { EmptyState, PageHeader } from "../components/feedback.js";
|
||||
import { useConfirm } from "../components/confirm.js";
|
||||
import { MediaViewer } from "../components/MediaViewer.js";
|
||||
import { MediaThumb } from "../components/MediaThumb.js";
|
||||
@@ -33,8 +33,8 @@ import {
|
||||
import {
|
||||
ArrowLeftIcon,
|
||||
ChatIcon,
|
||||
CloseIcon,
|
||||
DownloadIcon,
|
||||
FolderIcon,
|
||||
PenIcon,
|
||||
PlusIcon,
|
||||
RefreshIcon,
|
||||
@@ -538,32 +538,22 @@ export const Browser = () => {
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
<Button
|
||||
variant="secondary"
|
||||
size="sm"
|
||||
iconLeading={<RefreshIcon className="h-3.5 w-3.5" />}
|
||||
<IconAction
|
||||
label={t("Rafraîchir")}
|
||||
icon={<RefreshIcon className="h-4 w-4" />}
|
||||
isLoading={refreshing}
|
||||
onClick={() => void manualRefresh()}
|
||||
>
|
||||
{t("Rafraîchir")}
|
||||
</Button>
|
||||
/>
|
||||
|
||||
{current.id ? (
|
||||
<Button
|
||||
variant="secondary"
|
||||
size="sm"
|
||||
iconLeading={<ChatIcon className="h-3.5 w-3.5" />}
|
||||
<IconAction
|
||||
label={t("Discussion")}
|
||||
icon={<ChatIcon className="h-4 w-4" />}
|
||||
badge={currentUnread}
|
||||
onClick={() =>
|
||||
setChat({ id: current.id as string, name: current.name })
|
||||
}
|
||||
>
|
||||
<span className="inline-flex items-center gap-2">
|
||||
{t("Discussion")}
|
||||
{currentUnread > 0 ? (
|
||||
<Badge tone="accent">{currentUnread}</Badge>
|
||||
) : null}
|
||||
</span>
|
||||
</Button>
|
||||
/>
|
||||
) : null}
|
||||
</div>
|
||||
}
|
||||
@@ -619,7 +609,7 @@ export const Browser = () => {
|
||||
) : null}
|
||||
|
||||
{canWrite ? (
|
||||
<div className="flex gap-2">
|
||||
<div className="flex gap-1">
|
||||
<input
|
||||
ref={fileInputRef}
|
||||
type="file"
|
||||
@@ -627,25 +617,17 @@ export const Browser = () => {
|
||||
className="sr-only"
|
||||
onChange={(event) => void upload(event.target.files)}
|
||||
/>
|
||||
<Button
|
||||
variant="secondary"
|
||||
size="sm"
|
||||
iconLeading={<UploadIcon className="h-3.5 w-3.5" />}
|
||||
<IconAction
|
||||
label={uploading && uploadProgress ? t("Envoi {current}/{total}…", uploadProgress) : t("Envoyer")}
|
||||
icon={<UploadIcon className="h-4 w-4" />}
|
||||
isLoading={uploading}
|
||||
onClick={() => fileInputRef.current?.click()}
|
||||
>
|
||||
{uploading && uploadProgress
|
||||
? t("Envoi {current}/{total}…", uploadProgress)
|
||||
: t("Envoyer")}
|
||||
</Button>
|
||||
<Button
|
||||
variant="secondary"
|
||||
size="sm"
|
||||
iconLeading={<PlusIcon className="h-3.5 w-3.5" />}
|
||||
/>
|
||||
<IconAction
|
||||
label={t("Nouveau dossier")}
|
||||
icon={<PlusIcon className="h-4 w-4" />}
|
||||
onClick={() => setDialog({ kind: "create" })}
|
||||
>
|
||||
{t("Nouveau dossier")}
|
||||
</Button>
|
||||
/>
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
@@ -681,25 +663,21 @@ export const Browser = () => {
|
||||
|
||||
{canWrite && selectedItems.length > 0 ? (
|
||||
<div className="fixed bottom-3 left-1/2 z-40 w-[calc(100%-1rem)] max-w-xl -translate-x-1/2 px-1 sm:bottom-4 sm:w-auto">
|
||||
<div className="flex flex-col items-center justify-center gap-2 rounded-lg border border-border-strong bg-surface px-3 py-2 shadow-lg sm:flex-row sm:flex-wrap sm:items-center sm:justify-center">
|
||||
<div className="flex flex-col items-center justify-center gap-2 rounded-lg border border-border-strong bg-surface/80 px-3 py-2 shadow-lg backdrop-blur-md sm:flex-row sm:flex-wrap sm:items-center sm:justify-center">
|
||||
<p className="text-center text-sm font-medium text-foreground">
|
||||
{t("{count} élément(s) sélectionné(s).", {
|
||||
count: selectedItems.length,
|
||||
})}
|
||||
</p>
|
||||
<div className="flex flex-wrap items-center justify-center gap-2">
|
||||
<Button
|
||||
size="sm"
|
||||
variant="secondary"
|
||||
onClick={() =>
|
||||
setDialog({ kind: "moveMany", targets: selectedItems })
|
||||
}
|
||||
>
|
||||
{t("Déplacer")}
|
||||
</Button>
|
||||
<Button
|
||||
size="sm"
|
||||
variant="secondary"
|
||||
<div className="flex flex-wrap items-center justify-center gap-1">
|
||||
<IconAction
|
||||
label={t("Déplacer")}
|
||||
icon={<img src="/icons/move.png" alt="" className="h-4 w-4 object-contain" />}
|
||||
onClick={() => setDialog({ kind: "moveMany", targets: selectedItems })}
|
||||
/>
|
||||
<IconAction
|
||||
label={t("Télécharger")}
|
||||
icon={<DownloadIcon className="h-4 w-4" />}
|
||||
onClick={() => {
|
||||
const files = selectedItems.filter((t) => t.type === "file");
|
||||
if (files.length === 0) {
|
||||
@@ -716,19 +694,18 @@ export const Browser = () => {
|
||||
toast.info(t("Les dossiers n'ont pas été téléchargés."));
|
||||
}
|
||||
}}
|
||||
>
|
||||
{t("Télécharger")}
|
||||
</Button>
|
||||
<Button
|
||||
size="sm"
|
||||
variant="destructive"
|
||||
/>
|
||||
<IconAction
|
||||
label={t("Supprimer")}
|
||||
icon={<TrashIcon className="h-4 w-4" />}
|
||||
tone="danger"
|
||||
onClick={() => void removeSelected()}
|
||||
>
|
||||
{t("Supprimer")}
|
||||
</Button>
|
||||
<Button size="sm" variant="ghost" onClick={clearSelection}>
|
||||
{t("Annuler la sélection")}
|
||||
</Button>
|
||||
/>
|
||||
<IconAction
|
||||
label={t("Annuler la sélection")}
|
||||
icon={<CloseIcon className="h-4 w-4" />}
|
||||
onClick={clearSelection}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -740,7 +717,7 @@ export const Browser = () => {
|
||||
</div>
|
||||
) : empty ? (
|
||||
<EmptyState
|
||||
icon={<FolderIcon className="h-8 w-8" />}
|
||||
icon={<img src="/icons/opened-folder.png" alt="" className="h-8 w-8 object-contain" />}
|
||||
title={t("Emplacement vide")}
|
||||
description={t(
|
||||
"Créez un sous-dossier ou envoyez un fichier pour commencer.",
|
||||
@@ -762,7 +739,7 @@ export const Browser = () => {
|
||||
onDrop={(event) => onFolderDrop(event, folder)}
|
||||
onClick={() => toggleSelection(`f:${folder.id}`)}
|
||||
className={cn(
|
||||
"group relative flex items-center gap-1 rounded-lg border border-border bg-surface p-2 transition-colors hover:border-border-strong hover:bg-surface-hover cursor-pointer",
|
||||
"group relative flex items-center gap-1 rounded-xl border border-border/50 bg-surface/60 p-2 backdrop-blur-md transition-all hover:-translate-y-1 hover:border-border-strong hover:bg-surface/80 hover:shadow-lg cursor-pointer",
|
||||
dropTargetId === folder.id &&
|
||||
"border-accent bg-accent/10 ring-1 ring-accent/50",
|
||||
selected.has(`f:${folder.id}`) &&
|
||||
@@ -798,7 +775,7 @@ export const Browser = () => {
|
||||
className="flex min-w-0 flex-1 items-center gap-3 rounded-sm p-1 text-left focus-visible:ring-ring focus-visible:ring-2 focus-visible:outline-none"
|
||||
>
|
||||
<span className="shrink-0 text-accent">
|
||||
<FolderIcon className="h-5 w-5" />
|
||||
<img src="/icons/opened-folder.png" alt="" className="h-5 w-5 object-contain" />
|
||||
</span>
|
||||
<span className="min-w-0 flex-1">
|
||||
<span className="block truncate text-sm font-medium text-foreground">
|
||||
@@ -879,7 +856,7 @@ export const Browser = () => {
|
||||
{t("Rien à afficher pour ce filtre.")}
|
||||
</p>
|
||||
) : (
|
||||
<ul className="flex flex-col divide-y divide-border rounded-lg border border-border bg-surface">
|
||||
<ul className="flex flex-col divide-y divide-border rounded-xl border border-border/50 bg-surface/60 backdrop-blur-md">
|
||||
{visibleFiles.map((file, index) => (
|
||||
<li
|
||||
key={file.id}
|
||||
@@ -943,8 +920,7 @@ export const Browser = () => {
|
||||
}
|
||||
icon={
|
||||
<StarIcon
|
||||
className="h-4 w-4"
|
||||
{...(file.is_starred ? { filled: true } : {})}
|
||||
className={`h-4 w-4 ${file.is_starred ? "text-accent" : "opacity-60"}`}
|
||||
/>
|
||||
}
|
||||
onClick={(event) => {
|
||||
@@ -956,13 +932,12 @@ export const Browser = () => {
|
||||
<a
|
||||
href={api.downloadUrl(file.id)}
|
||||
download={file.name}
|
||||
className="inline-flex h-8 items-center gap-1.5 rounded-sm border border-border-strong bg-surface px-3 font-display text-[0.6875rem] font-semibold uppercase tracking-label text-foreground transition-colors hover:bg-surface-hover"
|
||||
aria-label={t("Télécharger {name}", { name: file.name })}
|
||||
title={t("Télécharger {name}", { name: file.name })}
|
||||
className="inline-flex h-8 w-8 items-center justify-center rounded-md border border-border/50 bg-surface/60 text-muted-foreground backdrop-blur-sm transition-all hover:-translate-y-0.5 hover:bg-surface/80 hover:text-foreground hover:shadow-sm"
|
||||
onClick={(event) => event.stopPropagation()}
|
||||
>
|
||||
<DownloadIcon className="h-3.5 w-3.5" />
|
||||
<span className="hidden sm:inline">
|
||||
{t("Télécharger")}
|
||||
</span>
|
||||
<DownloadIcon className="h-4 w-4" />
|
||||
</a>
|
||||
|
||||
{canWrite ? (
|
||||
|
||||
@@ -36,83 +36,81 @@ export const ChangePassword = () => {
|
||||
};
|
||||
|
||||
return (
|
||||
<main className="flex min-h-dvh items-center justify-center bg-background px-4 py-10">
|
||||
<div className="w-full max-w-sm">
|
||||
<header className="mb-6 text-center">
|
||||
<div className="flex items-center justify-center gap-3">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt=""
|
||||
className="h-12 w-12 rounded-xl ring-1 ring-black/5"
|
||||
/>
|
||||
<div className="text-left">
|
||||
<p className="font-display text-xs font-semibold uppercase tracking-logo text-accent">
|
||||
CoHaiSe
|
||||
</p>
|
||||
<h1 className="font-display text-lg font-semibold uppercase tracking-label text-foreground">
|
||||
{t("Nouveau mot de passe")}
|
||||
</h1>
|
||||
</div>
|
||||
<div className="w-full max-w-sm">
|
||||
<header className="mb-6 text-center">
|
||||
<div className="flex items-center justify-center gap-3">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt=""
|
||||
className="h-12 w-12 rounded-xl ring-1 ring-black/5"
|
||||
/>
|
||||
<div className="text-left">
|
||||
<p className="font-display text-xs font-semibold uppercase tracking-logo text-accent">
|
||||
CoHaiSe
|
||||
</p>
|
||||
<h1 className="font-display text-lg font-semibold uppercase tracking-label text-foreground">
|
||||
{t("Nouveau mot de passe")}
|
||||
</h1>
|
||||
</div>
|
||||
<p className="mt-2 text-sm leading-relaxed text-muted-foreground">
|
||||
{t("Bienvenue {name}. Ce mot de passe a été défini par un administrateur : choisissez le vôtre.", { name: user?.first_name ?? "" })}
|
||||
</p>
|
||||
</header>
|
||||
</div>
|
||||
<p className="mt-2 text-sm leading-relaxed text-muted-foreground">
|
||||
{t("Bienvenue {name}. Ce mot de passe a été défini par un administrateur : choisissez le vôtre.", { name: user?.first_name ?? "" })}
|
||||
</p>
|
||||
</header>
|
||||
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>{t("Changement requis")}</CardTitle>
|
||||
<CardDescription>
|
||||
{t("Les autres sessions ouvertes sur ce compte seront fermées.")}
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<form className="flex flex-col gap-4" onSubmit={(event) => void submit(event)}>
|
||||
<Input
|
||||
label={t("Mot de passe actuel")}
|
||||
type="password"
|
||||
autoComplete="current-password"
|
||||
required
|
||||
autoFocus
|
||||
value={current}
|
||||
onChange={(event) => setCurrent(event.target.value)}
|
||||
/>
|
||||
<Input
|
||||
label={t("Nouveau mot de passe")}
|
||||
type="password"
|
||||
autoComplete="new-password"
|
||||
required
|
||||
minLength={8}
|
||||
hint={t("8 caractères minimum.")}
|
||||
value={next}
|
||||
onChange={(event) => setNext(event.target.value)}
|
||||
/>
|
||||
<Input
|
||||
label={t("Confirmation")}
|
||||
type="password"
|
||||
autoComplete="new-password"
|
||||
required
|
||||
minLength={8}
|
||||
value={confirm}
|
||||
onChange={(event) => setConfirm(event.target.value)}
|
||||
/>
|
||||
{error ? <Alert>{error}</Alert> : null}
|
||||
<Button type="submit" size="lg" fullWidth isLoading={busy}>
|
||||
{t("Enregistrer")}
|
||||
</Button>
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
size="md"
|
||||
fullWidth
|
||||
onClick={() => void logout()}
|
||||
>
|
||||
{t("Se déconnecter")}
|
||||
</Button>
|
||||
</form>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
</main>
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>{t("Changement requis")}</CardTitle>
|
||||
<CardDescription>
|
||||
{t("Les autres sessions ouvertes sur ce compte seront fermées.")}
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<form className="flex flex-col gap-4" onSubmit={(event) => void submit(event)}>
|
||||
<Input
|
||||
label={t("Mot de passe actuel")}
|
||||
type="password"
|
||||
autoComplete="current-password"
|
||||
required
|
||||
autoFocus
|
||||
value={current}
|
||||
onChange={(event) => setCurrent(event.target.value)}
|
||||
/>
|
||||
<Input
|
||||
label={t("Nouveau mot de passe")}
|
||||
type="password"
|
||||
autoComplete="new-password"
|
||||
required
|
||||
minLength={8}
|
||||
hint={t("8 caractères minimum.")}
|
||||
value={next}
|
||||
onChange={(event) => setNext(event.target.value)}
|
||||
/>
|
||||
<Input
|
||||
label={t("Confirmation")}
|
||||
type="password"
|
||||
autoComplete="new-password"
|
||||
required
|
||||
minLength={8}
|
||||
value={confirm}
|
||||
onChange={(event) => setConfirm(event.target.value)}
|
||||
/>
|
||||
{error ? <Alert>{error}</Alert> : null}
|
||||
<Button type="submit" size="lg" fullWidth isLoading={busy}>
|
||||
{t("Enregistrer")}
|
||||
</Button>
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
size="md"
|
||||
fullWidth
|
||||
onClick={() => void logout()}
|
||||
>
|
||||
{t("Se déconnecter")}
|
||||
</Button>
|
||||
</form>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -36,57 +36,55 @@ export const ConfirmEmail = () => {
|
||||
}, [token, refresh]);
|
||||
|
||||
return (
|
||||
<main className="flex min-h-dvh items-center justify-center bg-background px-4 py-10">
|
||||
<div className="w-full max-w-sm">
|
||||
<header className="mb-6 text-center">
|
||||
<div className="flex items-center justify-center gap-3">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt=""
|
||||
className="h-12 w-12 rounded-xl ring-1 ring-black/5"
|
||||
/>
|
||||
<div className="text-left">
|
||||
<p className="font-display text-xs font-semibold uppercase tracking-logo text-accent">
|
||||
CoHaiSe
|
||||
</p>
|
||||
<h1 className="font-display text-lg font-semibold uppercase tracking-label text-foreground">
|
||||
{t("Changement d'adresse")}
|
||||
</h1>
|
||||
</div>
|
||||
<div className="w-full max-w-sm">
|
||||
<header className="mb-6 text-center">
|
||||
<div className="flex items-center justify-center gap-3">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt=""
|
||||
className="h-12 w-12 rounded-xl ring-1 ring-black/5"
|
||||
/>
|
||||
<div className="text-left">
|
||||
<p className="font-display text-xs font-semibold uppercase tracking-logo text-accent">
|
||||
CoHaiSe
|
||||
</p>
|
||||
<h1 className="font-display text-lg font-semibold uppercase tracking-label text-foreground">
|
||||
{t("Changement d'adresse")}
|
||||
</h1>
|
||||
</div>
|
||||
</header>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>{t("Confirmation")}</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent className="flex flex-col gap-4">
|
||||
{state === "loading" ? (
|
||||
<div className="flex justify-center py-4">
|
||||
<Spinner size="md" />
|
||||
</div>
|
||||
) : state === "success" ? (
|
||||
<>
|
||||
<Alert tone="success">{t("Votre adresse e-mail a été mise à jour.")}</Alert>
|
||||
<Link to="/files">
|
||||
<Button size="lg" fullWidth>
|
||||
{t("Accéder à mes fichiers")}
|
||||
</Button>
|
||||
</Link>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Alert>{error}</Alert>
|
||||
<Link to="/profile">
|
||||
<Button size="lg" fullWidth>
|
||||
{t("Mon compte")}
|
||||
</Button>
|
||||
</Link>
|
||||
</>
|
||||
)}
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
</main>
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>{t("Confirmation")}</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent className="flex flex-col gap-4">
|
||||
{state === "loading" ? (
|
||||
<div className="flex justify-center py-4">
|
||||
<Spinner size="md" />
|
||||
</div>
|
||||
) : state === "success" ? (
|
||||
<>
|
||||
<Alert tone="success">{t("Votre adresse e-mail a été mise à jour.")}</Alert>
|
||||
<Link to="/files">
|
||||
<Button size="lg" fullWidth>
|
||||
{t("Accéder à mes fichiers")}
|
||||
</Button>
|
||||
</Link>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Alert>{error}</Alert>
|
||||
<Link to="/profile">
|
||||
<Button size="lg" fullWidth>
|
||||
{t("Mon compte")}
|
||||
</Button>
|
||||
</Link>
|
||||
</>
|
||||
)}
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -60,7 +60,7 @@ export const Favorites = () => {
|
||||
description={t("Étoilez un fichier dans l'explorateur pour le retrouver ici.")}
|
||||
/>
|
||||
) : (
|
||||
<ul className="flex flex-col divide-y divide-border rounded-lg border border-border bg-surface">
|
||||
<ul className="flex flex-col divide-y divide-border rounded-xl border border-border/50 bg-surface/60 backdrop-blur-md">
|
||||
{files.map((file, index) => (
|
||||
<li key={file.id} className="flex items-center gap-2 px-3 py-2.5">
|
||||
<button
|
||||
@@ -85,17 +85,18 @@ export const Favorites = () => {
|
||||
|
||||
<IconAction
|
||||
label={t("Retirer l'étoile de {name}", { name: file.name })}
|
||||
icon={<StarIcon className="h-4 w-4" filled />}
|
||||
icon={<StarIcon className="h-4 w-4" />}
|
||||
onClick={() => void unstar(file)}
|
||||
/>
|
||||
|
||||
<a
|
||||
href={api.downloadUrl(file.id)}
|
||||
download={file.name}
|
||||
className="inline-flex h-8 items-center gap-1.5 rounded-sm border border-border-strong bg-surface px-3 font-display text-[0.6875rem] font-semibold uppercase tracking-label text-foreground transition-colors hover:bg-surface-hover"
|
||||
aria-label={t("Télécharger {name}", { name: file.name })}
|
||||
title={t("Télécharger {name}", { name: file.name })}
|
||||
className="inline-flex h-8 w-8 items-center justify-center rounded-md border border-border/50 bg-surface/60 text-muted-foreground backdrop-blur-sm transition-all hover:-translate-y-0.5 hover:bg-surface/80 hover:text-foreground hover:shadow-sm"
|
||||
>
|
||||
<DownloadIcon className="h-3.5 w-3.5" />
|
||||
<span className="hidden sm:inline">{t("Télécharger")}</span>
|
||||
<DownloadIcon className="h-4 w-4" />
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
|
||||
@@ -27,75 +27,73 @@ export const ForgotPassword = () => {
|
||||
};
|
||||
|
||||
return (
|
||||
<main className="flex min-h-dvh items-center justify-center bg-background px-4 py-10">
|
||||
<div className="w-full max-w-sm">
|
||||
<header className="mb-6 text-center">
|
||||
<div className="flex items-center justify-center gap-3">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt=""
|
||||
className="h-12 w-12 rounded-xl ring-1 ring-black/5"
|
||||
/>
|
||||
<div className="text-left">
|
||||
<p className="font-display text-xs font-semibold uppercase tracking-logo text-accent">
|
||||
CoHaiSe
|
||||
</p>
|
||||
<h1 className="font-display text-lg font-semibold uppercase tracking-label text-foreground">
|
||||
{t("Mot de passe oublié")}
|
||||
</h1>
|
||||
</div>
|
||||
<div className="w-full max-w-sm">
|
||||
<header className="mb-6 text-center">
|
||||
<div className="flex items-center justify-center gap-3">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt=""
|
||||
className="h-12 w-12 rounded-xl ring-1 ring-black/5"
|
||||
/>
|
||||
<div className="text-left">
|
||||
<p className="font-display text-xs font-semibold uppercase tracking-logo text-accent">
|
||||
CoHaiSe
|
||||
</p>
|
||||
<h1 className="font-display text-lg font-semibold uppercase tracking-label text-foreground">
|
||||
{t("Mot de passe oublié")}
|
||||
</h1>
|
||||
</div>
|
||||
</header>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>{t("Réinitialisation")}</CardTitle>
|
||||
<CardDescription>
|
||||
{t("Nous vous enverrons un lien valable une heure.")}
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
{sent ? (
|
||||
<div className="flex flex-col gap-4">
|
||||
<Alert tone="success">
|
||||
{t("Si cette adresse correspond à un compte, un message contenant le lien de réinitialisation vient d'être envoyé.")}
|
||||
</Alert>
|
||||
<Link
|
||||
to="/login"
|
||||
className="text-center text-xs text-muted-foreground underline-offset-2 hover:text-foreground hover:underline"
|
||||
>
|
||||
{t("Retour à la connexion")}
|
||||
</Link>
|
||||
</div>
|
||||
) : (
|
||||
<form
|
||||
className="flex flex-col gap-4"
|
||||
onSubmit={(event) => void submit(event)}
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>{t("Réinitialisation")}</CardTitle>
|
||||
<CardDescription>
|
||||
{t("Nous vous enverrons un lien valable une heure.")}
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
{sent ? (
|
||||
<div className="flex flex-col gap-4">
|
||||
<Alert tone="success">
|
||||
{t("Si cette adresse correspond à un compte, un message contenant le lien de réinitialisation vient d'être envoyé.")}
|
||||
</Alert>
|
||||
<Link
|
||||
to="/login"
|
||||
className="text-center text-xs text-muted-foreground underline-offset-2 hover:text-foreground hover:underline"
|
||||
>
|
||||
<Input
|
||||
label={t("Adresse e-mail")}
|
||||
type="email"
|
||||
autoComplete="email"
|
||||
required
|
||||
autoFocus
|
||||
value={email}
|
||||
onChange={(event) => setEmail(event.target.value)}
|
||||
/>
|
||||
{error ? <Alert>{error}</Alert> : null}
|
||||
<Button type="submit" size="lg" fullWidth isLoading={busy}>
|
||||
{t("Envoyer le lien")}
|
||||
</Button>
|
||||
<Link
|
||||
to="/login"
|
||||
className="text-center text-xs text-muted-foreground underline-offset-2 hover:text-foreground hover:underline"
|
||||
>
|
||||
{t("Retour à la connexion")}
|
||||
</Link>
|
||||
</form>
|
||||
)}
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
</main>
|
||||
{t("Retour à la connexion")}
|
||||
</Link>
|
||||
</div>
|
||||
) : (
|
||||
<form
|
||||
className="flex flex-col gap-4"
|
||||
onSubmit={(event) => void submit(event)}
|
||||
>
|
||||
<Input
|
||||
label={t("Adresse e-mail")}
|
||||
type="email"
|
||||
autoComplete="email"
|
||||
required
|
||||
autoFocus
|
||||
value={email}
|
||||
onChange={(event) => setEmail(event.target.value)}
|
||||
/>
|
||||
{error ? <Alert>{error}</Alert> : null}
|
||||
<Button type="submit" size="lg" fullWidth isLoading={busy}>
|
||||
{t("Envoyer le lien")}
|
||||
</Button>
|
||||
<Link
|
||||
to="/login"
|
||||
className="text-center text-xs text-muted-foreground underline-offset-2 hover:text-foreground hover:underline"
|
||||
>
|
||||
{t("Retour à la connexion")}
|
||||
</Link>
|
||||
</form>
|
||||
)}
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -32,71 +32,69 @@ export const Login = () => {
|
||||
};
|
||||
|
||||
return (
|
||||
<main className="flex min-h-dvh items-center justify-center bg-background px-4 py-10">
|
||||
<div className="w-full max-w-sm">
|
||||
<header className="mb-6 text-center">
|
||||
<div className="flex items-center justify-center gap-3">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt=""
|
||||
className="h-12 w-12 rounded-xl ring-1 ring-black/5"
|
||||
/>
|
||||
<div className="text-left">
|
||||
<p className="font-display text-xs font-semibold uppercase tracking-logo text-accent">
|
||||
CoHaiSe
|
||||
</p>
|
||||
<h1 className="font-display text-lg font-semibold uppercase tracking-label text-foreground">
|
||||
Cloud
|
||||
</h1>
|
||||
</div>
|
||||
<div className="w-full max-w-sm">
|
||||
<header className="mb-6 text-center">
|
||||
<div className="flex items-center justify-center gap-3">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt=""
|
||||
className="h-12 w-12 rounded-xl ring-1 ring-black/5"
|
||||
/>
|
||||
<div className="text-left">
|
||||
<p className="font-display text-xs font-semibold uppercase tracking-logo text-accent">
|
||||
CoHaiSe
|
||||
</p>
|
||||
<h1 className="font-display text-lg font-semibold uppercase tracking-label text-foreground">
|
||||
Cloud
|
||||
</h1>
|
||||
</div>
|
||||
<p className="mt-2 text-sm leading-relaxed text-muted-foreground">
|
||||
{t("Connectez-vous pour accéder à vos fichiers.")}
|
||||
</p>
|
||||
</header>
|
||||
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>{t("Connexion")}</CardTitle>
|
||||
<CardDescription>{t("Votre session reste ouverte 14 jours.")}</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<form className="flex flex-col gap-4" onSubmit={(event) => void submit(event)}>
|
||||
<Input
|
||||
label={t("Adresse e-mail")}
|
||||
type="email"
|
||||
autoComplete="username"
|
||||
required
|
||||
autoFocus
|
||||
value={email}
|
||||
onChange={(event) => setEmail(event.target.value)}
|
||||
/>
|
||||
<Input
|
||||
label={t("Mot de passe")}
|
||||
type="password"
|
||||
autoComplete="current-password"
|
||||
required
|
||||
value={password}
|
||||
onChange={(event) => setPassword(event.target.value)}
|
||||
{...(error ? { error } : {})}
|
||||
/>
|
||||
|
||||
<Button type="submit" size="lg" fullWidth isLoading={busy}>
|
||||
{t("Se connecter")}
|
||||
</Button>
|
||||
</form>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<p className="mt-4 text-center text-xs text-muted-foreground">
|
||||
<Link
|
||||
to="/forgot-password"
|
||||
className="underline-offset-2 hover:text-foreground hover:underline"
|
||||
>
|
||||
{t("Mot de passe oublié ?")}
|
||||
</Link>
|
||||
</div>
|
||||
<p className="mt-2 text-sm leading-relaxed text-muted-foreground">
|
||||
{t("Connectez-vous pour accéder à vos fichiers.")}
|
||||
</p>
|
||||
</div>
|
||||
</main>
|
||||
</header>
|
||||
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>{t("Connexion")}</CardTitle>
|
||||
<CardDescription>{t("Votre session reste ouverte 14 jours.")}</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<form className="flex flex-col gap-4" onSubmit={(event) => void submit(event)}>
|
||||
<Input
|
||||
label={t("Adresse e-mail")}
|
||||
type="email"
|
||||
autoComplete="username"
|
||||
required
|
||||
autoFocus
|
||||
value={email}
|
||||
onChange={(event) => setEmail(event.target.value)}
|
||||
/>
|
||||
<Input
|
||||
label={t("Mot de passe")}
|
||||
type="password"
|
||||
autoComplete="current-password"
|
||||
required
|
||||
value={password}
|
||||
onChange={(event) => setPassword(event.target.value)}
|
||||
{...(error ? { error } : {})}
|
||||
/>
|
||||
|
||||
<Button type="submit" size="lg" fullWidth isLoading={busy}>
|
||||
{t("Se connecter")}
|
||||
</Button>
|
||||
</form>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<p className="mt-4 text-center text-xs text-muted-foreground">
|
||||
<Link
|
||||
to="/forgot-password"
|
||||
className="underline-offset-2 hover:text-foreground hover:underline"
|
||||
>
|
||||
{t("Mot de passe oublié ?")}
|
||||
</Link>
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -34,84 +34,82 @@ export const ResetPassword = () => {
|
||||
};
|
||||
|
||||
return (
|
||||
<main className="flex min-h-dvh items-center justify-center bg-background px-4 py-10">
|
||||
<div className="w-full max-w-sm">
|
||||
<header className="mb-6 text-center">
|
||||
<div className="flex items-center justify-center gap-3">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt=""
|
||||
className="h-12 w-12 rounded-xl ring-1 ring-black/5"
|
||||
/>
|
||||
<div className="text-left">
|
||||
<p className="font-display text-xs font-semibold uppercase tracking-logo text-accent">
|
||||
CoHaiSe
|
||||
</p>
|
||||
<h1 className="font-display text-lg font-semibold uppercase tracking-label text-foreground">
|
||||
{t("Nouveau mot de passe")}
|
||||
</h1>
|
||||
</div>
|
||||
<div className="w-full max-w-sm">
|
||||
<header className="mb-6 text-center">
|
||||
<div className="flex items-center justify-center gap-3">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt=""
|
||||
className="h-12 w-12 rounded-xl ring-1 ring-black/5"
|
||||
/>
|
||||
<div className="text-left">
|
||||
<p className="font-display text-xs font-semibold uppercase tracking-logo text-accent">
|
||||
CoHaiSe
|
||||
</p>
|
||||
<h1 className="font-display text-lg font-semibold uppercase tracking-label text-foreground">
|
||||
{t("Nouveau mot de passe")}
|
||||
</h1>
|
||||
</div>
|
||||
</header>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>{t("Réinitialisation")}</CardTitle>
|
||||
<CardDescription>{t("Choisissez un mot de passe robuste.")}</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
{!token ? (
|
||||
<div className="flex flex-col gap-4">
|
||||
<Alert>{t("Ce lien est incomplet ou invalide.")}</Alert>
|
||||
<Link
|
||||
to="/forgot-password"
|
||||
className="text-center text-xs text-muted-foreground underline-offset-2 hover:text-foreground hover:underline"
|
||||
>
|
||||
{t("Demander un nouveau lien")}
|
||||
</Link>
|
||||
</div>
|
||||
) : done ? (
|
||||
<div className="flex flex-col gap-4">
|
||||
<Alert tone="success">
|
||||
{t("Votre mot de passe a été réinitialisé. Vous pouvez vous connecter.")}
|
||||
</Alert>
|
||||
<Link to="/login">
|
||||
<Button size="lg" fullWidth>
|
||||
{t("Se connecter")}
|
||||
</Button>
|
||||
</Link>
|
||||
</div>
|
||||
) : (
|
||||
<form className="flex flex-col gap-4" onSubmit={(event) => void submit(event)}>
|
||||
<Input
|
||||
label={t("Nouveau mot de passe")}
|
||||
type="password"
|
||||
autoComplete="new-password"
|
||||
required
|
||||
minLength={8}
|
||||
autoFocus
|
||||
hint={t("8 caractères minimum.")}
|
||||
value={password}
|
||||
onChange={(event) => setPassword(event.target.value)}
|
||||
/>
|
||||
<Input
|
||||
label={t("Confirmation")}
|
||||
type="password"
|
||||
autoComplete="new-password"
|
||||
required
|
||||
minLength={8}
|
||||
value={confirm}
|
||||
onChange={(event) => setConfirm(event.target.value)}
|
||||
/>
|
||||
{error ? <Alert>{error}</Alert> : null}
|
||||
<Button type="submit" size="lg" fullWidth isLoading={busy}>
|
||||
{t("Réinitialiser")}
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>{t("Réinitialisation")}</CardTitle>
|
||||
<CardDescription>{t("Choisissez un mot de passe robuste.")}</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
{!token ? (
|
||||
<div className="flex flex-col gap-4">
|
||||
<Alert>{t("Ce lien est incomplet ou invalide.")}</Alert>
|
||||
<Link
|
||||
to="/forgot-password"
|
||||
className="text-center text-xs text-muted-foreground underline-offset-2 hover:text-foreground hover:underline"
|
||||
>
|
||||
{t("Demander un nouveau lien")}
|
||||
</Link>
|
||||
</div>
|
||||
) : done ? (
|
||||
<div className="flex flex-col gap-4">
|
||||
<Alert tone="success">
|
||||
{t("Votre mot de passe a été réinitialisé. Vous pouvez vous connecter.")}
|
||||
</Alert>
|
||||
<Link to="/login">
|
||||
<Button size="lg" fullWidth>
|
||||
{t("Se connecter")}
|
||||
</Button>
|
||||
</form>
|
||||
)}
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
</main>
|
||||
</Link>
|
||||
</div>
|
||||
) : (
|
||||
<form className="flex flex-col gap-4" onSubmit={(event) => void submit(event)}>
|
||||
<Input
|
||||
label={t("Nouveau mot de passe")}
|
||||
type="password"
|
||||
autoComplete="new-password"
|
||||
required
|
||||
minLength={8}
|
||||
autoFocus
|
||||
hint={t("8 caractères minimum.")}
|
||||
value={password}
|
||||
onChange={(event) => setPassword(event.target.value)}
|
||||
/>
|
||||
<Input
|
||||
label={t("Confirmation")}
|
||||
type="password"
|
||||
autoComplete="new-password"
|
||||
required
|
||||
minLength={8}
|
||||
value={confirm}
|
||||
onChange={(event) => setConfirm(event.target.value)}
|
||||
/>
|
||||
{error ? <Alert>{error}</Alert> : null}
|
||||
<Button type="submit" size="lg" fullWidth isLoading={busy}>
|
||||
{t("Réinitialiser")}
|
||||
</Button>
|
||||
</form>
|
||||
)}
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { useState, type FormEvent } from "react";
|
||||
import { Button, Input, Spinner } from "../ui/index.js";
|
||||
import { Input, Spinner } from "../ui/index.js";
|
||||
import { ApiError, api, formatBytes, type Folder, type UploadedFile } from "../lib/api.js";
|
||||
import { Alert, EmptyState, PageHeader } from "../components/feedback.js";
|
||||
import { IconAction } from "../components/IconAction.js";
|
||||
import { DownloadIcon, FileIcon, FolderIcon, SearchIcon } from "../components/icons.js";
|
||||
import { useI18n } from "../lib/i18n.js";
|
||||
|
||||
@@ -56,14 +57,16 @@ export const Search = () => {
|
||||
onChange={(event) => setQ(event.target.value)}
|
||||
/>
|
||||
</div>
|
||||
<Button
|
||||
type="submit"
|
||||
size="md"
|
||||
<IconAction
|
||||
label={t("Rechercher")}
|
||||
icon={<SearchIcon className="h-4 w-4" />}
|
||||
isLoading={loading}
|
||||
iconLeading={<SearchIcon className="h-3.5 w-3.5" />}
|
||||
>
|
||||
{t("Rechercher")}
|
||||
</Button>
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
const form = e.currentTarget.closest('form');
|
||||
form?.requestSubmit();
|
||||
}}
|
||||
/>
|
||||
</form>
|
||||
}
|
||||
/>
|
||||
@@ -87,7 +90,7 @@ export const Search = () => {
|
||||
<h2 className="mb-2 font-display text-[0.6875rem] font-semibold uppercase tracking-label text-subtle-foreground">
|
||||
{t("Dossiers")}
|
||||
</h2>
|
||||
<ul className="flex flex-col divide-y divide-border rounded-lg border border-border bg-surface">
|
||||
<ul className="flex flex-col divide-y divide-border rounded-xl border border-border/50 bg-surface/60 backdrop-blur-md">
|
||||
{results.folders.map((folder) => (
|
||||
<li key={folder.id} className="flex items-center gap-3 px-3 py-2.5">
|
||||
<span className="shrink-0 text-accent">
|
||||
@@ -107,7 +110,7 @@ export const Search = () => {
|
||||
<h2 className="mb-2 font-display text-[0.6875rem] font-semibold uppercase tracking-label text-subtle-foreground">
|
||||
{t("Fichiers")}
|
||||
</h2>
|
||||
<ul className="flex flex-col divide-y divide-border rounded-lg border border-border bg-surface">
|
||||
<ul className="flex flex-col divide-y divide-border rounded-xl border border-border/50 bg-surface/60 backdrop-blur-md">
|
||||
{results.files.map((file) => (
|
||||
<li key={file.id} className="flex items-center gap-3 px-3 py-2.5">
|
||||
<span className="shrink-0 text-muted-foreground">
|
||||
|
||||
@@ -121,7 +121,7 @@ export const Trash = () => {
|
||||
<h2 className="mb-2 font-display text-[0.6875rem] font-semibold uppercase tracking-label text-subtle-foreground">
|
||||
{t("Dossiers")}
|
||||
</h2>
|
||||
<ul className="flex flex-col divide-y divide-border rounded-lg border border-border bg-surface">
|
||||
<ul className="flex flex-col divide-y divide-border rounded-xl border border-border/50 bg-surface/60 backdrop-blur-md">
|
||||
{data.folders.map((folder) => (
|
||||
<li key={folder.id} className="flex items-center gap-3 px-3 py-2.5">
|
||||
<span className="shrink-0 text-accent">
|
||||
@@ -165,7 +165,7 @@ export const Trash = () => {
|
||||
<h2 className="mb-2 font-display text-[0.6875rem] font-semibold uppercase tracking-label text-subtle-foreground">
|
||||
{t("Fichiers")}
|
||||
</h2>
|
||||
<ul className="flex flex-col divide-y divide-border rounded-lg border border-border bg-surface">
|
||||
<ul className="flex flex-col divide-y divide-border rounded-xl border border-border/50 bg-surface/60 backdrop-blur-md">
|
||||
{data.files.map((file) => (
|
||||
<li key={file.id} className="flex items-center gap-3 px-3 py-2.5">
|
||||
<span className="shrink-0 text-muted-foreground">
|
||||
|
||||
Reference in New Issue
Block a user