Adjust branding defaults and tenant presets
This commit is contained in:
@@ -6,6 +6,8 @@ const defaults = {
|
||||
accent: '#222222',
|
||||
background: '#ffffff',
|
||||
surface: '#f0f0f0',
|
||||
headingFont: 'Default Heading',
|
||||
bodyFont: 'Default Body',
|
||||
mode: 'auto' as const,
|
||||
buttonStyle: 'filled' as const,
|
||||
buttonRadius: 12,
|
||||
@@ -87,7 +89,6 @@ describe('extractBrandingForm', () => {
|
||||
position: 'center',
|
||||
size: 'l',
|
||||
},
|
||||
use_default_branding: true,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -105,7 +106,6 @@ describe('extractBrandingForm', () => {
|
||||
expect(result.logoValue).toBe('🎉');
|
||||
expect(result.logoPosition).toBe('center');
|
||||
expect(result.logoSize).toBe('l');
|
||||
expect(result.useDefaultBranding).toBe(true);
|
||||
});
|
||||
|
||||
it('normalizes stored logo paths for previews', () => {
|
||||
|
||||
@@ -17,7 +17,6 @@ export type BrandingFormValues = {
|
||||
buttonPrimary: string;
|
||||
buttonSecondary: string;
|
||||
linkColor: string;
|
||||
useDefaultBranding: boolean;
|
||||
};
|
||||
|
||||
export type BrandingFormDefaults = Pick<
|
||||
@@ -26,6 +25,8 @@ export type BrandingFormDefaults = Pick<
|
||||
| 'accent'
|
||||
| 'background'
|
||||
| 'surface'
|
||||
| 'headingFont'
|
||||
| 'bodyFont'
|
||||
| 'mode'
|
||||
| 'buttonStyle'
|
||||
| 'buttonRadius'
|
||||
@@ -130,8 +131,8 @@ export function extractBrandingForm(settings: unknown, defaults: BrandingFormDef
|
||||
accent,
|
||||
background,
|
||||
surface,
|
||||
headingFont: headingFont ?? '',
|
||||
bodyFont: bodyFont ?? '',
|
||||
headingFont: headingFont ?? defaults.headingFont ?? '',
|
||||
bodyFont: bodyFont ?? defaults.bodyFont ?? '',
|
||||
fontSize,
|
||||
logoDataUrl: resolveAssetPreviewUrl(logoUploadValue),
|
||||
logoValue,
|
||||
@@ -144,6 +145,5 @@ export function extractBrandingForm(settings: unknown, defaults: BrandingFormDef
|
||||
buttonPrimary,
|
||||
buttonSecondary,
|
||||
linkColor,
|
||||
useDefaultBranding: branding.use_default_branding === true,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user