Feat Modo Oscuro y Otras Estéticas
This commit is contained in:
20
frontend/src/components/ThemeToggle.tsx
Normal file
20
frontend/src/components/ThemeToggle.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
// frontend/src/components/ThemeToggle.tsx
|
||||
import { Sun, Moon } from 'lucide-react';
|
||||
import { useTheme } from '../context/ThemeContext';
|
||||
import './ThemeToggle.css';
|
||||
|
||||
const ThemeToggle = () => {
|
||||
const { theme, toggleTheme } = useTheme();
|
||||
|
||||
return (
|
||||
<button
|
||||
className="theme-toggle-button"
|
||||
onClick={toggleTheme}
|
||||
title={theme === 'light' ? 'Activar modo oscuro' : 'Activar modo claro'}
|
||||
>
|
||||
{theme === 'light' ? <Moon size={20} /> : <Sun size={20} />}
|
||||
</button>
|
||||
);
|
||||
};
|
||||
|
||||
export default ThemeToggle;
|
||||
Reference in New Issue
Block a user