about summary refs log tree commit diff
path: root/src/alf/index.tsx
diff options
context:
space:
mode:
authorHailey <me@haileyok.com>2024-11-09 16:24:51 -0800
committerGitHub <noreply@github.com>2024-11-09 16:24:51 -0800
commit89c93313a3fc3123a2e53856f53cc8cea8e693fa (patch)
treef0189bdd75fcdb151ed74f8b43057ddee631b907 /src/alf/index.tsx
parent3aeee1e4aa9ae76d2c3638ab2fad54d7171effbf (diff)
downloadvoidsky-89c93313a3fc3123a2e53856f53cc8cea8e693fa.tar.zst
android scroll performance fixes pt. 1 (#6196)
Diffstat (limited to 'src/alf/index.tsx')
-rw-r--r--src/alf/index.tsx53
1 files changed, 25 insertions, 28 deletions
diff --git a/src/alf/index.tsx b/src/alf/index.tsx
index f9d93d4ca..5d08722ff 100644
--- a/src/alf/index.tsx
+++ b/src/alf/index.tsx
@@ -103,35 +103,32 @@ export function ThemeProvider({
     })
   }, [])
 
-  return (
-    <Context.Provider
-      value={React.useMemo<Alf>(
-        () => ({
-          themes,
-          themeName: themeName,
-          theme: themes[themeName],
-          fonts: {
-            scale: fontScale,
-            scaleMultiplier: fontScaleMultiplier,
-            family: fontFamily,
-            setFontScale: setFontScaleAndPersist,
-            setFontFamily: setFontFamilyAndPersist,
-          },
-          flags: {},
-        }),
-        [
-          themeName,
-          themes,
-          fontScale,
-          setFontScaleAndPersist,
-          fontFamily,
-          setFontFamilyAndPersist,
-          fontScaleMultiplier,
-        ],
-      )}>
-      {children}
-    </Context.Provider>
+  const value = React.useMemo<Alf>(
+    () => ({
+      themes,
+      themeName: themeName,
+      theme: themes[themeName],
+      fonts: {
+        scale: fontScale,
+        scaleMultiplier: fontScaleMultiplier,
+        family: fontFamily,
+        setFontScale: setFontScaleAndPersist,
+        setFontFamily: setFontFamilyAndPersist,
+      },
+      flags: {},
+    }),
+    [
+      themeName,
+      themes,
+      fontScale,
+      setFontScaleAndPersist,
+      fontFamily,
+      setFontFamilyAndPersist,
+      fontScaleMultiplier,
+    ],
   )
+
+  return <Context.Provider value={value}>{children}</Context.Provider>
 }
 
 export function useAlf() {