Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
fix: add toast
Browse files Browse the repository at this point in the history
  • Loading branch information
reneaaron committed Jul 4, 2024
1 parent 7df02c8 commit 0f21d39
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions frontend/src/screens/settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ import {
Themes,
useTheme,
} from "src/components/ui/theme-provider";
import { toast } from "src/components/ui/use-toast";

function Settings() {
const { theme, darkMode, setTheme, setDarkMode } = useTheme();

return (
<>
<SettingsHeader
Expand All @@ -27,7 +29,10 @@ function Settings() {
<Label htmlFor="theme">Theme</Label>
<Select
value={theme}
onValueChange={(value) => setTheme(value as Theme)}
onValueChange={(value) => {
setTheme(value as Theme);
toast({ title: "Theme updated." });
}}
>
<SelectTrigger className="w-[150px]">
<SelectValue placeholder="Theme" />
Expand All @@ -45,7 +50,10 @@ function Settings() {
<Label htmlFor="theme">Dark mode</Label>
<Select
value={darkMode}
onValueChange={(value) => setDarkMode(value as DarkMode)}
onValueChange={(value) => {
setDarkMode(value as DarkMode);
toast({ title: "Dark Mode updated." });
}}
>
<SelectTrigger className="w-[150px]">
<SelectValue placeholder="Dark mode" />
Expand Down

0 comments on commit 0f21d39

Please sign in to comment.