Skip to content

Commit aeaf725

Browse files
feat: some changes after lib author awesome review
1 parent 630b149 commit aeaf725

File tree

4 files changed

+9
-20
lines changed

4 files changed

+9
-20
lines changed

src/app/Document.tsx

+5-9
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { ReactNode } from 'react';
44

55
import { ColorModeScript } from '@chakra-ui/react';
66
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
7-
import { NuqsAdapter } from 'nuqs/adapters/next/app';
87

98
import { Providers } from '@/app/Providers';
109
import { Viewport } from '@/components/Viewport';
@@ -64,14 +63,11 @@ export const Document = ({ children }: { children: ReactNode }) => {
6463
storageKey={COLOR_MODE_STORAGE_KEY}
6564
/>
6665
<Providers>
67-
{/* Putting nuqs adapter here and not in providers as the testing requires another adapter */}
68-
<NuqsAdapter>
69-
<TrpcProvider>
70-
<Viewport>{children}</Viewport>
71-
<EnvHint />
72-
<ReactQueryDevtools initialIsOpen={false} />
73-
</TrpcProvider>
74-
</NuqsAdapter>
66+
<TrpcProvider>
67+
<Viewport>{children}</Viewport>
68+
<EnvHint />
69+
<ReactQueryDevtools initialIsOpen={false} />
70+
</TrpcProvider>
7571
</Providers>
7672
</body>
7773
</html>

src/app/Providers.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { FC } from 'react';
22

33
import { CacheProvider } from '@chakra-ui/next-js';
44
import { ChakraProvider, createLocalStorageManager } from '@chakra-ui/react';
5+
import { NuqsAdapter } from 'nuqs/adapters/next/app';
56
import { useTranslation } from 'react-i18next';
67
import { Toaster } from 'sonner';
78

@@ -28,7 +29,7 @@ export const Providers: FC<React.PropsWithChildren<unknown>> = ({
2829
'ltr',
2930
}}
3031
>
31-
{children}
32+
<NuqsAdapter>{children}</NuqsAdapter>s
3233
<Toaster position="top-right" offset={16} />
3334
</ChakraProvider>
3435
</CacheProvider>

src/features/account/AccountDeleteVerificationCodeModal.tsx

+1-5
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,7 @@ export const AccountDeleteVerificationCodeModale = () => {
4242
);
4343

4444
const onClose = () => {
45-
setSearchParams({
46-
[SEARCH_PARAM_VERIFY_EMAIL]: null,
47-
token: null,
48-
attempts: null,
49-
});
45+
setSearchParams(null);
5046
};
5147

5248
const form = useForm<FormFieldsVerificationCode>({

src/features/account/EmailVerificationCodeModal.tsx

+1-5
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,7 @@ export const EmailVerificationCodeModale = () => {
3535

3636
const onClose = () => {
3737
trpcUtils.account.get.reset();
38-
setSearchParams({
39-
verifyEmail: null,
40-
token: null,
41-
attempts: null,
42-
});
38+
setSearchParams(null);
4339
};
4440

4541
const form = useForm<FormFieldsVerificationCode>({

0 commit comments

Comments
 (0)