From 4d076772e623cc3cb1a51f94551125ad9b791841 Mon Sep 17 00:00:00 2001 From: Felipe Coutinho Date: Fri, 21 Nov 2025 09:40:41 -0300 Subject: [PATCH] refactor: Relocate `PrivacyProvider` to the dashboard layout and update `tsconfig` `jsx` compiler option. --- app/(dashboard)/layout.tsx | 47 ++++++++++++++++++++------------------ app/layout.tsx | 7 ++---- tsconfig.json | 16 +++++++++---- 3 files changed, 39 insertions(+), 31 deletions(-) diff --git a/app/(dashboard)/layout.tsx b/app/(dashboard)/layout.tsx index e429549..8f9ad15 100644 --- a/app/(dashboard)/layout.tsx +++ b/app/(dashboard)/layout.tsx @@ -1,3 +1,4 @@ +import { PrivacyProvider } from "@/components/privacy-provider"; import { SiteHeader } from "@/components/header-dashboard"; import { AppSidebar } from "@/components/sidebar/app-sidebar"; import { SidebarInset, SidebarProvider } from "@/components/ui/sidebar"; @@ -7,7 +8,7 @@ import { fetchPagadoresWithAccess } from "@/lib/pagadores/access"; import { PAGADOR_ROLE_ADMIN } from "@/lib/pagadores/constants"; import { parsePeriodParam } from "@/lib/utils/period"; -export default async function layout({ +export default async function DashboardLayout({ children, searchParams, }: Readonly<{ @@ -40,28 +41,30 @@ export default async function layout({ ); return ( - - ({ - id: item.id, - name: item.name, - avatarUrl: item.avatarUrl, - canEdit: item.canEdit, - }))} - variant="inset" - /> - - -
-
-
- {children} + + + ({ + id: item.id, + name: item.name, + avatarUrl: item.avatarUrl, + canEdit: item.canEdit, + }))} + variant="inset" + /> + + +
+
+
+ {children} +
-
- - + + + ); } diff --git a/app/layout.tsx b/app/layout.tsx index 6cbe371..19d6d28 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,4 +1,3 @@ -import { PrivacyProvider } from "@/components/privacy-provider"; import { ThemeProvider } from "@/components/theme-provider"; import { Toaster } from "@/components/ui/sonner"; import { main_font } from "@/public/fonts/font_index"; @@ -23,10 +22,8 @@ export default function RootLayout({ suppressHydrationWarning > - - {children} - - + {children} + diff --git a/tsconfig.json b/tsconfig.json index 4b73c4b..e7ff3a2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,11 @@ { "compilerOptions": { "target": "ES2017", - "lib": ["dom", "dom.iterable", "esnext"], + "lib": [ + "dom", + "dom.iterable", + "esnext" + ], "allowJs": true, "skipLibCheck": true, "strict": true, @@ -11,7 +15,7 @@ "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModules": true, - "jsx": "preserve", + "jsx": "react-jsx", "incremental": true, "plugins": [ { @@ -19,7 +23,9 @@ } ], "paths": { - "@/*": ["./*"] + "@/*": [ + "./*" + ] } }, "include": [ @@ -29,5 +35,7 @@ ".next/types/**/*.ts", ".next/dev/types/**/*.ts" ], - "exclude": ["node_modules"] + "exclude": [ + "node_modules" + ] }