fix: remove all 'Сохранение...' text, show toast popup on save instead

This commit is contained in:
2026-03-24 22:44:22 +03:00
parent 0ae8f57cde
commit 8ecebe686c
2 changed files with 12 additions and 23 deletions

View File

@@ -87,29 +87,19 @@ export function SectionEditor<T>({
return ( return (
<div> <div>
<div className="flex items-center justify-between gap-4">
<h1 className="text-2xl font-bold">{title}</h1> <h1 className="text-2xl font-bold">{title}</h1>
<div className="flex items-center gap-2 text-sm text-neutral-400">
{status === "saving" && ( {/* Fixed toast popup */}
<> {(status === "saved" || status === "error") && (
<Loader2 size={14} className="animate-spin" /> <div className={`fixed bottom-4 right-4 z-50 flex items-center gap-2 rounded-lg border px-3 py-2 text-sm shadow-lg animate-in slide-in-from-right ${
<span>Сохранение...</span> status === "saved"
</> ? "bg-emerald-950/90 border-emerald-500/30 text-emerald-200"
)} : "bg-red-950/90 border-red-500/30 text-red-200"
{status === "saved" && ( }`}>
<> {status === "saved" && <><Check size={14} /> Сохранено</>}
<Check size={14} className="text-emerald-400" /> {status === "error" && <><AlertCircle size={14} /> {error}</>}
<span className="text-emerald-400">Сохранено</span>
</>
)}
{status === "error" && (
<>
<AlertCircle size={14} className="text-red-400" />
<span className="text-red-400">{error}</span>
</>
)}
</div>
</div> </div>
)}
<div className="mt-6 space-y-6">{children(data, setData)}</div> <div className="mt-6 space-y-6">{children(data, setData)}</div>
</div> </div>

View File

@@ -531,7 +531,6 @@ export default function OpenDayAdminPage() {
<div className="flex items-center justify-between"> <div className="flex items-center justify-between">
<div> <div>
<h1 className="text-2xl font-bold">День открытых дверей</h1> <h1 className="text-2xl font-bold">День открытых дверей</h1>
{saving && <span className="text-xs text-neutral-500">Сохранение...</span>}
</div> </div>
<button <button
onClick={deleteEvent} onClick={deleteEvent}