File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -20,8 +20,14 @@ export function cn(...inputs: ClassValue[]) {
2020 return twMerge ( clsx ( inputs ) ) ;
2121}
2222
23- // https://react.dev/reference/react/cache#caveats
24- // > React will invalidate the cache for all memoized functions for each server request.
23+ /**
24+ * Get the app configuration
25+ * @param headers - The headers of the request
26+ * @returns The app configuration
27+ *
28+ * @note React will invalidate the cache for all memoized functions for each server request.
29+ * https://react.dev/reference/react/cache#caveats
30+ */
2531export const getAppConfig = cache ( async ( headers : Headers ) : Promise < AppConfig > => {
2632 if ( CONFIG_ENDPOINT ) {
2733 const sandboxId = SANDBOX_ID ?? headers . get ( 'x-sandbox-id' ) ?? '' ;
@@ -70,9 +76,11 @@ export const getAppConfig = cache(async (headers: Headers): Promise<AppConfig> =
7076 return APP_CONFIG_DEFAULTS ;
7177} ) ;
7278
73- // check provided accent colors against defaults
74- // apply styles if they differ (or in development mode)
75- // generate a hover color for the accent color by mixing it with 20% black
79+ /**
80+ * Get styles for the app
81+ * @param appConfig - The app configuration
82+ * @returns A string of styles
83+ */
7684export function getStyles ( appConfig : AppConfig ) {
7785 const { accent, accentDark } = appConfig ;
7886
You can’t perform that action at this time.
0 commit comments