diff --git a/.vscode/settings.json b/.vscode/settings.json index 721da1d..84e5108 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -14,6 +14,7 @@ "ecommerce", "iranyekanwebboldfanum", "muirtl", + "nextauth", "nextjs", "Parens", "prefixer", diff --git a/codegen.ts b/codegen.ts index 9dd51bd..84bd5e3 100644 --- a/codegen.ts +++ b/codegen.ts @@ -12,6 +12,9 @@ const config: CodegenConfig = { presetConfig: { fragmentMasking: { unmaskFunctionName: 'getFragmentData' }, }, + config: { + avoidOptionals: true, + }, }, }, overwrite: true, diff --git a/package.json b/package.json index 9b2701e..590c070 100644 --- a/package.json +++ b/package.json @@ -22,11 +22,13 @@ "@mui/material": "^5.15.14", "@mui/material-nextjs": "^5.15.11", "@persian-tools/persian-tools": "^3.5.2", + "@types/js-cookie": "^3.0.6", "add": "^2.0.6", "deepmerge": "^4.3.1", "graphql": "^16.8.1", "graphql-request": "^7.0.1", "jotai": "^2.8.1", + "js-cookie": "^3.0.5", "material-ui-confirm": "^3.0.7", "next": "^14.2.3", "next-auth": "^4.24.10", diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..79ea17e --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,4 @@ +user-agent: * +disallow: /card +disallow: /checkout +disallow: /profile* \ No newline at end of file diff --git a/src/@types/global.d.ts b/src/@types/global.d.ts index cbf1198..d9318fb 100644 --- a/src/@types/global.d.ts +++ b/src/@types/global.d.ts @@ -1,8 +1,18 @@ import en from '../data/i18n/en.json'; - type Messages = typeof en; declare global { // Use type safe message keys with `next-intl` interface IntlMessages extends Messages {} + + namespace NodeJS { + interface ProcessEnv { + NEXT_PUBLIC_WOOCOMMERCE_SESSION_KEY: string; + NEXT_PUBLIC_GRAPHQL_URL: string; + } + } + + type Nullable = { + [P in keyof T]: T[P] | null; + }; } diff --git a/src/app/[locale]/(auth)/account/signin/confirm/page.tsx b/src/app/[locale]/(auth)/account/signin/confirm/page.tsx index b14e07f..5651e65 100644 --- a/src/app/[locale]/(auth)/account/signin/confirm/page.tsx +++ b/src/app/[locale]/(auth)/account/signin/confirm/page.tsx @@ -1,6 +1,6 @@ 'use client'; -import { SIGN_IN_PAGE_PATHNAME } from '@/app/api/auth/[...nextauth]/route'; +import { SIGN_IN_PAGE_PATHNAME } from '@/config/routes'; import Logo from '@/components/common/Logo'; import { useAppContext } from '@/hooks/useAppContext'; import { Link } from '@/navigation'; @@ -154,6 +154,7 @@ const Page = () => { renderer={(props) => { return (