MCPcopy Create free account
hub / github.com/fontsource/fontsource / ThemeButton

Function ThemeButton

website/app/components/layout/ThemeButton.tsx:27–44  ·  view source on GitHub ↗
({ ...others }: IconProps)

Source from the content-addressed store, hash-verified

25);
26
27export const ThemeButton = ({ ...others }: IconProps) => {
28 const { setColorScheme } = useMantineColorScheme();
29 const colorScheme = useComputedColorScheme('light');
30
31 return (
32 <Tooltip label="Toggle color scheme">
33 <ActionIcon
34 variant="transparent"
35 aria-label="Toggle color scheme"
36 onClick={() => {
37 setColorScheme(colorScheme === 'dark' ? 'light' : 'dark');
38 }}
39 >
40 <ColorSchemeIcons {...others} />
41 </ActionIcon>
42 </Tooltip>
43 );
44};
45
46export const ThemeButtonMobile = ({ ...others }: IconProps) => {
47 const { setColorScheme } = useMantineColorScheme();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected