@@ -11,6 +11,7 @@ import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from "
1111import { Card , CardContent } from "@/components/ui/card" ;
1212import { Tooltip , TooltipContent , TooltipProvider , TooltipTrigger } from "@/components/ui/tooltip" ;
1313import { useToast } from "@/hooks/use-toast" ;
14+ import { useTheme } from "@/hooks/use-theme" ;
1415import {
1516 Zap ,
1617 Copy ,
@@ -26,7 +27,9 @@ import {
2627 Smile ,
2728 Calendar ,
2829 Info ,
29- Utensils
30+ Utensils ,
31+ Sun ,
32+ Moon
3033} from "lucide-react" ;
3134
3235const rpeOptions = [
@@ -170,6 +173,7 @@ function generateMarkdown(data: InsertWorkout): string {
170173
171174export default function Home ( ) {
172175 const { toast } = useToast ( ) ;
176+ const { theme, toggleTheme } = useTheme ( ) ;
173177 const [ markdownOutput , setMarkdownOutput ] = useState ( "" ) ;
174178
175179 const form = useForm < InsertWorkout > ( {
@@ -276,6 +280,13 @@ export default function Home() {
276280 < div className = "text-sm text-gray-500 dark:text-gray-400 text-center sm:text-right" >
277281 Privacy-first training journal for cyclists
278282 </ div >
283+ < button
284+ onClick = { toggleTheme }
285+ aria-label = { theme === "dark" ? "Switch to light mode" : "Switch to dark mode" }
286+ className = "p-2 rounded-md text-gray-500 hover:text-gray-900 hover:bg-gray-100 dark:text-gray-400 dark:hover:text-white dark:hover:bg-gray-700 transition-colors"
287+ >
288+ { theme === "dark" ? < Sun className = "w-5 h-5" /> : < Moon className = "w-5 h-5" /> }
289+ </ button >
279290 </ div >
280291 </ div >
281292 </ header >
@@ -296,14 +307,14 @@ export default function Home() {
296307 < Form { ...form } >
297308 < form className = "space-y-6" >
298309 { /* Date Section */ }
299- < div className = "bg-gray-50 rounded-lg p-4" >
310+ < div className = "bg-gray-50 dark:bg-gray-700 rounded-lg p-4" >
300311 < FormField
301312 control = { form . control }
302313 name = "workoutDate"
303314 render = { ( { field } ) => (
304315 < FormItem >
305316 < FormLabel className = "flex items-center gap-2" >
306- < Calendar className = "w-4 h-4 text-blue-600" />
317+ < Calendar className = "w-4 h-4 text-blue-600 dark:text-blue-400 " />
307318 Workout Date
308319 </ FormLabel >
309320 < FormControl >
0 commit comments