diff --git a/package.json b/package.json index bab93be07..1fc1855d1 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ "lucia": "3.2.0", "next": "14.2.4", "nodemailer": "6.9.14", - "nuqs": "1.17.4", + "nuqs": "2.1.1", "oslo": "1.2.1", "pino": "9.2.0", "pino-pretty": "11.2.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 52f5cf50e..755ce77e2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -111,8 +111,8 @@ importers: specifier: 6.9.14 version: 6.9.14 nuqs: - specifier: 1.17.4 - version: 1.17.4(next@14.2.4(@babel/core@7.24.7)(@playwright/test@1.45.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) + specifier: 2.1.1 + version: 2.1.1(next@14.2.4(@babel/core@7.24.7)(@playwright/test@1.45.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-router-dom@5.3.4(react@18.3.1))(react@18.3.1) oslo: specifier: 1.2.1 version: 1.2.1 @@ -218,7 +218,7 @@ importers: version: 8.1.11(react@18.3.1) '@storybook/nextjs': specifier: 8.1.11 - version: 8.1.11(@types/webpack@5.28.5(esbuild@0.20.2))(encoding@0.1.13)(esbuild@0.20.2)(next@14.2.4(@babel/core@7.24.7)(@playwright/test@1.45.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(prettier@3.3.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(type-fest@4.21.0)(typescript@5.5.3)(vitest@2.0.1(@types/node@20.14.10)(@vitest/ui@2.0.1)(jsdom@24.1.0)(terser@5.26.0))(webpack-hot-middleware@2.26.0)(webpack@5.89.0(esbuild@0.20.2)) + version: 8.1.11(@types/webpack@5.28.5(esbuild@0.20.2))(encoding@0.1.13)(esbuild@0.20.2)(next@14.2.4(@babel/core@7.24.7)(@playwright/test@1.45.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(prettier@3.3.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(type-fest@4.21.0)(typescript@5.5.3)(vitest@2.0.1)(webpack-hot-middleware@2.26.0)(webpack@5.89.0(esbuild@0.20.2)) '@storybook/react': specifier: 8.1.11 version: 8.1.11(encoding@0.1.13)(prettier@3.3.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.5.3) @@ -7704,10 +7704,20 @@ packages: nth-check@2.1.1: resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} - nuqs@1.17.4: - resolution: {integrity: sha512-wraphFfKI+Y/aWIGFsld/Ta7fTFEyeya1LkgEGNPDiMuY+Hwea/eVHBiq1GYlyMqTYSAoxRWvQyjCIo1Dy1u7g==} + nuqs@2.1.1: + resolution: {integrity: sha512-iM2H8lMmhvk9bxupUs2oRle9usRNEAqppOkTMXOxD/uK85gOKAubU7T2zmPo8fnYQS4n5e/XswTiq+gLYGpy3w==} peerDependencies: - next: '>=13.4 <14.0.2 || ^14.0.3' + '@remix-run/react': '>= 2' + next: '>= 14.2.0' + react: '>= 18.2.0' + react-router-dom: '>= 6' + peerDependenciesMeta: + '@remix-run/react': + optional: true + next: + optional: true + react-router-dom: + optional: true nwsapi@2.2.10: resolution: {integrity: sha512-QK0sRs7MKv0tKe1+5uZIQk/C8XGza4DAnztJG8iD+TpJIORARrCxczA738awHrZoHeTjSSoHqao2teO0dC/gFQ==} @@ -14120,7 +14130,7 @@ snapshots: '@storybook/manager@8.1.11': {} - '@storybook/nextjs@8.1.11(@types/webpack@5.28.5(esbuild@0.20.2))(encoding@0.1.13)(esbuild@0.20.2)(next@14.2.4(@babel/core@7.24.7)(@playwright/test@1.45.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(prettier@3.3.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(type-fest@4.21.0)(typescript@5.5.3)(vitest@2.0.1(@types/node@20.14.10)(@vitest/ui@2.0.1)(jsdom@24.1.0)(terser@5.26.0))(webpack-hot-middleware@2.26.0)(webpack@5.89.0(esbuild@0.20.2))': + '@storybook/nextjs@8.1.11(@types/webpack@5.28.5(esbuild@0.20.2))(encoding@0.1.13)(esbuild@0.20.2)(next@14.2.4(@babel/core@7.24.7)(@playwright/test@1.45.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(prettier@3.3.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(type-fest@4.21.0)(typescript@5.5.3)(vitest@2.0.1)(webpack-hot-middleware@2.26.0)(webpack@5.89.0(esbuild@0.20.2))': dependencies: '@babel/core': 7.24.7 '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.24.7) @@ -14143,7 +14153,7 @@ snapshots: '@storybook/preset-react-webpack': 8.1.11(encoding@0.1.13)(esbuild@0.20.2)(prettier@3.3.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.5.3) '@storybook/preview-api': 8.1.11 '@storybook/react': 8.1.11(encoding@0.1.13)(prettier@3.3.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.5.3) - '@storybook/test': 8.1.11(vitest@2.0.1(@types/node@20.14.10)(@vitest/ui@2.0.1)(jsdom@24.1.0)(terser@5.26.0)) + '@storybook/test': 8.1.11(vitest@2.0.1) '@storybook/types': 8.1.11 '@types/node': 18.19.4 '@types/semver': 7.5.6 @@ -14328,14 +14338,14 @@ snapshots: - prettier - supports-color - '@storybook/test@8.1.11(vitest@2.0.1(@types/node@20.14.10)(@vitest/ui@2.0.1)(jsdom@24.1.0)(terser@5.26.0))': + '@storybook/test@8.1.11(vitest@2.0.1)': dependencies: '@storybook/client-logger': 8.1.11 '@storybook/core-events': 8.1.11 '@storybook/instrumenter': 8.1.11 '@storybook/preview-api': 8.1.11 '@testing-library/dom': 10.1.0 - '@testing-library/jest-dom': 6.4.5(vitest@2.0.1(@types/node@20.14.10)(@vitest/ui@2.0.1)(jsdom@24.1.0)(terser@5.26.0)) + '@testing-library/jest-dom': 6.4.5(vitest@2.0.1) '@testing-library/user-event': 14.5.2(@testing-library/dom@10.1.0) '@vitest/expect': 1.6.0 '@vitest/spy': 1.6.0 @@ -14556,7 +14566,7 @@ snapshots: lz-string: 1.5.0 pretty-format: 27.5.1 - '@testing-library/jest-dom@6.4.5(vitest@2.0.1(@types/node@20.14.10)(@vitest/ui@2.0.1)(jsdom@24.1.0)(terser@5.26.0))': + '@testing-library/jest-dom@6.4.5(vitest@2.0.1)': dependencies: '@adobe/css-tools': 4.3.3 '@babel/runtime': 7.24.5 @@ -17260,7 +17270,7 @@ snapshots: debug: 4.3.4 enhanced-resolve: 5.15.0 eslint: 8.57.0 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.17.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.17.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint@8.57.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.17.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.3.1(eslint@8.57.0)(typescript@5.5.3))(eslint@8.57.0) fast-glob: 3.3.2 get-tsconfig: 4.7.2 @@ -17272,7 +17282,7 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-module-utils@2.8.0(@typescript-eslint/parser@6.17.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.17.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint@8.57.0): + eslint-module-utils@2.8.0(@typescript-eslint/parser@6.17.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): dependencies: debug: 3.2.7 optionalDependencies: @@ -17293,7 +17303,7 @@ snapshots: doctrine: 2.1.0 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.17.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.17.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint@8.57.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.17.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) hasown: 2.0.0 is-core-module: 2.13.1 is-glob: 4.0.3 @@ -19364,10 +19374,13 @@ snapshots: dependencies: boolbase: 1.0.0 - nuqs@1.17.4(next@14.2.4(@babel/core@7.24.7)(@playwright/test@1.45.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)): + nuqs@2.1.1(next@14.2.4(@babel/core@7.24.7)(@playwright/test@1.45.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-router-dom@5.3.4(react@18.3.1))(react@18.3.1): dependencies: mitt: 3.0.1 + react: 18.3.1 + optionalDependencies: next: 14.2.4(@babel/core@7.24.7)(@playwright/test@1.45.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + react-router-dom: 5.3.4(react@18.3.1) nwsapi@2.2.10: {} diff --git a/src/app/Document.tsx b/src/app/Document.tsx index f098151b0..452095079 100644 --- a/src/app/Document.tsx +++ b/src/app/Document.tsx @@ -4,6 +4,7 @@ import { ReactNode } from 'react'; import { ColorModeScript } from '@chakra-ui/react'; import { ReactQueryDevtools } from '@tanstack/react-query-devtools'; +import { NuqsAdapter } from 'nuqs/adapters/next/app'; import { Providers } from '@/app/Providers'; import { Viewport } from '@/components/Viewport'; @@ -63,11 +64,13 @@ export const Document = ({ children }: { children: ReactNode }) => { storageKey={COLOR_MODE_STORAGE_KEY} /> - - {children} - - - + + + {children} + + + + diff --git a/src/features/account/AccountDeleteVerificationCodeModal.tsx b/src/features/account/AccountDeleteVerificationCodeModal.tsx index 9c8caa46d..3da08511f 100644 --- a/src/features/account/AccountDeleteVerificationCodeModal.tsx +++ b/src/features/account/AccountDeleteVerificationCodeModal.tsx @@ -42,11 +42,7 @@ export const AccountDeleteVerificationCodeModale = () => { ); const onClose = () => { - setSearchParams({ - [SEARCH_PARAM_VERIFY_EMAIL]: null, - token: null, - attempts: null, - }); + setSearchParams(null); }; const form = useForm({ diff --git a/src/features/account/EmailVerificationCodeModal.tsx b/src/features/account/EmailVerificationCodeModal.tsx index 598d9a135..06a83f401 100644 --- a/src/features/account/EmailVerificationCodeModal.tsx +++ b/src/features/account/EmailVerificationCodeModal.tsx @@ -35,11 +35,7 @@ export const EmailVerificationCodeModale = () => { const onClose = () => { trpcUtils.account.get.reset(); - setSearchParams({ - verifyEmail: null, - token: null, - attempts: null, - }); + setSearchParams(null); }; const form = useForm({