fix frontend bugs
This commit is contained in:
@@ -165,13 +165,11 @@ import { useAuthStore } from "~/stores/auth-store.js";
|
||||
const authStore = useAuthStore();
|
||||
const router = useRouter();
|
||||
|
||||
// State
|
||||
const isDark = ref(false);
|
||||
const isUserMenuOpen = ref(false);
|
||||
const isMobileMenuOpen = ref(false);
|
||||
const userMenuRef = ref(null);
|
||||
|
||||
// Toggle Dark Mode
|
||||
function toggleDark() {
|
||||
isDark.value = !isDark.value;
|
||||
if (isDark.value) {
|
||||
@@ -183,7 +181,6 @@ function toggleDark() {
|
||||
}
|
||||
}
|
||||
|
||||
// Navigation Links
|
||||
const navLinks = [
|
||||
{ name: 'Profile', path: '/profile' },
|
||||
];
|
||||
@@ -208,13 +205,11 @@ function closeDropdowns(event) {
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
// Initialize Theme
|
||||
if (localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
|
||||
isDark.value = true;
|
||||
document.documentElement.classList.add('dark');
|
||||
}
|
||||
|
||||
// Click listener for closing dropdowns
|
||||
window.addEventListener('click', closeDropdowns);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user