-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8716d10
commit 9928858
Showing
4 changed files
with
34 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,24 @@ | ||
import { Flex, Switch, Text } from "@radix-ui/themes"; | ||
import { Button, Flex, Switch, Text } from "@radix-ui/themes"; | ||
import { useCallback } from "react"; | ||
import chime3 from "../../assets/audio/chime_3.mp3"; | ||
import useTheme from "../../hooks/useTheme"; | ||
|
||
export default function GeneralEditor({}) { | ||
const { colorTheme, toggleColorTheme } = useTheme(); | ||
|
||
const testAudio = useCallback(() => { | ||
const audio = new Audio(chime3); | ||
audio.play(); | ||
}, []); | ||
|
||
return ( | ||
<Flex direction="column" justify="center" align="center" gap="2" width="100%" p="1"> | ||
<Flex direction="column" justify="center" align="center" gap="2" width="100%" p="1" gap="4"> | ||
<Flex direction="row" gap="2"> | ||
<Switch radius="small" checked={colorTheme === "light"} onCheckedChange={toggleColorTheme} /> | ||
<Text size="2">Light mode</Text> | ||
</Flex> | ||
|
||
<Button onClick={testAudio}>Test audio</Button> | ||
</Flex> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters