Skip to content

Commit

Permalink
fix: Extract tRPC provider from Providers
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-dalmet committed Oct 5, 2023
1 parent 1616c49 commit fe16e49
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
13 changes: 8 additions & 5 deletions src/app/Document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { Viewport } from '@/components/Viewport';
import { EnvDevHint } from '@/layout/EnvDevHint';
import i18n from '@/lib/i18n/client';
import { AVAILABLE_LANGUAGES } from '@/lib/i18n/constants';
import { TrpcProvider } from '@/lib/trpc/TrpcProvider';
import theme, { COLOR_MODE_STORAGE_KEY } from '@/theme';

export const Document = ({ children }: { children: ReactNode }) => {
Expand Down Expand Up @@ -68,11 +69,13 @@ export const Document = ({ children }: { children: ReactNode }) => {
storageKey={COLOR_MODE_STORAGE_KEY}
/>

<Providers>
<Viewport>{children}</Viewport>
<EnvDevHint />
<ReactQueryDevtools initialIsOpen={false} />
</Providers>
<TrpcProvider>
<Providers>
<Viewport>{children}</Viewport>
<EnvDevHint />
<ReactQueryDevtools initialIsOpen={false} />
</Providers>
</TrpcProvider>
</body>
</html>
);
Expand Down
3 changes: 1 addition & 2 deletions src/app/Providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { useTranslation } from 'react-i18next';
import '@/lib/dayjs/config';
import '@/lib/i18n/client';
import { AVAILABLE_LANGUAGES } from '@/lib/i18n/constants';
import { TrpcProvider } from '@/lib/trpc/TrpcProvider';
import theme, { COLOR_MODE_STORAGE_KEY } from '@/theme';

const localStorageManager = createLocalStorageManager(COLOR_MODE_STORAGE_KEY);
Expand All @@ -28,7 +27,7 @@ export const Providers: FC<React.PropsWithChildren<unknown>> = ({
'ltr',
}}
>
<TrpcProvider>{children}</TrpcProvider>
{children}
</ChakraProvider>
</CacheProvider>
);
Expand Down

1 comment on commit fe16e49

@vercel
Copy link

@vercel vercel bot commented on fe16e49 Oct 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.