fix: AuthProvider en layout raíz (login usaba contexto vacío y no hacía nada)
This commit is contained in:
1 parent
9494935775
commit
7d72970f8a
2 files changed
+6
-7
No files matched your search
@@ -1,7 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { AuthProvider, useAuth } from "@/lib/auth";
|
import { useAuth } from "@/lib/auth";
|
||||||
import Sidebar from "@/components/Sidebar";
|
import Sidebar from "@/components/Sidebar";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
@@ -98,9 +98,5 @@ function TopNavbarUser() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default function AppLayout({ children }: { children: React.ReactNode }) {
|
export default function AppLayout({ children }: { children: React.ReactNode }) {
|
||||||
return (
|
return <AppShell>{children}</AppShell>;
|
||||||
<AuthProvider>
|
|
||||||
<AppShell>{children}</AppShell>
|
|
||||||
</AuthProvider>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,7 @@ import type { Metadata } from "next";
|
|||||||
import { Inter } from "next/font/google";
|
import { Inter } from "next/font/google";
|
||||||
import "bootstrap/dist/css/bootstrap.min.css";
|
import "bootstrap/dist/css/bootstrap.min.css";
|
||||||
import "./globals.css";
|
import "./globals.css";
|
||||||
|
import { AuthProvider } from "@/lib/auth";
|
||||||
|
|
||||||
const inter = Inter({
|
const inter = Inter({
|
||||||
variable: "--font-inter",
|
variable: "--font-inter",
|
||||||
@@ -30,7 +31,9 @@ export default function RootLayout({
|
|||||||
href="https://fonts.googleapis.com/css2?family=Fira+Sans:wght@300;400;500;600;700&display=swap"
|
href="https://fonts.googleapis.com/css2?family=Fira+Sans:wght@300;400;500;600;700&display=swap"
|
||||||
/>
|
/>
|
||||||
</head>
|
</head>
|
||||||
<body style={{ fontFamily: "'Fira Sans', sans-serif" }}>{children}</body>
|
<body style={{ fontFamily: "'Fira Sans', sans-serif" }}>
|
||||||
|
<AuthProvider>{children}</AuthProvider>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user