diff --git a/web/sections/PageBuilderPanel.tsx b/web/sections/PageBuilderPanel.tsx index 990b1d2..aada984 100644 --- a/web/sections/PageBuilderPanel.tsx +++ b/web/sections/PageBuilderPanel.tsx @@ -37,6 +37,7 @@ import { SpacingEditor, type Padding } from './SpacingEditor'; import { BandSettings } from './BandSettings'; import { BlockSettings } from './BlockSettings'; import { GalleryItems } from './GalleryItems'; +import { PartnersEditor } from './PartnersEditor'; import { useEditorSlot } from '../useEditorSlot'; import { AddComponentDialog, type ComponentKind } from './AddComponentDialog'; import { MediaPicker } from '../MediaPicker'; @@ -657,6 +658,12 @@ export const PageBuilderPanel = () => { A button rather than the modal opening itself, so picking the block and changing what is in it are two acts — see the note in the selection effect. */} + {/* + Partners are the SITE's, not this page's — the block places the list rather than holding + one. So this edits the singleton, and every page showing them changes together. + */} + {block.kind === 'partners' && setRendered((n) => n + 1)} />} + {block.kind === 'gallery' && (
+ + ))} + + + + + {error &&

{error}

} + + setAdding(false)} + onPick={(url) => { + setAdding(false); + /* + Named from the FILE, and renamed in place afterwards. + + The API refuses a partner with no name, and asking for one in a second dialog before the + logo has even been seen is a form in front of a form. The filename is a real answer often + enough, and the field beside the logo is where it gets corrected. + */ + const name = (url.split('/').pop() ?? 'Partner').replace(/\.[^.]+$/, ''); + void send(() => clientRef.current.post('/fofos-admin/site/partners', { name, logo_url: url })); + }} + title="Choose a partner's logo" + /> +
+ ); +};