Initialize project using Create React App

This commit is contained in:
Niklas Meinzer
2024-05-20 16:14:23 +02:00
commit 6b6876fdf6
21 changed files with 20678 additions and 0 deletions

23
src/ColorModeSwitcher.js Normal file
View File

@@ -0,0 +1,23 @@
import React from 'react';
import { useColorMode, useColorModeValue, IconButton } from '@chakra-ui/react';
import { FaMoon, FaSun } from 'react-icons/fa';
export const ColorModeSwitcher = props => {
const { toggleColorMode } = useColorMode();
const text = useColorModeValue('dark', 'light');
const SwitchIcon = useColorModeValue(FaMoon, FaSun);
return (
<IconButton
size="md"
fontSize="lg"
aria-label={`Switch to ${text} mode`}
variant="ghost"
color="current"
marginLeft="2"
onClick={toggleColorMode}
icon={<SwitchIcon />}
{...props}
/>
);
};