Skip to content

Commit f1e4bee

Browse files
authored
refactor(app): move provider composition to src/app/providers/AppProviders.tsx (#52)
1 parent 57f9d60 commit f1e4bee

5 files changed

Lines changed: 19 additions & 9 deletions

File tree

app/layout.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
import 'app/styles/global.css';
2-
import { QueryProvider } from 'shared/providers';
3-
import { Toaster, TooltipProvider } from 'shared/ui';
4-
import FrontendObservability from 'shared/config/metrics/FrontendObservability';
2+
import { AppProviders } from 'app/providers/AppProviders';
53

64
export default function RootLayout({ children }: { children: React.ReactNode }) {
75
return (
86
<html lang="en">
97
<body>
10-
<FrontendObservability />
11-
<QueryProvider>
12-
<TooltipProvider>{children}</TooltipProvider>
13-
</QueryProvider>
14-
<Toaster richColors />
8+
<AppProviders>{children}</AppProviders>
159
</body>
1610
</html>
1711
);

src/app/providers/AppProviders.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { PropsWithChildren } from 'react';
2+
import { QueryProvider } from './QueryProvider';
3+
import { Toaster, TooltipProvider } from 'shared/ui';
4+
import { FrontendObservability } from 'shared/config/';
5+
6+
export function AppProviders({ children }: PropsWithChildren) {
7+
return (
8+
<>
9+
<FrontendObservability />
10+
<QueryProvider>
11+
<TooltipProvider>{children}</TooltipProvider>
12+
</QueryProvider>
13+
<Toaster richColors />
14+
</>
15+
);
16+
}

src/shared/config/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export { routes } from './routes';
2+
export { default as FrontendObservability } from './metrics/FrontendObservability';

src/shared/providers/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)