- Moved authentication hooks and context to a dedicated hooks directory. - Updated imports in various components and pages to use the new hooks. - Created AuthContext and ThemeContext for better state management. - Refactored ThemeProvider to utilize the new ThemeContext. - Cleaned up sidebar and button components for consistency and readability. - Ensured all components are using the latest context and hooks for authentication and theme management.
11 lines
299 B
TypeScript
11 lines
299 B
TypeScript
import { useContext } from 'react'
|
|
import { ThemeProviderContext } from '@/contexts/ThemeContext'
|
|
|
|
export const useTheme = () => {
|
|
const context = useContext(ThemeProviderContext)
|
|
|
|
if (context === undefined)
|
|
throw new Error('useTheme must be used within a ThemeProvider')
|
|
|
|
return context
|
|
} |