11import { getEnv } from '@/lib/env'
22
3+ export interface ThemeColors {
4+ primaryColor ?: string
5+ primaryHoverColor ?: string
6+ secondaryColor ?: string
7+ accentColor ?: string
8+ accentHoverColor ?: string
9+ backgroundColor ?: string
10+ }
11+
312export interface BrandConfig {
413 name : string
514 logoUrl ?: string
@@ -9,6 +18,7 @@ export interface BrandConfig {
918 documentationUrl ?: string
1019 termsUrl ?: string
1120 privacyUrl ?: string
21+ theme ?: ThemeColors
1222}
1323
1424/**
@@ -23,6 +33,29 @@ const defaultConfig: BrandConfig = {
2333 documentationUrl : undefined ,
2434 termsUrl : undefined ,
2535 privacyUrl : undefined ,
36+ theme : {
37+ primaryColor : '#701ffc' ,
38+ primaryHoverColor : '#802fff' ,
39+ secondaryColor : '#6518e6' ,
40+ accentColor : '#9d54ff' ,
41+ accentHoverColor : '#a66fff' ,
42+ backgroundColor : '#0c0c0c' ,
43+ } ,
44+ }
45+
46+ const getThemeColors = ( ) : ThemeColors => {
47+ return {
48+ primaryColor : getEnv ( 'NEXT_PUBLIC_BRAND_PRIMARY_COLOR' ) || defaultConfig . theme ?. primaryColor ,
49+ primaryHoverColor :
50+ getEnv ( 'NEXT_PUBLIC_BRAND_PRIMARY_HOVER_COLOR' ) || defaultConfig . theme ?. primaryHoverColor ,
51+ secondaryColor :
52+ getEnv ( 'NEXT_PUBLIC_BRAND_SECONDARY_COLOR' ) || defaultConfig . theme ?. secondaryColor ,
53+ accentColor : getEnv ( 'NEXT_PUBLIC_BRAND_ACCENT_COLOR' ) || defaultConfig . theme ?. accentColor ,
54+ accentHoverColor :
55+ getEnv ( 'NEXT_PUBLIC_BRAND_ACCENT_HOVER_COLOR' ) || defaultConfig . theme ?. accentHoverColor ,
56+ backgroundColor :
57+ getEnv ( 'NEXT_PUBLIC_BRAND_BACKGROUND_COLOR' ) || defaultConfig . theme ?. backgroundColor ,
58+ }
2659}
2760
2861/**
@@ -39,6 +72,7 @@ export const getBrandConfig = (): BrandConfig => {
3972 documentationUrl : getEnv ( 'NEXT_PUBLIC_DOCUMENTATION_URL' ) || defaultConfig . documentationUrl ,
4073 termsUrl : getEnv ( 'NEXT_PUBLIC_TERMS_URL' ) || defaultConfig . termsUrl ,
4174 privacyUrl : getEnv ( 'NEXT_PUBLIC_PRIVACY_URL' ) || defaultConfig . privacyUrl ,
75+ theme : getThemeColors ( ) ,
4276 }
4377}
4478
0 commit comments