diff --git a/admin-spa/src/components/SectionBackgroundRenderer.tsx b/admin-spa/src/components/SectionBackgroundRenderer.tsx new file mode 100644 index 0000000..6b74b4f --- /dev/null +++ b/admin-spa/src/components/SectionBackgroundRenderer.tsx @@ -0,0 +1,26 @@ +import { SectionStyleResult } from '@/lib/sectionStyles'; + +interface SectionBackgroundRendererProps { + bg: SectionStyleResult; +} + +export function SectionBackgroundRenderer({ bg }: SectionBackgroundRendererProps) { + if (!bg.backgroundImage) return null; + + return ( +
+ + {bg.hasOverlay && ( +
+ )} +
+ ); +} diff --git a/admin-spa/src/routes/Appearance/Pages/components/CanvasRenderer.tsx b/admin-spa/src/routes/Appearance/Pages/components/CanvasRenderer.tsx index ac1fe63..f3911c1 100644 --- a/admin-spa/src/routes/Appearance/Pages/components/CanvasRenderer.tsx +++ b/admin-spa/src/routes/Appearance/Pages/components/CanvasRenderer.tsx @@ -207,10 +207,10 @@ export function CanvasRenderer({ >
{sections.length === 0 ? ( diff --git a/admin-spa/src/routes/Appearance/Pages/components/CanvasSection.tsx b/admin-spa/src/routes/Appearance/Pages/components/CanvasSection.tsx index 529db7b..e85f77a 100644 --- a/admin-spa/src/routes/Appearance/Pages/components/CanvasSection.tsx +++ b/admin-spa/src/routes/Appearance/Pages/components/CanvasSection.tsx @@ -159,8 +159,8 @@ export function CanvasSection({
) : (
{children}
diff --git a/admin-spa/src/routes/Appearance/Pages/index.tsx b/admin-spa/src/routes/Appearance/Pages/index.tsx index 4430f5f..383250f 100644 --- a/admin-spa/src/routes/Appearance/Pages/index.tsx +++ b/admin-spa/src/routes/Appearance/Pages/index.tsx @@ -3,7 +3,7 @@ import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'; import { api } from '@/lib/api'; import { __ } from '@/lib/i18n'; import { Button } from '@/components/ui/button'; -import { Plus, Layout, Undo2, Save, Maximize2, Minimize2 } from 'lucide-react'; +import { Plus, Layout, Undo2, Redo2, Save, Maximize2, Minimize2 } from 'lucide-react'; import { toast } from 'sonner'; import { AlertDialog, @@ -50,6 +50,11 @@ export default function AppearancePages() { setInspectorCollapsed, setAvailableSources, setIsLoading, + undo, + redo, + past, + future, + updateCurrentPage, addSection, deleteSection, duplicateSection, @@ -61,6 +66,7 @@ export default function AppearancePages() { updateSectionStyles, updateElementStyles, markAsSaved, + markAsChanged, setAsSpaLanding, unsetSpaLanding, } = usePageEditorStore(); @@ -160,7 +166,10 @@ export default function AppearancePages() { const endpoint = currentPage.type === 'page' ? `/pages/${currentPage.slug}` : `/templates/${currentPage.cpt}`; - return api.post(endpoint, { sections }); + return api.post(endpoint, { + sections, + container_width: currentPage.containerWidth + }); }, onSuccess: () => { toast.success(__('Page saved successfully')); @@ -332,17 +341,40 @@ export default function AppearancePages() { {isFullscreen ? : } {hasUnsavedChanges && ( - <> - {__('Unsaved changes')} - - + {__('Unsaved changes')} + )} + +
+ + +
+ + {hasUnsavedChanges && ( + )}