22bd117dae
- RichTextarea with toolbar (Bold, Italic, List, Heading) + Ctrl+B/I
hotkeys (layout-independent), active state highlighting, preview mode
- Shared ImageCropField component (replaces duplicate in news/classes)
with drag-to-reposition, Ctrl+scroll zoom, compact layout
- SectionEditor defaultData prop — all admin pages handle empty DB
- Team: section title editable, toast notifications, unsaved data warning
on navigation (back button, sidebar links, browser close)
- Carousel: continuous card wrapping during drag, edge fade for small teams
- Markup renderer: **bold**, *italic*, ## headings, 🤍 bullet points
- Empty DB guards on all public site sections
- Fix: upload error handling, contact phone field, "team" section key
44 lines
1.4 KiB
TypeScript
44 lines
1.4 KiB
TypeScript
"use client";
|
||
|
||
import { SectionEditor } from "../_components/SectionEditor";
|
||
import { InputField } from "../_components/FormField";
|
||
import { ArrayEditor } from "../_components/ArrayEditor";
|
||
|
||
interface AboutData {
|
||
title: string;
|
||
paragraphs: string[];
|
||
}
|
||
|
||
export default function AboutEditorPage() {
|
||
return (
|
||
<SectionEditor<AboutData> sectionKey="about" title="О студии" defaultData={{ paragraphs: [] }}>
|
||
{(data, update) => (
|
||
<>
|
||
<InputField
|
||
label="Заголовок секции"
|
||
value={data.title}
|
||
onChange={(v) => update({ ...data, title: v })}
|
||
/>
|
||
<ArrayEditor
|
||
label="Параграфы"
|
||
items={data.paragraphs}
|
||
onChange={(paragraphs) => update({ ...data, paragraphs })}
|
||
inline
|
||
renderItem={(text, _i, updateItem) => (
|
||
<textarea
|
||
value={text}
|
||
onChange={(e) => updateItem(e.target.value)}
|
||
rows={2}
|
||
className="w-full rounded-lg border border-white/10 bg-neutral-800 px-3 py-2 text-sm text-white placeholder-neutral-500 outline-none hover:border-gold/30 focus:border-gold transition-colors resize-none"
|
||
placeholder="Текст параграфа..."
|
||
/>
|
||
)}
|
||
createItem={() => ""}
|
||
addLabel="Добавить параграф"
|
||
/>
|
||
</>
|
||
)}
|
||
</SectionEditor>
|
||
);
|
||
}
|