@@ -21,6 +21,7 @@ import { useFormik } from "formik";
21
21
import { useTheme } from "@mui/styles" ;
22
22
import Link from "@mui/material/Link" ;
23
23
import { colors } from "theme/colors" ;
24
+ import { hslToHex } from "utils/colors" ;
24
25
25
26
export type AppearanceSettingsPageViewProps = {
26
27
appearance : UpdateAppearanceConfig ;
@@ -30,13 +31,17 @@ export type AppearanceSettingsPageViewProps = {
30
31
preview : boolean ,
31
32
) => void ;
32
33
} ;
34
+
35
+ const fallbackBgColor = hslToHex ( colors . blue [ 7 ] ) ;
36
+
33
37
export const AppearanceSettingsPageView = ( {
34
38
appearance,
35
39
isEntitled,
36
40
onSaveAppearance,
37
41
} : AppearanceSettingsPageViewProps ) : JSX . Element => {
38
42
const styles = useStyles ( ) ;
39
43
const theme = useTheme ( ) ;
44
+
40
45
const logoForm = useFormik < {
41
46
logo_url : string ;
42
47
} > ( {
@@ -53,7 +58,7 @@ export const AppearanceSettingsPageView = ({
53
58
message : appearance . service_banner . message ,
54
59
enabled : appearance . service_banner . enabled ,
55
60
background_color :
56
- appearance . service_banner . background_color ?? colors . blue [ 7 ] ,
61
+ appearance . service_banner . background_color ?? fallbackBgColor ,
57
62
} ,
58
63
onSubmit : ( values ) =>
59
64
onSaveAppearance (
@@ -65,9 +70,11 @@ export const AppearanceSettingsPageView = ({
65
70
} ,
66
71
) ;
67
72
const serviceBannerFieldHelpers = getFormHelpers ( serviceBannerForm ) ;
73
+
68
74
const [ backgroundColor , setBackgroundColor ] = useState (
69
75
serviceBannerForm . values . background_color ,
70
76
) ;
77
+
71
78
return (
72
79
< >
73
80
< Header
0 commit comments