UI/UX enhancements: refined footer layout, dashboard sidebar fixes, header tweaks, and theme alignment
This commit is contained in:
@@ -37,14 +37,30 @@ export default function RootLayout({
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: `
|
||||
try {
|
||||
if (window.location.pathname.startsWith('/dashboard') || window.location.pathname.startsWith('/cbt')) {
|
||||
if (localStorage.getItem('theme') === 'dark' || (!localStorage.getItem('theme') && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
|
||||
document.documentElement.classList.add('dark')
|
||||
if (window.location.pathname.startsWith('/admin')) {
|
||||
// Admin panel: uses its own separate theme key, defaults to dark
|
||||
const adminTheme = localStorage.getItem('admin-theme');
|
||||
if (adminTheme === 'dark' || !adminTheme) {
|
||||
document.documentElement.classList.add('dark');
|
||||
} else {
|
||||
document.documentElement.classList.remove('dark')
|
||||
document.documentElement.classList.remove('dark');
|
||||
}
|
||||
} else if (window.location.pathname.startsWith('/dashboard') || window.location.pathname.startsWith('/cbt')) {
|
||||
// Dashboard: uses 'theme' key, defaults to light
|
||||
const theme = localStorage.getItem('theme');
|
||||
if (theme === 'dark') {
|
||||
document.documentElement.classList.add('dark');
|
||||
} else {
|
||||
document.documentElement.classList.remove('dark');
|
||||
}
|
||||
} else {
|
||||
document.documentElement.classList.add('dark')
|
||||
// Public pages: uses 'theme' key, defaults to light
|
||||
const theme = localStorage.getItem('theme');
|
||||
if (theme === 'dark') {
|
||||
document.documentElement.classList.add('dark');
|
||||
} else {
|
||||
document.documentElement.classList.remove('dark');
|
||||
}
|
||||
}
|
||||
} catch (_) {}
|
||||
`,
|
||||
|
||||
Reference in New Issue
Block a user