♻️ Use color scheme on board customize page

This commit is contained in:
Meier Lukas
2023-08-06 16:38:04 +02:00
parent 936980d67a
commit f07b964129
6 changed files with 39 additions and 11 deletions

View File

@@ -40,19 +40,22 @@ function App(
packageAttributes: ServerSidePackageAttributesType;
editModeEnabled: boolean;
config?: ConfigType;
primaryColor?: MantineTheme['primaryColor'];
secondaryColor?: MantineTheme['primaryColor'];
primaryShade?: MantineTheme['primaryShade'];
session: Session;
}>
) {
const { Component, pageProps } = props;
const [primaryColor, setPrimaryColor] = useState<MantineTheme['primaryColor']>(
props.pageProps.config?.settings.customization.colors.primary || 'red'
props.pageProps.primaryColor ?? 'red'
);
const [secondaryColor, setSecondaryColor] = useState<MantineTheme['primaryColor']>(
props.pageProps.config?.settings.customization.colors.secondary || 'orange'
props.pageProps.secondaryColor ?? 'orange'
);
const [primaryShade, setPrimaryShade] = useState<MantineTheme['primaryShade']>(
props.pageProps.config?.settings.customization.colors.shade || 6
props.pageProps.primaryShade ?? 6
);
const colorTheme = {
primaryColor,