fix: dark mode no admin, links mensagens dashboard, WhatsApp correto - Adicionado botão de dark mode no header do painel admin - Corrigido links do dashboard: /admin/contatos -> /admin/mensagens - Corrigido número WhatsApp: 5535988229445 (formato correto BR)
This commit is contained in:
@@ -5,6 +5,7 @@ import Link from 'next/link';
|
||||
import { usePathname, useRouter } from 'next/navigation';
|
||||
import { useToast } from '@/contexts/ToastContext';
|
||||
import { useConfirm } from '@/contexts/ConfirmContext';
|
||||
import { useTheme } from 'next-themes';
|
||||
|
||||
type TranslationSummary = {
|
||||
slug: string;
|
||||
@@ -22,10 +23,12 @@ export default function AdminLayout({
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
const [showAvatarModal, setShowAvatarModal] = useState(false);
|
||||
const [isUploading, setIsUploading] = useState(false);
|
||||
const [mounted, setMounted] = useState(false);
|
||||
const pathname = usePathname();
|
||||
const router = useRouter();
|
||||
const { success, error } = useToast();
|
||||
const { confirm } = useConfirm();
|
||||
const { theme, setTheme } = useTheme();
|
||||
const [showNotifications, setShowNotifications] = useState(false);
|
||||
const [translationSummary, setTranslationSummary] = useState<TranslationSummary[]>([]);
|
||||
const [isFetchingTranslations, setIsFetchingTranslations] = useState(false);
|
||||
@@ -80,6 +83,7 @@ export default function AdminLayout({
|
||||
}, [success]);
|
||||
|
||||
useEffect(() => {
|
||||
setMounted(true);
|
||||
const fetchUser = async () => {
|
||||
try {
|
||||
const response = await fetch('/api/auth/me');
|
||||
@@ -284,6 +288,19 @@ export default function AdminLayout({
|
||||
</button>
|
||||
|
||||
<div className="flex items-center gap-4">
|
||||
{/* Dark Mode Toggle */}
|
||||
<button
|
||||
onClick={() => setTheme(theme === 'dark' ? 'light' : 'dark')}
|
||||
className="w-10 h-10 rounded-lg hover:bg-gray-100 dark:hover:bg-white/5 flex items-center justify-center text-gray-600 dark:text-yellow-400 transition-colors cursor-pointer"
|
||||
aria-label="Alternar tema"
|
||||
>
|
||||
{mounted && theme === 'dark' ? (
|
||||
<i className="ri-sun-line text-xl"></i>
|
||||
) : (
|
||||
<i className="ri-moon-line text-xl"></i>
|
||||
)}
|
||||
</button>
|
||||
|
||||
<div ref={notificationsRef} className="relative">
|
||||
<button
|
||||
onClick={() => {
|
||||
|
||||
Reference in New Issue
Block a user