Skip to content

Commit 5ff937b

Browse files
Fix typing issue with theme info
1 parent dd942b5 commit 5ff937b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/components/LiveGraph.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* SPDX-License-Identifier: MIT
66
*/
7-
import { Box, useTheme } from "@chakra-ui/react";
7+
import { Box, useToken } from "@chakra-ui/react";
88
import { useSize } from "@chakra-ui/react-use-size";
99
import { AccelerometerDataEvent } from "@microbit/microbit-connection";
1010
import { useCallback, useEffect, useRef } from "react";
@@ -345,8 +345,7 @@ const LiveGraph = () => {
345345
const [{ graphColorScheme, graphLineScheme, graphLineWeight }] =
346346
useSettings();
347347

348-
const theme = useTheme();
349-
const fontFamily: string = theme.fonts?.body ?? "sans-serif";
348+
const [fontFamily] = useToken("fonts", ["body"]);
350349
const colors = useGraphColors(graphColorScheme);
351350
const lineStyles = useGraphLineStyles(graphLineScheme);
352351
const canvasRef = useRef<HTMLCanvasElement>(null);

0 commit comments

Comments
 (0)