From c51b5d150071dd8b978924e9e069b71d50744495 Mon Sep 17 00:00:00 2001 From: Gokhan Ozturk Date: Thu, 16 May 2024 23:41:44 +0300 Subject: [PATCH] refactor: Update ThemeProvider to include theme icons and improve dark mode toggle styling --- app/components/ThemeProvider.jsx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/app/components/ThemeProvider.jsx b/app/components/ThemeProvider.jsx index 5fe88c5..0d50d21 100644 --- a/app/components/ThemeProvider.jsx +++ b/app/components/ThemeProvider.jsx @@ -2,9 +2,9 @@ import * as React from 'react' import { ThemeProvider as NextThemesProvider, useTheme } from 'next-themes' - -import cn from 'classnames' import { animated, useSpring } from 'react-spring' +import cn from 'classnames' +import { ComputerDesktopIcon, MoonIcon, SunIcon } from '@heroicons/react/24/outline' export function ThemeProvider({ children, ...props }) { return {children} @@ -67,10 +67,16 @@ export function DarkModeToggle() { }) } + const themeIcon = { + light: , + dark: , + system: , + } + return ( + className='relative z-0 flex gap-1 rounded-md bg-yellow-50 p-1 dark:bg-gray-800'> {themes.map(t => ( handlePointerOut(t)} > {t} + {themeIcon[t]} ))}