Fix: Exclude SPA pages from Appearance Entry Page dropdown, remove hardcoded Hero paddings, fix Accordion dropdown clipping
This commit is contained in:
@@ -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'})`;
|
||||
|
||||
Reference in New Issue
Block a user