From 508b7af39fa620eeb7dfa5a15a18925bf986cb92 Mon Sep 17 00:00:00 2001 From: Koosha Lahouti Date: Tue, 12 Aug 2025 04:23:08 +0330 Subject: [PATCH] chore: add icons and toast --- package-lock.json | 660 ++++++++++-------- public/locales/en/country.json | 247 +++++++ public/locales/fa/completionForm.json | 7 +- public/locales/fa/country.json | 182 +++++ src/App.tsx | 14 +- src/components/CountryFlag.tsx | 34 + src/components/Toast.tsx | 2 +- .../components/EmailSection.tsx | 47 +- .../components/PasswordSection.tsx | 88 ++- .../components/PasswordValidation.tsx | 9 +- .../components/PersonalInfoFields.tsx | 98 +-- .../components/UserCompletionForm.tsx | 142 ++-- src/features/authentication/data/Countries.ts | 271 +++++++ .../authentication/data/Countries.tsx | 33 - 14 files changed, 1250 insertions(+), 584 deletions(-) create mode 100644 public/locales/en/country.json create mode 100644 public/locales/fa/country.json create mode 100644 src/components/CountryFlag.tsx create mode 100644 src/features/authentication/data/Countries.ts delete mode 100644 src/features/authentication/data/Countries.tsx diff --git a/package-lock.json b/package-lock.json index 2bc9fc9..c92b448 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,9 +13,9 @@ "@emotion/styled": "^11.14.1", "@mui/material": "^7.2.0", "@mui/stylis-plugin-rtl": "^7.2.0", - "@rkheftan/harmony-ui": "^0.1.5", - "@mui/x-date-pickers": "^8.10.0", + "@mui/x-date-pickers": "^8.9.0", "@mui/x-date-pickers-pro": "^8.9.0", + "@rkheftan/harmony-ui": "^0.1.5", "axios": "^1.11.0", "date-fns": "^4.1.0", "date-fns-jalali": "^4.0.0-0", @@ -1124,6 +1124,15 @@ "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, + "node_modules/@fingerprintjs/fingerprintjs": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/@fingerprintjs/fingerprintjs/-/fingerprintjs-3.4.2.tgz", + "integrity": "sha512-3Ncze6JsJpB7BpYhqIgvBpfvEX1jsEKrad5hQBpyRQxtoAp6hx3+R46zqfsuQG4D9egQZ+xftQ0u4LPFMB7Wmg==", + "license": "MIT", + "dependencies": { + "tslib": "^2.4.1" + } + }, "node_modules/@humanfs/core": { "version": "0.19.1", "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", @@ -1452,6 +1461,226 @@ } } }, + "node_modules/@mui/x-data-grid": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/@mui/x-data-grid/-/x-data-grid-8.10.0.tgz", + "integrity": "sha512-NMOZyDcE9vqn0qEv0z6DqkXwzIOj4ZFy4QC0RcUjEvBmjwdRc3KCh9XSWAuqmpc23B4M9cydVVkt0CBfOJKwsQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.28.2", + "@mui/utils": "^7.2.0", + "@mui/x-internals": "8.10.0", + "@mui/x-virtualizer": "0.1.1", + "clsx": "^2.1.1", + "prop-types": "^15.8.1", + "use-sync-external-store": "^1.5.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui-org" + }, + "peerDependencies": { + "@emotion/react": "^11.9.0", + "@emotion/styled": "^11.8.1", + "@mui/material": "^5.15.14 || ^6.0.0 || ^7.0.0", + "@mui/system": "^5.15.14 || ^6.0.0 || ^7.0.0", + "react": "^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@emotion/react": { + "optional": true + }, + "@emotion/styled": { + "optional": true + } + } + }, + "node_modules/@mui/x-data-grid-premium": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/@mui/x-data-grid-premium/-/x-data-grid-premium-8.10.0.tgz", + "integrity": "sha512-oNDmzDNoaxVNDSG+vY88okGoVF6hhJ4acpQlb+SYC63hQUnZlB6nQpgVGsDFF6V7A8lq2lDLTnTEZnWlMjuZZw==", + "license": "SEE LICENSE IN LICENSE", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.28.2", + "@mui/utils": "^7.2.0", + "@mui/x-data-grid": "8.10.0", + "@mui/x-data-grid-pro": "8.10.0", + "@mui/x-internals": "8.10.0", + "@mui/x-license": "8.10.0", + "@types/format-util": "^1.0.4", + "clsx": "^2.1.1", + "exceljs": "^4.4.0", + "prop-types": "^15.8.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "@emotion/react": "^11.9.0", + "@emotion/styled": "^11.8.1", + "@mui/material": "^5.15.14 || ^6.0.0 || ^7.0.0", + "@mui/system": "^5.15.14 || ^6.0.0 || ^7.0.0", + "react": "^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@emotion/react": { + "optional": true + }, + "@emotion/styled": { + "optional": true + } + } + }, + "node_modules/@mui/x-data-grid-premium/node_modules/@mui/x-internals": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/@mui/x-internals/-/x-internals-8.10.0.tgz", + "integrity": "sha512-stYhWBeCKfV2/ltAWShZ3ZJ51otbqpMpC+krWWoIsxM8TuvGzwXw5YMU9L2fTb8hRstsiOCQfEzIn12Ii7+N0Q==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.28.2", + "@mui/utils": "^7.2.0", + "reselect": "^5.1.1", + "use-sync-external-store": "^1.5.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui-org" + }, + "peerDependencies": { + "react": "^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/@mui/x-data-grid-premium/node_modules/@mui/x-license": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/@mui/x-license/-/x-license-8.10.0.tgz", + "integrity": "sha512-N6grkf44ESMmQp8bqSNKmWLIsf7IfsfJUr2PKDH07PVfJHTwvyQpUKBF+mLUtcd/GNDyUhqyDK98zx9AwGzSwA==", + "license": "SEE LICENSE IN LICENSE", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.28.2", + "@mui/utils": "^7.2.0", + "@mui/x-internals": "8.10.0", + "@mui/x-telemetry": "8.5.3" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "react": "^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/@mui/x-data-grid-pro": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/@mui/x-data-grid-pro/-/x-data-grid-pro-8.10.0.tgz", + "integrity": "sha512-jg5WZakq8QVnYgF1KQ6EFWqtjPXl5Aww4o9bJQOiq1I5IGXqQJdVm9VGdDK0Xywn+FdNiU4VbdQhS++B601b5w==", + "license": "SEE LICENSE IN LICENSE", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.28.2", + "@mui/utils": "^7.2.0", + "@mui/x-data-grid": "8.10.0", + "@mui/x-internals": "8.10.0", + "@mui/x-license": "8.10.0", + "@types/format-util": "^1.0.4", + "clsx": "^2.1.1", + "prop-types": "^15.8.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "@emotion/react": "^11.9.0", + "@emotion/styled": "^11.8.1", + "@mui/material": "^5.15.14 || ^6.0.0 || ^7.0.0", + "@mui/system": "^5.15.14 || ^6.0.0 || ^7.0.0", + "react": "^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@emotion/react": { + "optional": true + }, + "@emotion/styled": { + "optional": true + } + } + }, + "node_modules/@mui/x-data-grid-pro/node_modules/@mui/x-internals": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/@mui/x-internals/-/x-internals-8.10.0.tgz", + "integrity": "sha512-stYhWBeCKfV2/ltAWShZ3ZJ51otbqpMpC+krWWoIsxM8TuvGzwXw5YMU9L2fTb8hRstsiOCQfEzIn12Ii7+N0Q==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.28.2", + "@mui/utils": "^7.2.0", + "reselect": "^5.1.1", + "use-sync-external-store": "^1.5.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui-org" + }, + "peerDependencies": { + "react": "^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/@mui/x-data-grid-pro/node_modules/@mui/x-license": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/@mui/x-license/-/x-license-8.10.0.tgz", + "integrity": "sha512-N6grkf44ESMmQp8bqSNKmWLIsf7IfsfJUr2PKDH07PVfJHTwvyQpUKBF+mLUtcd/GNDyUhqyDK98zx9AwGzSwA==", + "license": "SEE LICENSE IN LICENSE", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.28.2", + "@mui/utils": "^7.2.0", + "@mui/x-internals": "8.10.0", + "@mui/x-telemetry": "8.5.3" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "react": "^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/@mui/x-data-grid/node_modules/@mui/x-internals": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/@mui/x-internals/-/x-internals-8.10.0.tgz", + "integrity": "sha512-stYhWBeCKfV2/ltAWShZ3ZJ51otbqpMpC+krWWoIsxM8TuvGzwXw5YMU9L2fTb8hRstsiOCQfEzIn12Ii7+N0Q==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.28.2", + "@mui/utils": "^7.2.0", + "reselect": "^5.1.1", + "use-sync-external-store": "^1.5.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui-org" + }, + "peerDependencies": { + "react": "^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, "node_modules/@mui/x-date-pickers": { "version": "8.10.0", "resolved": "https://registry.npmjs.org/@mui/x-date-pickers/-/x-date-pickers-8.10.0.tgz", @@ -1727,6 +1956,52 @@ "node": ">=14.0.0" } }, + "node_modules/@mui/x-virtualizer": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@mui/x-virtualizer/-/x-virtualizer-0.1.1.tgz", + "integrity": "sha512-pZ84wPu/97Z6g2HF7D4t8X5GSgc+Gr3EoJJpGv1SP3mAX2OcZtYhXiUyQzvHPm2jvDQuxIIzwXT3hMIEgdDPPQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.27.4", + "@mui/utils": "^7.2.0", + "@mui/x-internals": "8.10.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui-org" + }, + "peerDependencies": { + "react": "^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/@mui/x-virtualizer/node_modules/@mui/x-internals": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/@mui/x-internals/-/x-internals-8.10.0.tgz", + "integrity": "sha512-stYhWBeCKfV2/ltAWShZ3ZJ51otbqpMpC+krWWoIsxM8TuvGzwXw5YMU9L2fTb8hRstsiOCQfEzIn12Ii7+N0Q==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.28.2", + "@mui/utils": "^7.2.0", + "reselect": "^5.1.1", + "use-sync-external-store": "^1.5.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui-org" + }, + "peerDependencies": { + "react": "^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -2640,15 +2915,6 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "license": "MIT" }, - "node_modules/atomically": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/atomically/-/atomically-2.0.3.tgz", - "integrity": "sha512-kU6FmrwZ3Lx7/7y3hPS5QnbJfaohcIul5fGqf7ok+4KklIEk9tJ0C2IQPdacSbVUWv6zVHXEBWoWd6NrVMT7Cw==", - "dependencies": { - "stubborn-fs": "^1.2.5", - "when-exit": "^2.1.1" - } - }, "node_modules/axios": { "version": "1.11.0", "resolved": "https://registry.npmjs.org/axios/-/axios-1.11.0.tgz", @@ -2831,7 +3097,6 @@ "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", "license": "MIT", - "peer": true, "engines": { "node": "*" } @@ -2928,6 +3193,21 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/ci-info": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.3.0.tgz", + "integrity": "sha512-l+2bNRMiQgcfILUi33labAZYIWlH1kWDp+ecNo5iisRKrbm0xcRyCww71/YU0Fkw0mAFpz9bJayXPjey6vkmaQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/clsx": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", @@ -2957,11 +3237,22 @@ "dev": true, "license": "MIT" }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true, "license": "MIT" }, "node_modules/conf": { @@ -2969,7 +3260,6 @@ "resolved": "https://registry.npmjs.org/conf/-/conf-11.0.2.tgz", "integrity": "sha512-jjyhlQ0ew/iwmtwsS2RaB6s8DBifcE2GYBEaw2SJDUY/slJJbNfY4GlDVzOs/ff8cM/Wua5CikqXgbFl5eu85A==", "license": "MIT", - "peer": true, "dependencies": { "buffer-crc32": "^0.2.13", "crc32-stream": "^4.0.2", @@ -2980,12 +3270,6 @@ "node": ">= 10" } }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "license": "MIT" - }, "node_modules/convert-source-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", @@ -3040,7 +3324,6 @@ "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", "license": "Apache-2.0", - "peer": true, "bin": { "crc32": "bin/crc32.njs" }, @@ -3053,7 +3336,6 @@ "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-4.0.3.tgz", "integrity": "sha512-NT7w2JVU7DFroFdYkeq8cywxrgjPHWkdX1wjpRQXPX5Asews3tA+Ght6lddQO5Mkumffp3X7GEqku3epj2toIw==", "license": "MIT", - "peer": true, "dependencies": { "crc-32": "^1.2.0", "readable-stream": "^3.4.0" @@ -3101,29 +3383,6 @@ "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", "license": "MIT" }, - "node_modules/dayjs": { - "version": "1.11.13", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.13.tgz", - "integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==", - "license": "MIT", - "peer": true - }, - "node_modules/debounce-fn": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/debounce-fn/-/debounce-fn-5.1.2.tgz", - "integrity": "sha512-Sr4SdOZ4vw6eQDvPYNxHogvrxmCIld/VenC5JbNrFwMiwd7lY/Z18ZFfo+EWNG4DD9nFlAujWAo/wGuOPHmy5A==", - "license": "MIT", - "peer": true, - "dependencies": { - "mimic-fn": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/date-fns": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-4.1.0.tgz", @@ -3146,21 +3405,6 @@ "integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==", "license": "MIT" }, - "node_modules/debounce-fn": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/debounce-fn/-/debounce-fn-5.1.2.tgz", - "integrity": "sha512-Sr4SdOZ4vw6eQDvPYNxHogvrxmCIld/VenC5JbNrFwMiwd7lY/Z18ZFfo+EWNG4DD9nFlAujWAo/wGuOPHmy5A==", - "license": "MIT", - "dependencies": { - "mimic-fn": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/debug": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", @@ -3204,36 +3448,6 @@ "csstype": "^3.0.2" } }, - "node_modules/electron-to-chromium": { - "version": "1.5.178", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.178.tgz", - "integrity": "sha512-wObbz/ar3Bc6e4X5vf0iO8xTN8YAjN/tgiAOJLr7yjYFtP9wAjq8Mb5h0yn6kResir+VYx2DXBj9NNobs0ETSA==", - "dev": true, - "license": "ISC" - }, - "node_modules/end-of-stream": { - "version": "1.4.5", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", - "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", - "license": "MIT", - "peer": true, - "dependencies": { - "once": "^1.4.0" - } - }, - "node_modules/env-paths": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-3.0.0.tgz", - "integrity": "sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A==", - "license": "MIT", - "peer": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/dunder-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", @@ -3255,16 +3469,14 @@ "dev": true, "license": "ISC" }, - "node_modules/env-paths": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-3.0.0.tgz", - "integrity": "sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A==", + "node_modules/end-of-stream": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", + "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", "license": "MIT", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "peer": true, + "dependencies": { + "once": "^1.4.0" } }, "node_modules/error-ex": { @@ -3648,6 +3860,7 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, "license": "MIT" }, "node_modules/fast-diff": { @@ -3701,23 +3914,6 @@ "dev": true, "license": "MIT" }, - "node_modules/fast-uri": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.6.tgz", - "integrity": "sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/fastify" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/fastify" - } - ], - "license": "BSD-3-Clause", - "peer": true - }, "node_modules/fastq": { "version": "1.19.1", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", @@ -3798,20 +3994,6 @@ "dev": true, "license": "ISC" }, - "node_modules/fs-constants": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", - "license": "MIT", - "peer": true - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "license": "ISC", - "peer": true - }, "node_modules/follow-redirects": { "version": "1.15.11", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz", @@ -3848,6 +4030,20 @@ "node": ">= 6" } }, + "node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "license": "MIT", + "peer": true + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "license": "ISC", + "peer": true + }, "node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", @@ -3899,28 +4095,6 @@ "node": ">=6.9.0" } }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "deprecated": "Glob versions prior to v9 are no longer supported", - "license": "ISC", - "peer": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/get-intrinsic": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", @@ -3958,6 +4132,28 @@ "node": ">= 0.4" } }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "license": "ISC", + "peer": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/glob-parent": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", @@ -3984,13 +4180,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "license": "ISC", - "peer": true - }, "node_modules/gopd": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", @@ -4003,6 +4192,13 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "license": "ISC", + "peer": true + }, "node_modules/graphemer": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", @@ -4137,7 +4333,6 @@ "resolved": "https://registry.npmjs.org/iconsax-react/-/iconsax-react-0.0.8.tgz", "integrity": "sha512-l3dVk4zGtkkJHgvNYqAf0wDKqnKxXykee5/DoESGo2JvSYwaxajJUHSX2YrPRXSov8Hd8ClGFwJxCEaEjrFD1Q==", "license": "MIT", - "peer": true, "dependencies": { "prop-types": "^15.7.2" }, @@ -4225,8 +4420,7 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "license": "ISC", - "peer": true + "license": "ISC" }, "node_modules/is-arrayish": { "version": "0.2.1", @@ -4254,7 +4448,6 @@ "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", "license": "MIT", - "peer": true, "bin": { "is-docker": "cli.js" }, @@ -4552,13 +4745,6 @@ "license": "MIT", "peer": true }, - "node_modules/lodash.escaperegexp": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz", - "integrity": "sha512-TM9YBvyC84ZxE3rgfefxUWiQKLilstD6k7PTGt6wfbtXF8ixIJLOL3VYyV/z+ZiPLsVxAsKAFVwWlWeb2Y8Yyw==", - "license": "MIT", - "peer": true - }, "node_modules/lodash.flatten": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", @@ -4566,42 +4752,6 @@ "license": "MIT", "peer": true }, - "node_modules/lodash.groupby": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.groupby/-/lodash.groupby-4.6.0.tgz", - "integrity": "sha512-5dcWxm23+VAoz+awKmBaiBvzox8+RqMgFhi7UvX9DHZr2HdxHXM/Wrf8cfKpsW37RNrvtPn6hSwNqurSILbmJw==", - "license": "MIT", - "peer": true - }, - "node_modules/lodash.isboolean": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", - "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==", - "license": "MIT", - "peer": true - }, - "node_modules/lodash.isequal": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", - "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==", - "deprecated": "This package is deprecated. Use require('node:util').isDeepStrictEqual instead.", - "license": "MIT", - "peer": true - }, - "node_modules/lodash.isfunction": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/lodash.isfunction/-/lodash.isfunction-3.0.9.tgz", - "integrity": "sha512-AirXNj15uRIMMPihnkInB4i3NHeb4iBtNg9WRWuK2o31S+ePwwNmDPaTL3o7dTJ+VXNZim7rFs4rxN4YU1oUJw==", - "license": "MIT", - "peer": true - }, - "node_modules/lodash.isnil": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/lodash.isnil/-/lodash.isnil-4.0.0.tgz", - "integrity": "sha512-up2Mzq3545mwVnMhTDMdfoG1OurpA/s5t88JmQX809eH3C8491iu2sfKhTfhQtKY78oPNhiaHJUpT/dUDAAtng==", - "license": "MIT", - "peer": true - }, "node_modules/lodash.isplainobject": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", @@ -4609,13 +4759,6 @@ "license": "MIT", "peer": true }, - "node_modules/lodash.isundefined": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/lodash.isundefined/-/lodash.isundefined-3.0.1.tgz", - "integrity": "sha512-MXB1is3s899/cD8jheYYE2V9qTHwKvt+npCwpD+1Sxm3Q3cECXCiYHjeHWXNwr6Q0SOBPrYUDxendrO6goVTEA==", - "license": "MIT", - "peer": true - }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -4630,13 +4773,6 @@ "license": "MIT", "peer": true }, - "node_modules/lodash.uniq": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", - "integrity": "sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==", - "license": "MIT", - "peer": true - }, "node_modules/loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -4713,19 +4849,6 @@ "node": ">= 0.6" } }, - "node_modules/mimic-fn": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", - "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -4813,6 +4936,12 @@ } } }, + "node_modules/node-machine-id": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/node-machine-id/-/node-machine-id-1.1.12.tgz", + "integrity": "sha512-QNABxbrPa3qEIfrE6GOJ7BYIuignnJw7iQ2YPbc3Nla1HzRJjXzZOiikfF8m7eAMfichLt3M4VgLOetqgDmgGQ==", + "license": "MIT" + }, "node_modules/node-releases": { "version": "2.0.19", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", @@ -4825,7 +4954,6 @@ "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "license": "MIT", - "peer": true, "engines": { "node": ">=0.10.0" } @@ -5253,7 +5381,6 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "license": "MIT", - "peer": true, "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -5296,32 +5423,6 @@ "node": ">=10" } }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/reselect": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/reselect/-/reselect-5.1.1.tgz", - "integrity": "sha512-K/BG6eIky/SBpzfHZv/dd+9JBFiS4SWV7FIujVyJRux6e45+73RaUHXLmIR1f7WOMaQ0U1km6qwklRQxpJJY0w==", - "license": "MIT", - "peer": true - }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/reselect": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/reselect/-/reselect-5.1.1.tgz", @@ -5464,8 +5565,7 @@ "url": "https://feross.org/support" } ], - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/saxes": { "version": "5.0.1", @@ -5557,7 +5657,6 @@ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "license": "MIT", - "peer": true, "dependencies": { "safe-buffer": "~5.2.0" } @@ -5575,12 +5674,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/stubborn-fs": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/stubborn-fs/-/stubborn-fs-1.2.5.tgz", - "integrity": "sha512-H2N9c26eXjzL/S/K+i/RHHcFanE74dptvvjM8iwzwbVcWY/zjBbgRqF3K0DY4+OD+uTTASTBvDoxPDaPN02D7g==", - "peer": true - }, "node_modules/stylis": { "version": "4.3.6", "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.3.6.tgz", @@ -5758,8 +5851,7 @@ "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "license": "0BSD", - "peer": true + "license": "0BSD" }, "node_modules/type-check": { "version": "0.4.0", @@ -5774,19 +5866,6 @@ "node": ">= 0.8.0" } }, - "node_modules/type-fest": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", - "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", - "license": "(MIT OR CC0-1.0)", - "peer": true, - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/typescript": { "version": "5.8.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", @@ -5929,7 +6008,6 @@ "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.5.0.tgz", "integrity": "sha512-Rb46I4cGGVBmjamjphe8L/UnvJD+uPPtTkNvX5mZgqdbavhI4EbgIWJiIHXJ8bc/i9EQGPRh4DwEURJ552Do0A==", "license": "MIT", - "peer": true, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } @@ -5938,8 +6016,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/uuid": { "version": "8.3.2", @@ -6079,13 +6156,6 @@ "webidl-conversions": "^3.0.0" } }, - "node_modules/when-exit": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/when-exit/-/when-exit-2.1.4.tgz", - "integrity": "sha512-4rnvd3A1t16PWzrBUcSDZqcAmsUIy4minDXT/CZ8F2mVDgd65i4Aalimgz1aQkRGU0iH5eT5+6Rx2TK8o443Pg==", - "license": "MIT", - "peer": true - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", diff --git a/public/locales/en/country.json b/public/locales/en/country.json new file mode 100644 index 0000000..b874af3 --- /dev/null +++ b/public/locales/en/country.json @@ -0,0 +1,247 @@ +{ + "country.afghanistan": "Afghanistan", + "country.aland_islands": "Aland islands", + "country.albania": "Albania", + "country.algeria": "Algeria", + "country.american_samoa": "American samoa", + "country.andorra": "Andorra", + "country.angola": "Angola", + "country.anguilla": "Anguilla", + "country.antarctica": "Antarctica", + "country.antigua_and_barbuda": "Antigua and barbuda", + "country.argentina": "Argentina", + "country.armenia": "Armenia", + "country.aruba": "Aruba", + "country.australia": "Australia", + "country.austria": "Austria", + "country.azerbaijan": "Azerbaijan", + "country.bahamas": "Bahamas", + "country.bahrain": "Bahrain", + "country.bangladesh": "Bangladesh", + "country.barbados": "Barbados", + "country.belarus": "Belarus", + "country.belgium": "Belgium", + "country.belize": "Belize", + "country.benin": "Benin", + "country.bermuda": "Bermuda", + "country.bhutan": "Bhutan", + "country.bolivia": "Bolivia", + "country.bosnia_and_herzegovina": "Bosnia and herzegovina", + "country.botswana": "Botswana", + "country.brazil": "Brazil", + "country.british_indian_ocean_territory": "British indian ocean territory", + "country.british_virgin_islands": "British virgin islands", + "country.brunei": "Brunei", + "country.bulgaria": "Bulgaria", + "country.burkina_faso": "Burkina faso", + "country.burundi": "Burundi", + "country.cambodia": "Cambodia", + "country.cameroon": "Cameroon", + "country.canada": "Canada", + "country.cape_verde": "Cape verde", + "country.cayman_islands": "Cayman islands", + "country.central_african_republic": "Central african republic", + "country.chad": "Chad", + "country.chile": "Chile", + "country.china": "China", + "country.christmas_island": "Christmas island", + "country.cocos_keeling_islands": "Cocos keeling islands", + "country.colombia": "Colombia", + "country.comoros": "Comoros", + "country.congo_brazzaville": "Congo brazzaville", + "country.congo_kinshasa": "Congo kinshasa", + "country.cook_islands": "Cook islands", + "country.costa_rica": "Costa rica", + "country.cote_divoire": "Cote divoire", + "country.croatia": "Croatia", + "country.cuba": "Cuba", + "country.curacao": "Curacao", + "country.cyprus": "Cyprus", + "country.czech_republic": "Czech republic", + "country.denmark": "Denmark", + "country.djibouti": "Djibouti", + "country.dominica": "Dominica", + "country.dominican_republic": "Dominican republic", + "country.ecuador": "Ecuador", + "country.egypt": "Egypt", + "country.el_salvador": "El salvador", + "country.equatorial_guinea": "Equatorial guinea", + "country.eritrea": "Eritrea", + "country.estonia": "Estonia", + "country.eswatini": "Eswatini", + "country.ethiopia": "Ethiopia", + "country.falkland_islands": "Falkland islands", + "country.faroe_islands": "Faroe islands", + "country.fiji": "Fiji", + "country.finland": "Finland", + "country.france": "France", + "country.french_guiana": "French guiana", + "country.french_polynesia": "French polynesia", + "country.gabon": "Gabon", + "country.gambia": "Gambia", + "country.georgia": "Georgia", + "country.germany": "Germany", + "country.ghana": "Ghana", + "country.gibraltar": "Gibraltar", + "country.greece": "Greece", + "country.greenland": "Greenland", + "country.grenada": "Grenada", + "country.guadeloupe": "Guadeloupe", + "country.guam": "Guam", + "country.guatemala": "Guatemala", + "country.guernsey": "Guernsey", + "country.guinea": "Guinea", + "country.guinea_bissau": "Guinea bissau", + "country.guyana": "Guyana", + "country.haiti": "Haiti", + "country.honduras": "Honduras", + "country.hong_kong": "Hong kong", + "country.hungary": "Hungary", + "country.iceland": "Iceland", + "country.india": "India", + "country.indonesia": "Indonesia", + "country.iran": "Iran", + "country.iraq": "Iraq", + "country.ireland": "Ireland", + "country.isle_of_man": "Isle of man", + "country.israel": "Israel", + "country.italy": "Italy", + "country.jamaica": "Jamaica", + "country.japan": "Japan", + "country.jersey": "Jersey", + "country.jordan": "Jordan", + "country.kazakhstan": "Kazakhstan", + "country.kenya": "Kenya", + "country.kiribati": "Kiribati", + "country.kosovo": "Kosovo", + "country.kuwait": "Kuwait", + "country.kyrgyzstan": "Kyrgyzstan", + "country.laos": "Laos", + "country.latvia": "Latvia", + "country.lebanon": "Lebanon", + "country.lesotho": "Lesotho", + "country.liberia": "Liberia", + "country.libya": "Libya", + "country.liechtenstein": "Liechtenstein", + "country.lithuania": "Lithuania", + "country.luxembourg": "Luxembourg", + "country.macau": "Macau", + "country.madagascar": "Madagascar", + "country.malawi": "Malawi", + "country.malaysia": "Malaysia", + "country.maldives": "Maldives", + "country.mali": "Mali", + "country.malta": "Malta", + "country.marshall_islands": "Marshall islands", + "country.martinique": "Martinique", + "country.mauritania": "Mauritania", + "country.mauritius": "Mauritius", + "country.mayotte": "Mayotte", + "country.mexico": "Mexico", + "country.micronesia": "Micronesia", + "country.moldova": "Moldova", + "country.monaco": "Monaco", + "country.mongolia": "Mongolia", + "country.montenegro": "Montenegro", + "country.montserrat": "Montserrat", + "country.morocco": "Morocco", + "country.mozambique": "Mozambique", + "country.myanmar": "Myanmar", + "country.namibia": "Namibia", + "country.nauru": "Nauru", + "country.nepal": "Nepal", + "country.netherlands": "Netherlands", + "country.new_caledonia": "New caledonia", + "country.new_zealand": "New zealand", + "country.nicaragua": "Nicaragua", + "country.niger": "Niger", + "country.nigeria": "Nigeria", + "country.niue": "Niue", + "country.norfolk_island": "Norfolk island", + "country.north_korea": "North korea", + "country.north_macedonia": "North macedonia", + "country.northern_mariana_islands": "Northern mariana islands", + "country.norway": "Norway", + "country.oman": "Oman", + "country.pakistan": "Pakistan", + "country.palau": "Palau", + "country.palestine": "Palestine", + "country.panama": "Panama", + "country.papua_new_guinea": "Papua new guinea", + "country.paraguay": "Paraguay", + "country.peru": "Peru", + "country.philippines": "Philippines", + "country.pitcairn_islands": "Pitcairn islands", + "country.poland": "Poland", + "country.portugal": "Portugal", + "country.puerto_rico": "Puerto rico", + "country.qatar": "Qatar", + "country.reunion": "Reunion", + "country.romania": "Romania", + "country.russia": "Russia", + "country.rwanda": "Rwanda", + "country.saint_barthelemy": "Saint barthelemy", + "country.saint_helena": "Saint helena", + "country.saint_kitts_and_nevis": "Saint kitts and nevis", + "country.saint_lucia": "Saint lucia", + "country.saint_martin": "Saint martin", + "country.saint_pierre_and_miquelon": "Saint pierre and miquelon", + "country.saint_vincent_and_the_grenadines": "Saint vincent and the grenadines", + "country.samoa": "Samoa", + "country.san_marino": "San marino", + "country.sao_tome_and_principe": "Sao tome and principe", + "country.saudi_arabia": "Saudi arabia", + "country.senegal": "Senegal", + "country.serbia": "Serbia", + "country.seychelles": "Seychelles", + "country.sierra_leone": "Sierra leone", + "country.singapore": "Singapore", + "country.sint_maarten": "Sint maarten", + "country.slovakia": "Slovakia", + "country.slovenia": "Slovenia", + "country.solomon_islands": "Solomon islands", + "country.somalia": "Somalia", + "country.south_africa": "South africa", + "country.south_georgia_and_south_sandwich_islands": "South georgia and south sandwich islands", + "country.south_korea": "South korea", + "country.south_sudan": "South sudan", + "country.spain": "Spain", + "country.sri_lanka": "Sri lanka", + "country.sudan": "Sudan", + "country.suriname": "Suriname", + "country.svalbard_and_jan_mayen": "Svalbard and jan mayen", + "country.sweden": "Sweden", + "country.switzerland": "Switzerland", + "country.syria": "Syria", + "country.taiwan": "Taiwan", + "country.tajikistan": "Tajikistan", + "country.tanzania": "Tanzania", + "country.thailand": "Thailand", + "country.timor_leste": "Timor leste", + "country.togo": "Togo", + "country.tokelau": "Tokelau", + "country.tonga": "Tonga", + "country.trinidad_and_tobago": "Trinidad and tobago", + "country.tunisia": "Tunisia", + "country.turkey": "Turkey", + "country.turkmenistan": "Turkmenistan", + "country.turks_and_caicos_islands": "Turks and caicos islands", + "country.tuvalu": "Tuvalu", + "country.us_virgin_islands": "Us virgin islands", + "country.uganda": "Uganda", + "country.ukraine": "Ukraine", + "country.united_arab_emirates": "United arab emirates", + "country.united_kingdom": "United kingdom", + "country.united_states": "United states", + "country.uruguay": "Uruguay", + "country.uzbekistan": "Uzbekistan", + "country.vanuatu": "Vanuatu", + "country.vatican_city": "Vatican city", + "country.venezuela": "Venezuela", + "country.vietnam": "Vietnam", + "country.wallis_and_futuna": "Wallis and futuna", + "country.western_sahara": "Western sahara", + "country.yemen": "Yemen", + "country.zambia": "Zambia", + "country.zimbabwe": "Zimbabwe" +} diff --git a/public/locales/fa/completionForm.json b/public/locales/fa/completionForm.json index 6ab3404..c74a342 100644 --- a/public/locales/fa/completionForm.json +++ b/public/locales/fa/completionForm.json @@ -35,6 +35,11 @@ "submitSuccess": "اطلاعات با موفقیت ثبت شد", "submitError": "خطا در ثبت اطلاعات", "submitting": "در حال تایید...", - "success": "موفقیت" + "success": "موفقیت", + "successfullCodeSent": "کد با موفقیت ارسال شد", + "codeSentBut": "کد ارسال شد اما", + "problem": "مشکلی پیش آمده", + "codeVerified": "کد با موفقیت تایید شد", + "invalidCode": "کد نامعتبر است" } } diff --git a/public/locales/fa/country.json b/public/locales/fa/country.json new file mode 100644 index 0000000..72698dc --- /dev/null +++ b/public/locales/fa/country.json @@ -0,0 +1,182 @@ +{ + "country.afghanistan": "افغانستان", + "country.aland_islands": "جزایر آلند", + "country.albania": "آلبانی", + "country.algeria": "الجزایر", + "country.american_samoa": "ساموای آمریکایی", + "country.andorra": "آندورا", + "country.angola": "آنگولا", + "country.anguilla": "آنگویلا", + "country.antarctica": "جنوبگان", + "country.antigua_and_barbuda": "آنتیگوا و باربودا", + "country.argentina": "آرژانتین", + "country.armenia": "ارمنستان", + "country.aruba": "آروبا", + "country.australia": "استرالیا", + "country.austria": "اتریش", + "country.azerbaijan": "آذربایجان", + "country.bahamas": "باهاما", + "country.bahrain": "بحرین", + "country.bangladesh": "بنگلادش", + "country.barbados": "باربادوس", + "country.belarus": "بلاروس", + "country.belgium": "بلژیک", + "country.belize": "بلیز", + "country.benin": "بنین", + "country.bermuda": "برمودا", + "country.bhutan": "بوتان", + "country.bolivia": "بولیوی", + "country.bosnia_and_herzegovina": "بوسنی و هرزگوین", + "country.botswana": "بوتسوانا", + "country.brazil": "برزیل", + "country.british_virgin_islands": "جزایر ویرجین بریتانیا", + "country.brunei": "برونئی", + "country.bulgaria": "بلغارستان", + "country.burkina_faso": "بورکینافاسو", + "country.burundi": "بوروندی", + "country.cambodia": "کامبوج", + "country.cameroon": "کامرون", + "country.canada": "کانادا", + "country.cape_verde": "کیپ ورد", + "country.cayman_islands": "جزایر کیمن", + "country.central_african_republic": "جمهوری آفریقای مرکزی", + "country.chad": "چاد", + "country.chile": "شیلی", + "country.china": "چین", + "country.colombia": "کلمبیا", + "country.comoros": "کومور", + "country.costa_rica": "کاستاریکا", + "country.cote_divoire": "ساحل عاج", + "country.croatia": "کرواسی", + "country.cuba": "کوبا", + "country.cyprus": "قبرس", + "country.czech_republic": "جمهوری چک", + "country.denmark": "دانمارک", + "country.djibouti": "جیبوتی", + "country.dominica": "دومینیکا", + "country.dominican_republic": "جمهوری دومینیکن", + "country.ecuador": "اکوادور", + "country.egypt": "مصر", + "country.el_salvador": "السالوادور", + "country.equatorial_guinea": "گینه استوایی", + "country.eritrea": "اریتره", + "country.estonia": "استونی", + "country.eswatini": "سوازیلند", + "country.ethiopia": "اتیوپی", + "country.fiji": "فیجی", + "country.finland": "فنلاند", + "country.france": "فرانسه", + "country.gabon": "گابن", + "country.gambia": "گامبیا", + "country.georgia": "گرجستان", + "country.germany": "آلمان", + "country.ghana": "غنا", + "country.greece": "یونان", + "country.guatemala": "گواتمالا", + "country.guinea": "گینه", + "country.guinea_bissau": "گینه بیسائو", + "country.guyana": "گویان", + "country.haiti": "هائیتی", + "country.honduras": "هندوراس", + "country.hungary": "مجارستان", + "country.iceland": "ایسلند", + "country.india": "هندوستان", + "country.indonesia": "اندونزی", + "country.iran": "ایران", + "country.iraq": "عراق", + "country.ireland": "ایرلند", + "country.israel": "اسرائیل", + "country.italy": "ایتالیا", + "country.jamaica": "جامائیکا", + "country.japan": "ژاپن", + "country.jordan": "اردن", + "country.kazakhstan": "قزاقستان", + "country.kenya": "کنیا", + "country.kuwait": "کویت", + "country.kyrgyzstan": "قرقیزستان", + "country.laos": "لائوس", + "country.latvia": "لتونی", + "country.lebanon": "لبنان", + "country.lesotho": "لسوتو", + "country.liberia": "لیبریا", + "country.libya": "لیبی", + "country.luxembourg": "لوکزامبورگ", + "country.malaysia": "مالزی", + "country.maldives": "مالدیو", + "country.mali": "مالی", + "country.malta": "مالت", + "country.mauritania": "موریتانی", + "country.mauritius": "موریس", + "country.mexico": "مکزیک", + "country.moldova": "مولداوی", + "country.monaco": "موناکو", + "country.mongolia": "مغولستان", + "country.morocco": "مراکش", + "country.mozambique": "موزامبیک", + "country.myanmar": "میانمار", + "country.namibia": "نامیبیا", + "country.nepal": "نپال", + "country.netherlands": "هلند", + "country.new_zealand": "نیوزیلند", + "country.nicaragua": "نیکاراگوئه", + "country.niger": "نیجر", + "country.nigeria": "نیجریه", + "country.north_korea": "کره شمالی", + "country.north_macedonia": "مقدونیه", + "country.norway": "نروژ", + "country.oman": "عمان", + "country.pakistan": "پاکستان", + "country.palau": "پالائو", + "country.panama": "پاناما", + "country.papua_new_guinea": "پاپوآ گینه نو", + "country.paraguay": "پاراگوئه", + "country.peru": "پرو", + "country.philippines": "فیلیپین", + "country.poland": "لهستان", + "country.portugal": "پرتغال", + "country.qatar": "قطر", + "country.romania": "رومانی", + "country.russia": "روسیه", + "country.rwanda": "رواندا", + "country.saudi_arabia": "عربستان سعودی", + "country.senegal": "سنگال", + "country.serbia": "صربستان", + "country.seychelles": "سیشل", + "country.sierra_leone": "سیرالئون", + "country.singapore": "سنگاپور", + "country.south_africa": "آفریقای جنوبی", + "country.south_korea": "کره جنوبی", + "country.south_sudan": "سودان جنوبی", + "country.spain": "اسپانیا", + "country.sri_lanka": "سری‌لانکا", + "country.sudan": "سودان", + "country.suriname": "سورینام", + "country.sweden": "سوئد", + "country.switzerland": "سوئیس", + "country.syria": "سوریه", + "country.taiwan": "تایوان", + "country.tajikistan": "تاجیکستان", + "country.tanzania": "تانزانیا", + "country.thailand": "تایلند", + "country.timor_leste": "تیمور شرقی", + "country.togo": "توگو", + "country.tonga": "تونگا", + "country.trinidad_and_tobago": "ترینیداد و توباگو", + "country.tunisia": "تونس", + "country.turkey": "ترکیه", + "country.turkmenistan": "ترکمنستان", + "country.tuvalu": "تووالو", + "country.uganda": "اوگاندا", + "country.ukraine": "اوکراین", + "country.united_arab_emirates": "امارات متحده عربی", + "country.united_kingdom": "انگلستان", + "country.united_states": "ایالات متحده آمریکا", + "country.uruguay": "اروگوئه", + "country.uzbekistan": "ازبکستان", + "country.vanuatu": "وانواتو", + "country.venezuela": "ونزوئلا", + "country.vietnam": "ویتنام", + "country.yemen": "یمن", + "country.zambia": "زامبیا", + "country.zimbabwe": "زیمبابوه" +} \ No newline at end of file diff --git a/src/App.tsx b/src/App.tsx index dcbf270..1e33759 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,20 +1,9 @@ -import { - Alert, - Box, - CssBaseline, - TextField, - Typography, - useColorScheme, -} from '@mui/material'; +import { CssBaseline, useColorScheme } from '@mui/material'; import './App.css'; -import { useTranslation } from 'react-i18next'; import { LanguageManager } from './components/LanguageManager'; import { UserCompletionForm } from './features/authentication/components/UserCompletionForm'; function App() { - const { t } = useTranslation(); - const showToast = useToast(); - return ( <> @@ -28,7 +17,6 @@ function App() { export default App; import { Button } from '@mui/material'; -import { useToast } from '@rkheftan/harmony-ui'; export const ThemeToggleButton = () => { const { mode, setMode } = useColorScheme(); diff --git a/src/components/CountryFlag.tsx b/src/components/CountryFlag.tsx new file mode 100644 index 0000000..7daa422 --- /dev/null +++ b/src/components/CountryFlag.tsx @@ -0,0 +1,34 @@ +import { Box, Typography } from '@mui/material'; +import { useTranslation } from 'react-i18next'; +import { countries } from '@/features/authentication/data/Countries'; + +interface CountryFlagProps { + code: string; +} + +export function CountryFlag({ code }: CountryFlagProps) { + const { t } = useTranslation(); + + const countryObj = code ? countries.find((c) => c.code === code) : null; + + if (!countryObj) { + return null; + } + + const displayName = t(countryObj.label); + const flagUrl = `https://flagcdn.com/w40/${countryObj.code.toLowerCase()}.png`; + + return ( + + {displayName} + {displayName} + + ); +} diff --git a/src/components/Toast.tsx b/src/components/Toast.tsx index 947194f..713c36f 100644 --- a/src/components/Toast.tsx +++ b/src/components/Toast.tsx @@ -1,5 +1,5 @@ import { Alert, Snackbar, type AlertColor } from '@mui/material'; -import React, { type PropsWithChildren } from 'react'; +import { type PropsWithChildren } from 'react'; export interface ToastProps extends PropsWithChildren { color: AlertColor | undefined; diff --git a/src/features/authentication/components/EmailSection.tsx b/src/features/authentication/components/EmailSection.tsx index c3abeb8..d2b0a27 100644 --- a/src/features/authentication/components/EmailSection.tsx +++ b/src/features/authentication/components/EmailSection.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from 'react'; +import React, { useEffect } from 'react'; import { TextField, Box, @@ -12,7 +12,7 @@ import { } from '@mui/material'; import { useTranslation } from 'react-i18next'; import { TickCircle, Edit } from 'iconsax-react'; -import { Toast } from '@/components/Toast'; +import { Icon } from '@rkheftan/harmony-ui'; interface EmailSectionProps { showEmail: boolean; @@ -50,15 +50,11 @@ export function EmailSection({ handleEditEmail, }: EmailSectionProps) { const { t } = useTranslation('completionForm'); - const [showSuccessToast, setShowSuccessToast] = useState(false); - const [showErrorToast, setShowErrorToast] = useState(false); const onSendCodeClick = () => { if (!correctEmail) { - setShowErrorToast(true); return; } - setShowErrorToast(false); handleSendCode(); }; @@ -68,14 +64,11 @@ export function EmailSection({ useEffect(() => { if (emailVerified) { - setShowSuccessToast(true); } }, [emailVerified]); const fieldSx = { flex: '1 1 260px', - // maxWidth: emailVerified ? '634px' : '462px', - // width: '100%', }; return ( @@ -130,15 +123,11 @@ export function EmailSection({ startAdornment: !isVerifyingCode && emailVerified ? ( - ) : null, @@ -146,10 +135,10 @@ export function EmailSection({ buttonState === 'counting' ? ( - @@ -226,22 +215,6 @@ export function EmailSection({ )} )} - - setShowSuccessToast(false)} - > - {t('completion.alertSuccess')} - - - setShowErrorToast(false)} - > - {t('completion.emailCorrectForm')} - ); } diff --git a/src/features/authentication/components/PasswordSection.tsx b/src/features/authentication/components/PasswordSection.tsx index e2d91dc..24e3382 100644 --- a/src/features/authentication/components/PasswordSection.tsx +++ b/src/features/authentication/components/PasswordSection.tsx @@ -9,8 +9,9 @@ import { InputAdornment, } from '@mui/material'; import { useTranslation } from 'react-i18next'; -import { TickCircle, Eye, EyeSlash, CloseCircle } from 'iconsax-react'; +import { TickCircle, Eye, EyeSlash, CloseCircle, Size } from 'iconsax-react'; import { PasswordValidationItem } from './PasswordValidation'; +import { Icon } from '@rkheftan/harmony-ui'; interface PasswordSectionProps { showPasswordSection: boolean; @@ -60,8 +61,6 @@ export function PasswordSection({ const fieldSx = { flex: '1 1 260px', - maxWidth: '309px', - width: '100%', }; return ( @@ -127,25 +126,31 @@ export function PasswordSection({ }} > {validPassword && ( - + + + )} {showPasswordText ? ( - + ) : ( - + )} @@ -184,27 +189,30 @@ export function PasswordSection({ > {confirmPassword.length > 0 && (matchPassword ? ( - + + + ) : ( - + > + + ))} {showPasswordRepititonText ? ( - + ) : ( - + )} @@ -252,7 +268,6 @@ export function PasswordSection({ - + ({ + code: c.code, + label: t(c.label, { ns: 'countries' }), + })); + const currentCountry = countryOptions.find((c) => c.code === country) || null; const handleChangeSex = (e: SelectChangeEvent<'male' | 'female'>) => { setSex(e.target.value as 'female' | 'male'); }; - const handleChangeCountry = ( - _: React.SyntheticEvent, - newValue: string | CountryType | null, - ) => { - if (typeof newValue === 'string') { - setCountry(newValue); - setCountryError(false); - } else if (newValue === null) { - setCountry(''); - setCountryError(false); - } else { - setCountry(newValue.name); - setCountryError(false); - } - }; - - const handleCountryBlur = (e: React.FocusEvent) => { - const inputValue = e.target.value.trim(); - // Check if input matches any country's fa name - const exists = countries.some((c) => c.fa === inputValue); - setCountryError(Boolean(inputValue && !exists)); - }; - - const handleInputChange = (_: React.SyntheticEvent, value: string) => { - const exists = countries.some((c) => c.fa === value.trim()); - setCountryError(Boolean(value.trim() && !exists)); - }; - const fieldSx = { flex: '1 1 260px', - maxWidth: '309px', - width: '100%', }; return ( @@ -153,13 +120,13 @@ export function PersonalInfoFields({ > - + {t('completion.woman')} - + {t('completion.man')} @@ -188,40 +155,23 @@ export function PersonalInfoFields({ }} > (typeof c === 'string' ? c : c.fa)} - value={countries.find((c) => c.name === country) || null} - onChange={handleChangeCountry} - onInputChange={handleInputChange} - freeSolo - noOptionsText="" - renderOption={(props, c) => ( - - {c.name} - {c.fa} + sx={fieldSx} + options={countryOptions} + getOptionLabel={(option) => option.label} + value={currentCountry} + onChange={(_, newValue) => { + setCountry(newValue?.code || ''); + }} + renderOption={(props, option) => ( + + + {option.label} )} renderInput={(params) => ( - + )} - sx={fieldSx} + clearOnEscape /> diff --git a/src/features/authentication/components/UserCompletionForm.tsx b/src/features/authentication/components/UserCompletionForm.tsx index 89ae3a8..1579f73 100644 --- a/src/features/authentication/components/UserCompletionForm.tsx +++ b/src/features/authentication/components/UserCompletionForm.tsx @@ -7,7 +7,8 @@ import { PasswordSection } from './PasswordSection'; import { EmailSection } from './EmailSection'; import { SubmitSection } from './SubmitSection'; import apiClient from '@/lib/apiClient'; -import { Toast } from '@/components/Toast'; +import { useToast } from '@rkheftan/harmony-ui'; +import { AxiosError } from 'axios'; export function UserCompletionForm() { const { t } = useTranslation('completionForm'); @@ -48,19 +49,8 @@ export function UserCompletionForm() { const [loading, setLoading] = useState(false); const [error, setError] = useState(null); const [success, setSuccess] = useState(false); - const [showSuccessToast, setShowSuccessToast] = useState(false); - const [showErrorToast, setShowErrorToast] = useState(false); - const [toastMessage, setToastMessage] = useState(''); - const [showVerifyCodeSectionSuccess, setShowVerifyCodeSectionSuccess] = - useState(false); - const [showVerifyCodeSectionError, setShowVerifyCodeSectionError] = - useState(false); - const [sentVerificationCode, setSentVerificationCode] = useState(''); - - const [showVerifiedSuccess, setShowVerifiedSuccess] = useState(false); - const [showVerifiedError, setShowVerifiedError] = useState(false); - const [emailVerifiedMessage, setEmailVerifiedMessage] = useState(''); + const showToast = useToast(); useEffect(() => { if (password) { @@ -111,28 +101,34 @@ export function UserCompletionForm() { try { const response = await apiClient.post('/User/SendEmailOtp', { email }); if (response.data?.success) { - setShowVerifyCodeSectionSuccess(true); - setSentVerificationCode( - response.data.message || 'کد با موفقیت ارسال شد', - ); + showToast({ + message: response.data.message || t('completion.successfullCodeSent'), + severity: 'success', + }); setCodeSent(true); setButtonState('counting'); setCountdown(120); } else if (response.data?.codeSentAnyway) { - setShowVerifyCodeSectionSuccess(true); - setSentVerificationCode( - 'کد ارسال شد، اما: ' + (response.data.message || ''), - ); + showToast({ + message: t('completion.codeSentBut') + (response.data.message || ''), + severity: 'warning', + }); setCodeSent(true); setButtonState('counting'); setCountdown(120); } else { - setShowVerifyCodeSectionError(true); - setSentVerificationCode(response.data.message || 'مشکلی پیش آمده'); + showToast({ + message: response.data.message || t('completion.problem'), + severity: 'error', + }); } - } catch (err: any) { - setShowVerifyCodeSectionError(true); - setSentVerificationCode(err.response?.data?.message || 'مشکلی پیش آمده'); + } catch (error: unknown) { + const err = error as AxiosError<{ message?: string }>; + + showToast({ + message: err.response?.data?.message || t('completion.problem'), + severity: 'error', + }); } finally { setLoading(false); } @@ -141,6 +137,7 @@ export function UserCompletionForm() { const handleVerifyCode = async () => { if (!verificationCode.trim()) { setError('Please enter the verification code'); + return; } @@ -156,18 +153,23 @@ export function UserCompletionForm() { if (res.data?.success) { setEmailVerified(true); setSuccess(true); - setShowVerifiedSuccess(true); - setEmailVerifiedMessage(res.data.message || 'کد با موفقیت تایید شد'); + showToast({ + message: res.data.message || t('completion.codeVerified'), + severity: 'success', + }); } else { - // setError(res.data?.message || 'Invalid verification code'); - setShowVerifiedError(true); - setEmailVerifiedMessage(res.data?.message || 'کد تایید نامعتبر است'); + showToast({ + message: res.data?.message || t('completion.invalidCode'), + severity: 'error', + }); setEmailVerified(false); } - } catch (err: any) { - setError(err.response?.data?.message || 'خطای ناشناخته'); - setShowVerifiedError(true); - setEmailVerifiedMessage(err.response?.data?.message || 'خطای ناشناخته'); + } catch (error: unknown) { + const err = error as AxiosError<{ message?: string }>; + showToast({ + message: err.response?.data?.message || '', + severity: 'error', + }); setEmailVerified(false); } finally { setIsVerifyingCode(false); @@ -205,17 +207,23 @@ export function UserCompletionForm() { country, }); if (data.success) { - setToastMessage(data.message || t('completion.submitSuccess')); - setShowSuccessToast(true); + showToast({ + message: data.message || t('completion.submitSuccess'), + severity: 'success', + }); } else { - setToastMessage(data.message || t('completion.submitError')); - setShowErrorToast(true); + showToast({ + message: data.message || t('completion.submitError'), + severity: 'success', + }); } - } catch (err: any) { - setToastMessage( - err.response?.data?.message || err.message || 'خطای ناشناخته', - ); - setShowErrorToast(true); + } catch (error: unknown) { + const err = error as AxiosError<{ message?: string }>; + showToast({ + message: + err.response?.data?.message || err.message || t('completion.problem'), + severity: 'error', + }); } finally { setLoading(false); } @@ -289,37 +297,6 @@ export function UserCompletionForm() { showValidations={showPasswordValidations} /> - setShowVerifyCodeSectionSuccess(false)} - > - {sentVerificationCode} - - - setShowVerifyCodeSectionError(false)} - > - {sentVerificationCode} - - - setShowVerifiedSuccess(false)} - > - {emailVerifiedMessage} - - - setShowVerifiedError(false)} - > - {emailVerifiedMessage} - - setShowSuccessToast(false)} - > - {toastMessage} - - setShowErrorToast(false)} - > - {toastMessage} - -