Fix: Exclude SPA pages from Appearance Entry Page dropdown, remove hardcoded Hero paddings, fix Accordion dropdown clipping

This commit is contained in:
Dwindi Ramadhana
2026-02-28 01:10:49 +07:00
parent a62037d993
commit 6f23ccdda4
8 changed files with 126 additions and 64 deletions

View File

@@ -1,15 +1,18 @@
export interface SectionStyleResult {
classNames?: string;
style?: React.CSSProperties;
hasOverlay?: boolean;
overlayOpacity?: number;
backgroundImage?: string;
}
/**
* Shared utility to compute background styles from section styles.
* Used by all customer SPA section components.
*/
export function getSectionBackground(styles?: Record<string, any>): {
style: React.CSSProperties;
hasOverlay: boolean;
overlayOpacity: number;
backgroundImage?: string;
} {
export function getSectionBackground(styles?: Record<string, any>): SectionStyleResult {
if (!styles) {
return { style: {}, hasOverlay: false, overlayOpacity: 0 };
return { style: {}, hasOverlay: false, overlayStyle: undefined };
}
const bgType = styles.backgroundType || 'solid';
@@ -18,6 +21,14 @@ export function getSectionBackground(styles?: Record<string, any>): {
let overlayOpacity = 0;
let backgroundImage: string | undefined;
if (styles.paddingTop) {
style.paddingTop = styles.paddingTop;
}
if (styles.paddingBottom) {
style.paddingBottom = styles.paddingBottom;
}
switch (bgType) {
case 'gradient':
style.background = `linear-gradient(${styles.gradientAngle ?? 135}deg, ${styles.gradientFrom || '#9333ea'}, ${styles.gradientTo || '#3b82f6'})`;