diff --git a/.eslintrc.json b/.eslintrc.json index 52f117a9..983897fc 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -23,7 +23,39 @@ }, "plugins": [ "@typescript-eslint", - "react" + "react", + "import" ], - "rules": {} + "rules": { + "import/order": [ + "error", + { + "groups": [ + "builtin", + "external", + "parent", + "sibling", + "index", + "object" + ], + "pathGroups": [ + { + "pattern": "react*", + "group": "external", + "position": "before" + }, + { + "pattern": "@/**/**", + "group": "parent", + "position": "before" + } + ], + "newlines-between": "always", + "alphabetize": { + "order": "asc", + "caseInsensitive": true + } + } + ] + } } diff --git a/package-lock.json b/package-lock.json index 267237b8..7e7ba1f5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -48,6 +48,7 @@ "dotenv": "16.3.1", "eslint": "8.47.0", "eslint-config-prettier": "9.0.0", + "eslint-plugin-import": "^2.29.1", "eslint-plugin-react": "7.33.2", "eslint-plugin-storybook": "^0.6.15", "html-webpack-plugin": "5.5.3", @@ -7615,6 +7616,12 @@ "integrity": "sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==", "dev": true }, + "node_modules/@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", + "dev": true + }, "node_modules/@types/lodash": { "version": "4.14.200", "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.200.tgz", @@ -8664,6 +8671,25 @@ "node": ">=8" } }, + "node_modules/array.prototype.findlastindex": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.3.tgz", + "integrity": "sha512-LzLoiOMAxvy+Gd3BAq3B7VeIgPdo+Q8hthvKtXybMvRV0jrXfJM/t8mw7nNlpEcVlVUnCnM2KSX4XU5HmpodOA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0", + "get-intrinsic": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/array.prototype.flat": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", @@ -10907,6 +10933,104 @@ "eslint": ">=7.0.0" } }, + "node_modules/eslint-import-resolver-node": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", + "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", + "dev": true, + "dependencies": { + "debug": "^3.2.7", + "is-core-module": "^2.13.0", + "resolve": "^1.22.4" + } + }, + "node_modules/eslint-import-resolver-node/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-module-utils": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz", + "integrity": "sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==", + "dev": true, + "dependencies": { + "debug": "^3.2.7" + }, + "engines": { + "node": ">=4" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } + }, + "node_modules/eslint-module-utils/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-import": { + "version": "2.29.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.29.1.tgz", + "integrity": "sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==", + "dev": true, + "dependencies": { + "array-includes": "^3.1.7", + "array.prototype.findlastindex": "^1.2.3", + "array.prototype.flat": "^1.3.2", + "array.prototype.flatmap": "^1.3.2", + "debug": "^3.2.7", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.9", + "eslint-module-utils": "^2.8.0", + "hasown": "^2.0.0", + "is-core-module": "^2.13.1", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.fromentries": "^2.0.7", + "object.groupby": "^1.0.1", + "object.values": "^1.1.7", + "semver": "^6.3.1", + "tsconfig-paths": "^3.15.0" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" + } + }, + "node_modules/eslint-plugin-import/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-import/node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/eslint-plugin-react": { "version": "7.33.2", "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.33.2.tgz", @@ -12149,10 +12273,13 @@ } }, "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/function.prototype.name": { "version": "1.1.6", @@ -12589,6 +12716,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/hasown": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", + "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", @@ -13259,12 +13398,12 @@ } }, "node_modules/is-core-module": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", - "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", "dev": true, "dependencies": { - "has": "^1.0.3" + "hasown": "^2.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -15492,6 +15631,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/object.groupby": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.1.tgz", + "integrity": "sha512-HqaQtqLnp/8Bn4GL16cj+CUYbnpe1bh0TtEaWvybszDG4tgxCJuRpV8VGuvNaI1fAnI4lUJzDG55MXcOH4JZcQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1" + } + }, "node_modules/object.hasown": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/object.hasown/-/object.hasown-1.1.3.tgz", @@ -18203,6 +18354,15 @@ "node": ">=8" } }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/strip-final-newline": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", @@ -19181,6 +19341,30 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, + "node_modules/tsconfig-paths": { + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", + "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", + "dev": true, + "dependencies": { + "@types/json5": "^0.0.29", + "json5": "^1.0.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + } + }, + "node_modules/tsconfig-paths/node_modules/json5": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, "node_modules/tslib": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", @@ -25494,6 +25678,12 @@ "integrity": "sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==", "dev": true }, + "@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", + "dev": true + }, "@types/lodash": { "version": "4.14.200", "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.200.tgz", @@ -26330,6 +26520,19 @@ "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true }, + "array.prototype.findlastindex": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.3.tgz", + "integrity": "sha512-LzLoiOMAxvy+Gd3BAq3B7VeIgPdo+Q8hthvKtXybMvRV0jrXfJM/t8mw7nNlpEcVlVUnCnM2KSX4XU5HmpodOA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0", + "get-intrinsic": "^1.2.1" + } + }, "array.prototype.flat": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", @@ -28125,6 +28328,93 @@ "dev": true, "requires": {} }, + "eslint-import-resolver-node": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", + "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", + "dev": true, + "requires": { + "debug": "^3.2.7", + "is-core-module": "^2.13.0", + "resolve": "^1.22.4" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "eslint-module-utils": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz", + "integrity": "sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==", + "dev": true, + "requires": { + "debug": "^3.2.7" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "eslint-plugin-import": { + "version": "2.29.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.29.1.tgz", + "integrity": "sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==", + "dev": true, + "requires": { + "array-includes": "^3.1.7", + "array.prototype.findlastindex": "^1.2.3", + "array.prototype.flat": "^1.3.2", + "array.prototype.flatmap": "^1.3.2", + "debug": "^3.2.7", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.9", + "eslint-module-utils": "^2.8.0", + "hasown": "^2.0.0", + "is-core-module": "^2.13.1", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.fromentries": "^2.0.7", + "object.groupby": "^1.0.1", + "object.values": "^1.1.7", + "semver": "^6.3.1", + "tsconfig-paths": "^3.15.0" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + } + } + }, "eslint-plugin-react": { "version": "7.33.2", "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.33.2.tgz", @@ -28994,9 +29284,9 @@ "optional": true }, "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "dev": true }, "function.prototype.name": { @@ -29308,6 +29598,15 @@ "has-symbols": "^1.0.2" } }, + "hasown": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", + "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", + "dev": true, + "requires": { + "function-bind": "^1.1.2" + } + }, "he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", @@ -29790,12 +30089,12 @@ "dev": true }, "is-core-module": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", - "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", "dev": true, "requires": { - "has": "^1.0.3" + "hasown": "^2.0.0" } }, "is-date-object": { @@ -31412,6 +31711,18 @@ "es-abstract": "^1.22.1" } }, + "object.groupby": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.1.tgz", + "integrity": "sha512-HqaQtqLnp/8Bn4GL16cj+CUYbnpe1bh0TtEaWvybszDG4tgxCJuRpV8VGuvNaI1fAnI4lUJzDG55MXcOH4JZcQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1" + } + }, "object.hasown": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/object.hasown/-/object.hasown-1.1.3.tgz", @@ -33392,6 +33703,12 @@ "ansi-regex": "^5.0.1" } }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true + }, "strip-final-newline": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", @@ -34127,6 +34444,29 @@ } } }, + "tsconfig-paths": { + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", + "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", + "dev": true, + "requires": { + "@types/json5": "^0.0.29", + "json5": "^1.0.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + }, + "dependencies": { + "json5": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + } + } + }, "tslib": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", diff --git a/package.json b/package.json index 710c27d2..27e246a6 100644 --- a/package.json +++ b/package.json @@ -70,6 +70,7 @@ "dotenv": "16.3.1", "eslint": "8.47.0", "eslint-config-prettier": "9.0.0", + "eslint-plugin-import": "^2.29.1", "eslint-plugin-react": "7.33.2", "eslint-plugin-storybook": "^0.6.15", "html-webpack-plugin": "5.5.3", diff --git a/src/app/App.tsx b/src/app/App.tsx index 359ab20e..89f712ad 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -1,10 +1,12 @@ -import { RouterProvider } from 'react-router-dom' -import { router } from './router/AppRouter' import { useEffect } from 'react' +import { RouterProvider } from 'react-router-dom' + import { loginActions } from '@/features/login/model/slice/loginSlice' -import { useAppDispatch } from '@/shared/libs/hooks/store' -import { tokenFromStorageGet } from '@/shared/libs/helpers/localStorageHandler' import { $api } from '@/shared/api/api' +import { tokenFromStorageGet } from '@/shared/libs/helpers/localStorageHandler' +import { useAppDispatch } from '@/shared/libs/hooks/store' + +import { router } from './router/AppRouter' function App() { const dispatch = useAppDispatch() diff --git a/src/app/providers/StoreProvider/ui/StoreProvider.tsx b/src/app/providers/StoreProvider/ui/StoreProvider.tsx index 99a44f0f..57ab18e6 100644 --- a/src/app/providers/StoreProvider/ui/StoreProvider.tsx +++ b/src/app/providers/StoreProvider/ui/StoreProvider.tsx @@ -1,6 +1,7 @@ +import { DeepPartial } from '@reduxjs/toolkit' import { ReactNode } from 'react' import { Provider } from 'react-redux' -import { DeepPartial } from '@reduxjs/toolkit' + import { StateSchema } from '../config/StateSchema' import { createReduxStore } from '../config/store' diff --git a/src/app/router/AppRouter/ui/AppRouter.tsx b/src/app/router/AppRouter/ui/AppRouter.tsx index 28420af7..7c67e54b 100644 --- a/src/app/router/AppRouter/ui/AppRouter.tsx +++ b/src/app/router/AppRouter/ui/AppRouter.tsx @@ -1,15 +1,16 @@ import { createBrowserRouter } from 'react-router-dom' -import { Routes } from '@/shared/config/routerConfig/routes' -import MainPage from '@/pages/MainPage/MainPage' -import { ProductsPage } from '@/pages/ProductsPage/ProductsPage' + import BlogPage from '@/pages/BlogPage/BlogPage' -import RootPage from '@/pages/RootPage/RootPage' -import ErrorPage from '@/pages/ErrorPage/ErrorPage' -import LoginPage from '@/pages/LoginPage/LoginPage' +import CartPage from '@/pages/CartPage/CartPage' import ComparePage from '@/pages/ComparePage/ComparePage' +import ErrorPage from '@/pages/ErrorPage/ErrorPage' import FavoritesPage from '@/pages/FavoritesPage/FavoritesPage' -import CartPage from '@/pages/CartPage/CartPage' +import LoginPage from '@/pages/LoginPage/LoginPage' +import MainPage from '@/pages/MainPage/MainPage' +import { ProductsPage } from '@/pages/ProductsPage/ProductsPage' +import RootPage from '@/pages/RootPage/RootPage' import SearchResultsPage from '@/pages/SearchResultsPage/SearchResultsPage' +import { Routes } from '@/shared/config/routerConfig/routes' export const AppRouter = createBrowserRouter([ { diff --git a/src/assets/icons/IconLike.tsx b/src/assets/icons/IconLike.tsx index 5b08e702..106ca290 100644 --- a/src/assets/icons/IconLike.tsx +++ b/src/assets/icons/IconLike.tsx @@ -1,4 +1,5 @@ import { FC, useMemo } from 'react' + import type { TProps } from '../../models/SvgModel' /** diff --git a/src/assets/icons/IconLink.tsx b/src/assets/icons/IconLink.tsx index cc75bc96..c28dea52 100644 --- a/src/assets/icons/IconLink.tsx +++ b/src/assets/icons/IconLink.tsx @@ -1,4 +1,5 @@ import { FC, useMemo } from 'react' + import type { TProps } from '@/models/SvgModel' /** @@ -13,7 +14,12 @@ const IconLink: FC = props => { }, [styles]) return ( - + diff --git a/src/assets/icons/IconStar.tsx b/src/assets/icons/IconStar.tsx index 5a0c69fc..d7722521 100644 --- a/src/assets/icons/IconStar.tsx +++ b/src/assets/icons/IconStar.tsx @@ -1,4 +1,5 @@ import { FC, useMemo } from 'react' + import type { TProps } from '@/models/SvgModel' /** @@ -13,7 +14,13 @@ const IconStar: FC = props => { }, [styles]) return ( - + void type: 'prev' | 'next' diff --git a/src/components/ArticleBlock/ArticleBlock.tsx b/src/components/ArticleBlock/ArticleBlock.tsx index 2de4fc25..63a930f4 100644 --- a/src/components/ArticleBlock/ArticleBlock.tsx +++ b/src/components/ArticleBlock/ArticleBlock.tsx @@ -1,8 +1,9 @@ +import ArrowReadNext from '@/assets/icons/ArrowReadNext.svg' import description from '@/assets/images/articleBlock/description.png' import Heading, { HeadingType } from '@/shared/ui/Heading/Heading' -import Paragraph from '@/shared/ui/Paragraph/Paragraph' -import ArrowReadNext from '@/assets/icons/ArrowReadNext.svg' import Link from '@/shared/ui/Link/Link' +import Paragraph from '@/shared/ui/Paragraph/Paragraph' + import styles from './articleBlock.module.scss' function ArticleBlock() { diff --git a/src/components/BlogCategories/BlogCategories.tsx b/src/components/BlogCategories/BlogCategories.tsx index 6c7f77dc..1828388d 100644 --- a/src/components/BlogCategories/BlogCategories.tsx +++ b/src/components/BlogCategories/BlogCategories.tsx @@ -1,8 +1,10 @@ -import styles from './blog-categories.module.scss' import { FC, useMemo } from 'react' + import type { PropsCategories } from '@/models/PropsBlog' import Heading, { HeadingType } from '@/shared/ui/Heading/Heading' +import styles from './blog-categories.module.scss' + const BlogCategories: FC = props => { const { cards, filterItems } = props diff --git a/src/components/BlogItemForContainer/BlogItemForContainer.tsx b/src/components/BlogItemForContainer/BlogItemForContainer.tsx index 0287f80c..4bd1ef8e 100644 --- a/src/components/BlogItemForContainer/BlogItemForContainer.tsx +++ b/src/components/BlogItemForContainer/BlogItemForContainer.tsx @@ -1,12 +1,14 @@ import { FC, useMemo } from 'react' + +import CommentIcon from '@/assets/images/blogMainItem/icon-comments.svg' +import ViewIcon from '@/assets/images/blogMainItem/icon-views.svg' import type { TBlogItem } from '@/models/BlogItemModel' import { TEXT_PROMO } from '@/shared/constants/constants' -import styles from './blog-item-for-container.module.scss' -import ViewIcon from '@/assets/images/blogMainItem/icon-views.svg' -import CommentIcon from '@/assets/images/blogMainItem/icon-comments.svg' import { fromSS } from '@/shared/constants/constants' import Link from '@/shared/ui/Link/Link' +import styles from './blog-item-for-container.module.scss' + export type Props = { card: TBlogItem } diff --git a/src/components/BlogMain/BlogMain.tsx b/src/components/BlogMain/BlogMain.tsx index 76f8bfc4..4dc261f4 100644 --- a/src/components/BlogMain/BlogMain.tsx +++ b/src/components/BlogMain/BlogMain.tsx @@ -1,13 +1,16 @@ import { FC, useState } from 'react' -import BlogItemForContainer from '../BlogItemForContainer/BlogItemForContainer' + import type { PropsBlog } from '@/models/PropsBlog' -import BlogTags from '../BlogTags/BlogTags' +import Heading from '@/shared/ui/Heading/Heading' +import Subheading from '@/shared/ui/Subheading/Subheading' + import BlogCategories from '../BlogCategories/BlogCategories' -import WrapperForMainContent from '../WrapperForMainContent/WrapperForMainContent' +import BlogItemForContainer from '../BlogItemForContainer/BlogItemForContainer' import BlogMainItem from '../BlogMainItem/BlogMainItem' +import BlogTags from '../BlogTags/BlogTags' import { Pagination } from '../Pagination/Pagination' -import Heading from '@/shared/ui/Heading/Heading' -import Subheading from '@/shared/ui/Subheading/Subheading' +import WrapperForMainContent from '../WrapperForMainContent/WrapperForMainContent' + import styles from './blog-main.module.scss' const BlogMain: FC = props => { @@ -57,9 +60,11 @@ const BlogMain: FC = props => {
diff --git a/src/components/BlogMainItem/BlogMainItem.tsx b/src/components/BlogMainItem/BlogMainItem.tsx index 95c5c88a..5c41b00f 100644 --- a/src/components/BlogMainItem/BlogMainItem.tsx +++ b/src/components/BlogMainItem/BlogMainItem.tsx @@ -1,12 +1,14 @@ -import { blogMainItemData } from '@/mockData/blogMainItemData' import { useEffect, useMemo } from 'react' -import ViewIcon from '@/assets/images/blogMainItem/icon-views.svg' + import CommentIcon from '@/assets/images/blogMainItem/icon-comments.svg' import DotIcon from '@/assets/images/blogMainItem/icon-dot.svg' +import ViewIcon from '@/assets/images/blogMainItem/icon-views.svg' +import { blogMainItemData } from '@/mockData/blogMainItemData' import { fromSS } from '@/shared/constants/constants' -import styles from './blog-main-item.module.scss' import Link from '@/shared/ui/Link/Link' +import styles from './blog-main-item.module.scss' + function BlogMainItem() { const mainItem = blogMainItemData const tags = useMemo( diff --git a/src/components/BlogTags/BlogTags.tsx b/src/components/BlogTags/BlogTags.tsx index c54d9878..a5b8e422 100644 --- a/src/components/BlogTags/BlogTags.tsx +++ b/src/components/BlogTags/BlogTags.tsx @@ -1,7 +1,9 @@ import { FC, useMemo } from 'react' -import styles from './blog-tags.module.scss' + import type { PropsTags } from '@/models/PropsBlog' +import styles from './blog-tags.module.scss' + const BlogTags: FC = props => { const { cards, filterItems } = props const tags = useMemo( diff --git a/src/components/CardForContainer/CardForContainer.tsx b/src/components/CardForContainer/CardForContainer.tsx index 015b76a3..f8202230 100644 --- a/src/components/CardForContainer/CardForContainer.tsx +++ b/src/components/CardForContainer/CardForContainer.tsx @@ -1,9 +1,11 @@ import { FC } from 'react' + import { TCard } from '@/models/CardModel' import { TEXT_PROMO } from '@/shared/constants/constants' -import styles from './card-for-container.module.scss' import Link from '@/shared/ui/Link/Link' +import styles from './card-for-container.module.scss' + export type Props = { card: TCard } diff --git a/src/components/CardPreview/CardPreview.tsx b/src/components/CardPreview/CardPreview.tsx index 0a43987c..e3c632d6 100644 --- a/src/components/CardPreview/CardPreview.tsx +++ b/src/components/CardPreview/CardPreview.tsx @@ -1,10 +1,13 @@ import { FC, lazy, useState, Suspense } from 'react' -import Modal from '@/shared/ui/Modal/Modal' + import { Button, ButtonSize, ButtonTheme } from '@/shared/ui/Button/Button' +import Modal from '@/shared/ui/Modal/Modal' +import Spinner from '@/shared/ui/Spinner/Spinner' + import { CardPreviewFooter } from '../CardPreviewFooter/CardPreviewFooter' import { CardPreviewHeader } from '../CardPreviewHeader/CardPreviewHeader' import { ProductAvailability } from '../ProductAvailability/ProductAvailability' -import Spinner from '@/shared/ui/Spinner/Spinner' + import styles from './CardPreview.module.scss' const LazyQuickPurchaseForm = lazy(() => import('@/features/QuickPurchase/index')) diff --git a/src/components/CardPreviewFooter/CardPreviewFooter.tsx b/src/components/CardPreviewFooter/CardPreviewFooter.tsx index 4f1eb697..e7820749 100644 --- a/src/components/CardPreviewFooter/CardPreviewFooter.tsx +++ b/src/components/CardPreviewFooter/CardPreviewFooter.tsx @@ -1,7 +1,9 @@ import { FC } from 'react' -import styles from './CardPreviewFooter.module.scss' + import { Button, ButtonSize, ButtonTheme } from '@/shared/ui/Button/Button' +import styles from './CardPreviewFooter.module.scss' + interface TCardPreview { handleRedirect: VoidFunction } diff --git a/src/components/CardPreviewHeader/CardPreviewHeader.tsx b/src/components/CardPreviewHeader/CardPreviewHeader.tsx index 88e9ead7..623e3e87 100644 --- a/src/components/CardPreviewHeader/CardPreviewHeader.tsx +++ b/src/components/CardPreviewHeader/CardPreviewHeader.tsx @@ -1,10 +1,12 @@ -import { FC } from 'react' import classnames from 'classnames' +import { FC } from 'react' + import IconCompare from '@/assets/icons/IconCompare.svg' import IconLike from '@/assets/icons/IconLike' -import styles from './CardPreviewHeader.module.scss' import { Button, ButtonSize } from '@/shared/ui/Button/Button' +import styles from './CardPreviewHeader.module.scss' + interface TCardPreviewHeader { isLiked: boolean isInCompared: boolean diff --git a/src/components/CatalogLink/CatalogLink.tsx b/src/components/CatalogLink/CatalogLink.tsx index 204c4fbf..b23546fd 100644 --- a/src/components/CatalogLink/CatalogLink.tsx +++ b/src/components/CatalogLink/CatalogLink.tsx @@ -1,6 +1,8 @@ -import { FC } from 'react' import classNames from 'classnames' +import { FC } from 'react' + import Link, { TLinkProps } from '@/shared/ui/Link/Link' + import styles from './catalogLink.module.scss' /** diff --git a/src/components/CategoryList/CategoryList.tsx b/src/components/CategoryList/CategoryList.tsx index 0f1c7fcf..e8b78610 100644 --- a/src/components/CategoryList/CategoryList.tsx +++ b/src/components/CategoryList/CategoryList.tsx @@ -1,6 +1,8 @@ import { FC } from 'react' + import Heading, { HeadingType } from '@/shared/ui/Heading/Heading' import Link from '@/shared/ui/Link/Link' + import styles from './CategoryList.module.scss' /** diff --git a/src/components/ContainerCards/ContainerCards.tsx b/src/components/ContainerCards/ContainerCards.tsx index f0239870..504d5120 100644 --- a/src/components/ContainerCards/ContainerCards.tsx +++ b/src/components/ContainerCards/ContainerCards.tsx @@ -1,9 +1,12 @@ import { FC } from 'react' -import CardForContainer from '../CardForContainer/CardForContainer' -import { TCard } from '@/models/CardModel' + import IconLink from '@/assets/icons/IconLink' +import { TCard } from '@/models/CardModel' import Heading, { HeadingType } from '@/shared/ui/Heading/Heading' import Link from '@/shared/ui/Link/Link' + +import CardForContainer from '../CardForContainer/CardForContainer' + import styles from './container-cards.module.scss' export type Props = { diff --git a/src/components/ContextMenuElement/ContextMenuElement.tsx b/src/components/ContextMenuElement/ContextMenuElement.tsx index fd2df7f3..16b419ef 100644 --- a/src/components/ContextMenuElement/ContextMenuElement.tsx +++ b/src/components/ContextMenuElement/ContextMenuElement.tsx @@ -1,5 +1,7 @@ import { type FC, ReactNode, useEffect, useRef, useState } from 'react' + import { LEFT_POSITION, RIGHT_POSITION } from '@/shared/constants/constants' + import styles from './contextMenuElement.module.scss' type TContextMenuElement = { diff --git a/src/components/Dots/Dots.tsx b/src/components/Dots/Dots.tsx index c217fce2..f0ce5635 100644 --- a/src/components/Dots/Dots.tsx +++ b/src/components/Dots/Dots.tsx @@ -1,4 +1,5 @@ import { FC } from 'react' + import styles from './dots.module.scss' export type Props = { diff --git a/src/components/Dropdown/Dropdown.tsx b/src/components/Dropdown/Dropdown.tsx index ef9bde63..0728b969 100644 --- a/src/components/Dropdown/Dropdown.tsx +++ b/src/components/Dropdown/Dropdown.tsx @@ -1,4 +1,5 @@ import React, { ChangeEvent, useState } from 'react' + import styles from './Dropdown.module.scss' interface DropdownProps extends React.HTMLProps { diff --git a/src/components/HeaderAccount/HeaderAccount.tsx b/src/components/HeaderAccount/HeaderAccount.tsx index d450c9f7..f07fc3eb 100644 --- a/src/components/HeaderAccount/HeaderAccount.tsx +++ b/src/components/HeaderAccount/HeaderAccount.tsx @@ -1,19 +1,21 @@ import { FC, lazy, useState, Suspense, useEffect } from 'react' import { useSelector } from 'react-redux' -import Modal from '@/shared/ui/Modal/Modal' + +import CartIcon from '@/assets/images/headerAccount/cart.svg' +import HeartIcon from '@/assets/images/headerAccount/heart.svg' import PersonIcon from '@/assets/images/headerAccount/person.svg' import PersonAuthIcon from '@/assets/images/headerAccount/person_auth.svg' import ScalesIcon from '@/assets/images/headerAccount/scales.svg' -import HeartIcon from '@/assets/images/headerAccount/heart.svg' -import CartIcon from '@/assets/images/headerAccount/cart.svg' -import Spinner from '@/shared/ui/Spinner/Spinner' -import styles from './headerAccount.module.scss' -import { useAppDispatch } from '@/shared/libs/hooks/store' -import { logout } from '@/features/login/model/services/logout/logout' import { getUserAuthStatus } from '@/features/login/model/selectors/getUserAuthStatus' +import { logout } from '@/features/login/model/services/logout/logout' import { loginActions } from '@/features/login/model/slice/loginSlice' -import Link from '@/shared/ui/Link/Link' import { Routes } from '@/shared/config/routerConfig/routes' +import { useAppDispatch } from '@/shared/libs/hooks/store' +import Link from '@/shared/ui/Link/Link' +import Modal from '@/shared/ui/Modal/Modal' +import Spinner from '@/shared/ui/Spinner/Spinner' + +import styles from './headerAccount.module.scss' export type HeaderAccountProps = { counter: number diff --git a/src/components/PageControls/PageControls.tsx b/src/components/PageControls/PageControls.tsx index 450f6172..426f8179 100644 --- a/src/components/PageControls/PageControls.tsx +++ b/src/components/PageControls/PageControls.tsx @@ -1,9 +1,11 @@ import { ChangeEventHandler, FC } from 'react' -import { Dropdown } from '@/components/Dropdown/Dropdown' + +import IconCompact from '@/assets/icons/IconCompact.svg' import IconGrid from '@/assets/icons/IconGrid.svg' import IconList from '@/assets/icons/IconList.svg' -import IconCompact from '@/assets/icons/IconCompact.svg' +import { Dropdown } from '@/components/Dropdown/Dropdown' import { ECardView } from '@/shared/model/types/common' + import styles from './PageControls.module.scss' type TPageControls = { diff --git a/src/components/PageDescription/PageDescription.tsx b/src/components/PageDescription/PageDescription.tsx index 61a7134f..00281992 100644 --- a/src/components/PageDescription/PageDescription.tsx +++ b/src/components/PageDescription/PageDescription.tsx @@ -1,8 +1,9 @@ -import styles from './PageDescription.module.scss' import Heading from '@/shared/ui/Heading/Heading' import Link from '@/shared/ui/Link/Link' import Subheading from '@/shared/ui/Subheading/Subheading' +import styles from './PageDescription.module.scss' + /** * Компонент заголовка страницы товаров. * Содержит информацию о текущей просматриваемой категории. diff --git a/src/components/Pagination/Pagination.tsx b/src/components/Pagination/Pagination.tsx index e03d1ed4..41366253 100644 --- a/src/components/Pagination/Pagination.tsx +++ b/src/components/Pagination/Pagination.tsx @@ -1,4 +1,5 @@ import { FC } from 'react' + import styles from './Pagination.module.scss' type TPaginationProps = { @@ -15,7 +16,12 @@ type TPaginationProps = { * @param {function} handlePageChange - функция изменения отображаемой страницы; * @param {function} handleShowMore - функция управления подгрузкой дополнительного контента; */ -export const Pagination: FC = ({ currentPage, totalPages, handlePageChange, handleShowMore }) => { +export const Pagination: FC = ({ + currentPage, + totalPages, + handlePageChange, + handleShowMore +}) => { return (
diff --git a/src/components/ProductAvailability/ProductAvailability.tsx b/src/components/ProductAvailability/ProductAvailability.tsx index 8e365746..555b97c7 100644 --- a/src/components/ProductAvailability/ProductAvailability.tsx +++ b/src/components/ProductAvailability/ProductAvailability.tsx @@ -1,4 +1,5 @@ import { FC } from 'react' + import styles from './ProductAvailability.module.scss' /** diff --git a/src/components/ProductCard/ProductCard.tsx b/src/components/ProductCard/ProductCard.tsx index 3ee369f1..1bb2995b 100644 --- a/src/components/ProductCard/ProductCard.tsx +++ b/src/components/ProductCard/ProductCard.tsx @@ -1,13 +1,16 @@ +import classnames from 'classnames' import { FC, useState } from 'react' + +import { PRODUCT_PHOTOS } from '@/mockData/productsPageOptions' import { ECardView } from '@/shared/model/types/common' -import styles from './ProductCard.module.scss' -import classnames from 'classnames' +import Carousel from '@/shared/ui/Carousel/Carousel' + import { ProductAvailability } from '../ProductAvailability/ProductAvailability' import { WidgetButtonsFunctions } from '../WidgetButtonsFunctions/WidgetButtonsFunctions' import { WidgetButtonsPurchase } from '../WidgetButtonsPurchase/WidgetButtonsPurchase' + +import styles from './ProductCard.module.scss' import { getStylesForCurrentLayout } from './utils/utils' -import { PRODUCT_PHOTOS } from '@/mockData/productsPageOptions' -import Carousel from '@/shared/ui/Carousel/Carousel' type TProductCard = { layout: ECardView @@ -115,8 +118,9 @@ export const ProductCard: FC = ({ layout, onEyeClick }) => {
{layout === 'list' && (

- GSM/GPS трекер-маяк GF-07 для отслеживания собак, детей, автомобилей с приложением на телефон. Миниатюрный - GPS трекер модели GF-07 предназначен для охраны вашего имущества и контроля за местонахождением. + GSM/GPS трекер-маяк GF-07 для отслеживания собак, детей, автомобилей с приложением на телефон. + Миниатюрный GPS трекер модели GF-07 предназначен для охраны вашего имущества и контроля за + местонахождением.

)} {layout === 'compact' && ( diff --git a/src/components/Slider/Slider.tsx b/src/components/Slider/Slider.tsx index ea31d14a..d4261345 100644 --- a/src/components/Slider/Slider.tsx +++ b/src/components/Slider/Slider.tsx @@ -1,11 +1,14 @@ import { FC, useState } from 'react' -import Arrows from '../Arrows/Arrows' -import Dots from '../Dots/Dots' + import { sliderData } from '@/mockData/sliderData' +import { media } from '@/shared/styles/utils/media' import Link from '@/shared/ui/Link/Link' -import styles from './slider.module.scss' import Img from '@/ui/img' -import { media } from '@/shared/styles/utils/media' + +import Arrows from '../Arrows/Arrows' +import Dots from '../Dots/Dots' + +import styles from './slider.module.scss' /** * Component Slider diff --git a/src/components/SliderBlock/SliderBlock.tsx b/src/components/SliderBlock/SliderBlock.tsx index 9ae6936c..b8e0c118 100644 --- a/src/components/SliderBlock/SliderBlock.tsx +++ b/src/components/SliderBlock/SliderBlock.tsx @@ -1,6 +1,7 @@ -import styles from './slider-block.module.scss' import Slider from '../Slider/Slider' +import styles from './slider-block.module.scss' + /** * Component SliderBlock * Обертка для слайдера на главной странице. diff --git a/src/components/Subscribe/Subscribe.tsx b/src/components/Subscribe/Subscribe.tsx index c4a18f33..84e08f5f 100644 --- a/src/components/Subscribe/Subscribe.tsx +++ b/src/components/Subscribe/Subscribe.tsx @@ -1,7 +1,9 @@ -import styles from './Subscribe.module.scss' import imgSubs from '@/assets/images/img-subsc-small.png' + import SubscribeForm from '../../features/SubscribeForm/SubscribeForm' +import styles from './Subscribe.module.scss' + const Subscribe = () => { const onSubmitHandler = () => {} diff --git a/src/components/WidgetButtonsFunctions/WidgetButtonsFunctions.tsx b/src/components/WidgetButtonsFunctions/WidgetButtonsFunctions.tsx index 9f609ef9..bb9185d9 100644 --- a/src/components/WidgetButtonsFunctions/WidgetButtonsFunctions.tsx +++ b/src/components/WidgetButtonsFunctions/WidgetButtonsFunctions.tsx @@ -1,12 +1,14 @@ -import { FC } from 'react' import classnames from 'classnames' +import { FC } from 'react' -import { ECardView } from '@/shared/model/types/common' import IconCompare from '@/assets/icons/IconCompare.svg' import IconLike from '@/assets/icons/IconLike' +import { ECardView } from '@/shared/model/types/common' import { Button, ButtonSize, ButtonTheme } from '@/shared/ui/Button/Button' -import { getStylesForCurrentLayout } from '../ProductCard/utils/utils' + import styles from '../ProductCard/ProductCard.module.scss' +import { getStylesForCurrentLayout } from '../ProductCard/utils/utils' + import stylesSvg from './WidgetButtonsFunctions.module.scss' type TWidgetButtonsFunctions = { diff --git a/src/components/WidgetButtonsPurchase/WidgetButtonsPurchase.tsx b/src/components/WidgetButtonsPurchase/WidgetButtonsPurchase.tsx index 6bdc8d61..abf41054 100644 --- a/src/components/WidgetButtonsPurchase/WidgetButtonsPurchase.tsx +++ b/src/components/WidgetButtonsPurchase/WidgetButtonsPurchase.tsx @@ -1,8 +1,10 @@ import { FC } from 'react' + import IconCart from '@/assets/icons/IconCart.svg' import IconEye from '@/assets/icons/IconEye.svg' import { ECardView } from '@/shared/model/types/common' import { Button, ButtonSize, ButtonTheme } from '@/shared/ui/Button/Button' + import styles from './WidgetButtonsPurchase.module.scss' type TWidgetButtonsPurchase = { diff --git a/src/components/WrapperForMainContent/WrapperForMainContent.tsx b/src/components/WrapperForMainContent/WrapperForMainContent.tsx index 597c1d66..d0366d7c 100644 --- a/src/components/WrapperForMainContent/WrapperForMainContent.tsx +++ b/src/components/WrapperForMainContent/WrapperForMainContent.tsx @@ -1,4 +1,5 @@ import { FC, PropsWithChildren } from 'react' + import styles from './wrapper.module.scss' /** diff --git a/src/components/header/header.tsx b/src/components/header/header.tsx index 6fcef70a..603571cd 100644 --- a/src/components/header/header.tsx +++ b/src/components/header/header.tsx @@ -1,27 +1,30 @@ -import { coreBaseData } from '@/mockData/coreBaseData' -import { useEffect, useMemo } from 'react' import classNames from 'classnames' -import Logo from '../../shared/ui/logo/Logo' +import { useEffect, useMemo } from 'react' +import { useDispatch, useSelector } from 'react-redux' + +import { AppDispatch } from '@/app/providers/StoreProvider/config/store' import ArrowIcon from '@/assets/icons/arrow.svg' +import IconCategories from '@/assets/icons/IconCategories.svg' import LightningIcon from '@/assets/images/header/lightning.svg' -import ContextMenuElement from '../ContextMenuElement/ContextMenuElement' -import HeaderAccount from '../HeaderAccount/HeaderAccount' -import { PHONE_NUMBER } from '@/shared/constants/constants' +import { selectCategories, selectDisplayedCategories } from '@/entities/Category/selectors/categorySelectors' +import { fetchCategories } from '@/entities/Category/slice/categorySlice' +import SearchProduct from '@/features/SearchProduct' +import { linkItems } from '@/mockData/catalogListData' +import { coreBaseData } from '@/mockData/coreBaseData' import { headerAccountData } from '@/mockData/headerAccountData' -import CatalogLink from '../CatalogLink/CatalogLink' import { Routes } from '@/shared/config/routerConfig/routes' +import { PHONE_NUMBER } from '@/shared/constants/constants' import Link from '@/shared/ui/Link/Link' -import IconCategories from '@/assets/icons/IconCategories.svg' -import SearchProduct from '@/features/SearchProduct' -import { linkItems } from '@/mockData/catalogListData' -import styles from './header.module.scss' -import { useDispatch, useSelector } from 'react-redux' -import { fetchCategories } from '@/entities/Category/slice/categorySlice' -import { AppDispatch } from '@/app/providers/StoreProvider/config/store' -import { selectCategories, selectDisplayedCategories } from '@/entities/Category/selectors/categorySelectors' import CatalogNodeItem from '@/widgets/CatalogNodeItem/CatalogNodeItem' import NavigationLink from '@/widgets/NavigationLink/NavigationLink' +import Logo from '../../shared/ui/logo/Logo' +import CatalogLink from '../CatalogLink/CatalogLink' +import ContextMenuElement from '../ContextMenuElement/ContextMenuElement' +import HeaderAccount from '../HeaderAccount/HeaderAccount' + +import styles from './header.module.scss' + function Header() { const dispatch = useDispatch() const categories = useSelector(selectCategories) diff --git a/src/entities/AdvantageCard/ui/AdvantageCard/AdvantageCard.tsx b/src/entities/AdvantageCard/ui/AdvantageCard/AdvantageCard.tsx index a6fbf762..62dd05a2 100644 --- a/src/entities/AdvantageCard/ui/AdvantageCard/AdvantageCard.tsx +++ b/src/entities/AdvantageCard/ui/AdvantageCard/AdvantageCard.tsx @@ -1,5 +1,7 @@ import { FC } from 'react' + import Link from '@/shared/ui/Link/Link' + import styles from './advantageCard.module.scss' export type TAdvantageCardProps = { diff --git a/src/entities/BlogCard/BlogCard.stories.tsx b/src/entities/BlogCard/BlogCard.stories.tsx index d571daec..35f7d03e 100644 --- a/src/entities/BlogCard/BlogCard.stories.tsx +++ b/src/entities/BlogCard/BlogCard.stories.tsx @@ -1,7 +1,9 @@ import type { Meta, StoryObj } from '@storybook/react' -import BlogCard from './BlogCard' + import Img1 from '@/assets/images/blog/img-blog-01.png' +import BlogCard from './BlogCard' + const meta = { title: 'entities/BlogCard', component: BlogCard, diff --git a/src/entities/BlogCard/BlogCard.tsx b/src/entities/BlogCard/BlogCard.tsx index c189ae9b..bf03c425 100644 --- a/src/entities/BlogCard/BlogCard.tsx +++ b/src/entities/BlogCard/BlogCard.tsx @@ -1,8 +1,10 @@ import { FC, useMemo } from 'react' -import styles from './BlogCard.module.scss' -import Link from '@/shared/ui/Link/Link' -import Heading, { HeadingType } from '@/shared/ui/Heading/Heading' + import NoImage from '@/assets/icons/image-not-found-icon.svg' +import Heading, { HeadingType } from '@/shared/ui/Heading/Heading' +import Link from '@/shared/ui/Link/Link' + +import styles from './BlogCard.module.scss' type Props = { id: number diff --git a/src/entities/BrandCard/BrandCard.stories.tsx b/src/entities/BrandCard/BrandCard.stories.tsx index 5babf4d3..44a797ae 100644 --- a/src/entities/BrandCard/BrandCard.stories.tsx +++ b/src/entities/BrandCard/BrandCard.stories.tsx @@ -1,7 +1,9 @@ import type { Meta, StoryObj } from '@storybook/react' -import BrandCard from './BrandCard' + import Brand1 from '@/assets/images/brands/1-150x150.webp' +import BrandCard from './BrandCard' + const meta = { title: 'entities/BrandBlock', component: BrandCard, diff --git a/src/entities/BrandCard/BrandCard.tsx b/src/entities/BrandCard/BrandCard.tsx index 60095f28..893fb157 100644 --- a/src/entities/BrandCard/BrandCard.tsx +++ b/src/entities/BrandCard/BrandCard.tsx @@ -1,9 +1,11 @@ import { FC } from 'react' + +import BrandWithoutImage from '@/assets/images/brands/brand-without-image.webp' import { Routes } from '@/shared/config/routerConfig/routes' -import { Brand } from '@/widgets/BrandBlock/types/types' import Link from '@/shared/ui/Link/Link' import Img from '@/ui/img' -import BrandWithoutImage from '@/assets/images/brands/brand-without-image.webp' +import { Brand } from '@/widgets/BrandBlock/types/types' + import styles from './BrandCard.module.scss' interface BrandCardProps { diff --git a/src/entities/CardReview/ui/CardReview/CardReview.stories.tsx b/src/entities/CardReview/ui/CardReview/CardReview.stories.tsx index 1289f31a..3d80613d 100644 --- a/src/entities/CardReview/ui/CardReview/CardReview.stories.tsx +++ b/src/entities/CardReview/ui/CardReview/CardReview.stories.tsx @@ -1,4 +1,5 @@ import type { Meta, StoryObj } from '@storybook/react' + import CardReview from './CardReview' const meta = { diff --git a/src/entities/CardReview/ui/CardReview/CardReview.tsx b/src/entities/CardReview/ui/CardReview/CardReview.tsx index 1181d05a..8cd29586 100644 --- a/src/entities/CardReview/ui/CardReview/CardReview.tsx +++ b/src/entities/CardReview/ui/CardReview/CardReview.tsx @@ -1,11 +1,13 @@ import { FC, useMemo } from 'react' + import IconStar from '@/assets/icons/IconStar' -import Paragraph from '@/shared/ui/Paragraph/Paragraph' import Heading, { HeadingType } from '@/shared/ui/Heading/Heading' import Link from '@/shared/ui/Link/Link' -import styles from './cardReview.module.scss' +import Paragraph from '@/shared/ui/Paragraph/Paragraph' import Subheading from '@/shared/ui/Subheading/Subheading' +import styles from './cardReview.module.scss' + export type Props = { pk: number text: string diff --git a/src/entities/Category/slice/categorySlice.ts b/src/entities/Category/slice/categorySlice.ts index cc77499a..fa71e0be 100644 --- a/src/entities/Category/slice/categorySlice.ts +++ b/src/entities/Category/slice/categorySlice.ts @@ -1,9 +1,11 @@ import { createSlice, createAsyncThunk } from '@reduxjs/toolkit' -import { ApiError, ApiErrorTypes, ApiRoutes } from '@/shared/api/types' + import { ThunkConfig } from '@/app/providers/StoreProvider/config/StateSchema' -import { Category, CategorySchema } from '../types/types' import { apiErrorIdentify } from '@/shared/api/apiErrorIdentify' import { rejectedPayloadHandle } from '@/shared/api/rejectedPayloadHandle' +import { ApiError, ApiErrorTypes, ApiRoutes } from '@/shared/api/types' + +import { Category, CategorySchema } from '../types/types' const initialState: CategorySchema = { categories: [], diff --git a/src/entities/ContactCard/ContactCard.tsx b/src/entities/ContactCard/ContactCard.tsx index f84f04bf..1f048598 100644 --- a/src/entities/ContactCard/ContactCard.tsx +++ b/src/entities/ContactCard/ContactCard.tsx @@ -1,9 +1,11 @@ import { FC } from 'react' + import { TMessenger } from '@/models/MessengerModel' -import styles from './contactCard.module.scss' import Link from '@/shared/ui/Link/Link' import Paragraph from '@/shared/ui/Paragraph/Paragraph' +import styles from './contactCard.module.scss' + export type PropsContactCard = { messenger: TMessenger Icon: string diff --git a/src/entities/NewsCard/NewsCard.stories.tsx b/src/entities/NewsCard/NewsCard.stories.tsx index c4344e62..11fd6025 100644 --- a/src/entities/NewsCard/NewsCard.stories.tsx +++ b/src/entities/NewsCard/NewsCard.stories.tsx @@ -1,4 +1,5 @@ import type { Meta, StoryObj } from '@storybook/react' + import NewsCard from './NewsCard' const meta = { diff --git a/src/entities/NewsCard/NewsCard.tsx b/src/entities/NewsCard/NewsCard.tsx index 7c403a95..bc5385cb 100644 --- a/src/entities/NewsCard/NewsCard.tsx +++ b/src/entities/NewsCard/NewsCard.tsx @@ -1,8 +1,10 @@ import { FC, useMemo } from 'react' -import styles from './NewsCard.module.scss' -import Link from '@/shared/ui/Link/Link' -import Heading, { HeadingType } from '@/shared/ui/Heading/Heading' + import NoImage from '@/assets/icons/image-not-found-icon.svg' +import Heading, { HeadingType } from '@/shared/ui/Heading/Heading' +import Link from '@/shared/ui/Link/Link' + +import styles from './NewsCard.module.scss' type Props = { id: number diff --git a/src/entities/Payments/Payments.tsx b/src/entities/Payments/Payments.tsx index a762662b..a966e37d 100644 --- a/src/entities/Payments/Payments.tsx +++ b/src/entities/Payments/Payments.tsx @@ -1,5 +1,7 @@ import { type FC } from 'react' + import Link from '@/shared/ui/Link/Link' + import styles from './payments.module.scss' type TPayments = { diff --git a/src/entities/ProductEntity/ui/ProductEntity/ProductEntity.stories.tsx b/src/entities/ProductEntity/ui/ProductEntity/ProductEntity.stories.tsx index 3ab5d024..fedf7210 100644 --- a/src/entities/ProductEntity/ui/ProductEntity/ProductEntity.stories.tsx +++ b/src/entities/ProductEntity/ui/ProductEntity/ProductEntity.stories.tsx @@ -1,7 +1,9 @@ import type { Meta, StoryObj } from '@storybook/react' -import { ProductEntity } from './ProductEntity' + import image1 from '@/assets/images/product/2-500x500.webp' +import { ProductEntity } from './ProductEntity' + const meta = { title: 'entities/ProductEntity', component: ProductEntity, diff --git a/src/entities/ProductEntity/ui/ProductEntity/ProductEntity.tsx b/src/entities/ProductEntity/ui/ProductEntity/ProductEntity.tsx index 488cca88..4532a1f0 100644 --- a/src/entities/ProductEntity/ui/ProductEntity/ProductEntity.tsx +++ b/src/entities/ProductEntity/ui/ProductEntity/ProductEntity.tsx @@ -1,8 +1,10 @@ -import { TProduct } from '@/mockData/productsData' -import styles from './ProductEntity.module.scss' import { type FC } from 'react' + +import { TProduct } from '@/mockData/productsData' import Subheading from '@/shared/ui/Subheading/Subheading' +import styles from './ProductEntity.module.scss' + /** * Компонент служит для отображения товаров, пришедших с сервера. * @param {string} src-картика с изображением продукта; diff --git a/src/entities/SearchItem/SearchItem.stories.tsx b/src/entities/SearchItem/SearchItem.stories.tsx index 35f22c83..d772ee97 100644 --- a/src/entities/SearchItem/SearchItem.stories.tsx +++ b/src/entities/SearchItem/SearchItem.stories.tsx @@ -1,9 +1,11 @@ import { Meta, Story } from '@storybook/react' + import { searchResponseData } from '@/mockData/searchData' -import SearchItem from './SearchItem' import { TProduct } from '@/shared/model/types/common' import { TLinkProps } from '@/shared/ui/Link/Link' +import SearchItem from './SearchItem' + export default { title: 'Entities/SearchItem', component: SearchItem, diff --git a/src/entities/SearchItem/SearchItem.tsx b/src/entities/SearchItem/SearchItem.tsx index ca657e43..8f719d25 100644 --- a/src/entities/SearchItem/SearchItem.tsx +++ b/src/entities/SearchItem/SearchItem.tsx @@ -1,7 +1,9 @@ import { type FC, useMemo, useState } from 'react' + import ArrowRightIcon from '@/assets/images/searchItem/arrow-right.svg' import { TProduct } from '@/shared/model/types/common' import Link, { TLinkProps } from '@/shared/ui/Link/Link' + import styles from './SearchItem.module.scss' /** diff --git a/src/entities/StoryCard/StoryCard.stories.tsx b/src/entities/StoryCard/StoryCard.stories.tsx index 3ca6aeec..7711456c 100644 --- a/src/entities/StoryCard/StoryCard.stories.tsx +++ b/src/entities/StoryCard/StoryCard.stories.tsx @@ -1,7 +1,9 @@ import type { Meta, StoryObj } from '@storybook/react' -import StoryCard from './StoryCard' + import Img1 from '@/assets/images/stories/img-stories-01.png' +import StoryCard from './StoryCard' + const meta = { title: 'entities/StoryCard', component: StoryCard, diff --git a/src/entities/StoryCard/StoryCard.tsx b/src/entities/StoryCard/StoryCard.tsx index 31e326da..2c811b34 100644 --- a/src/entities/StoryCard/StoryCard.tsx +++ b/src/entities/StoryCard/StoryCard.tsx @@ -1,8 +1,10 @@ import { FC } from 'react' + import { TCard } from '@/models/CardModel' -import styles from './StoryCard.module.scss' import Link from '@/shared/ui/Link/Link' +import styles from './StoryCard.module.scss' + export type Props = { card: TCard } diff --git a/src/features/CallBack/ui/CallBack/CallBack.tsx b/src/features/CallBack/ui/CallBack/CallBack.tsx index 053d0a5b..a795c34f 100644 --- a/src/features/CallBack/ui/CallBack/CallBack.tsx +++ b/src/features/CallBack/ui/CallBack/CallBack.tsx @@ -1,15 +1,17 @@ -import React, { useCallback } from 'react' import { ErrorMessage, Field, Form, Formik, FormikHelpers } from 'formik' +import React, { useCallback } from 'react' + import IconClose from '@/assets/icons/IconClose.svg' -import { Input } from '@/shared/ui/Input/Input' +import { CallBackData } from '@/features/CallBack/models/types/types' +import { validationSchema } from '@/features/CallBack/models/validation/validation' import { Button, ButtonSize, ButtonTheme } from '@/shared/ui/Button/Button' -import { Textarea } from '@/shared/ui/Textarea/Textarea' import Heading from '@/shared/ui/Heading/Heading' -import Paragraph, { ParagraphTheme } from '@/shared/ui/Paragraph/Paragraph' +import { Input } from '@/shared/ui/Input/Input' import Label from '@/shared/ui/Label/Label' +import Paragraph, { ParagraphTheme } from '@/shared/ui/Paragraph/Paragraph' import Span from '@/shared/ui/Span/Span' -import { validationSchema } from '@/features/CallBack/models/validation/validation' -import { CallBackData } from '@/features/CallBack/models/types/types' +import { Textarea } from '@/shared/ui/Textarea/Textarea' + import styles from './CallBack.module.scss' interface CallBackProps { diff --git a/src/features/CartCouponApply/ui/CartCouponApply/CartCouponApply.stories.tsx b/src/features/CartCouponApply/ui/CartCouponApply/CartCouponApply.stories.tsx index b9ba4466..f026deb5 100644 --- a/src/features/CartCouponApply/ui/CartCouponApply/CartCouponApply.stories.tsx +++ b/src/features/CartCouponApply/ui/CartCouponApply/CartCouponApply.stories.tsx @@ -1,4 +1,5 @@ import type { Meta, StoryObj } from '@storybook/react' + import { CartCouponApply } from './CartCouponApply' const meta = { diff --git a/src/features/CartCouponApply/ui/CartCouponApply/CartCouponApply.tsx b/src/features/CartCouponApply/ui/CartCouponApply/CartCouponApply.tsx index 548e65a4..7a430b40 100644 --- a/src/features/CartCouponApply/ui/CartCouponApply/CartCouponApply.tsx +++ b/src/features/CartCouponApply/ui/CartCouponApply/CartCouponApply.tsx @@ -1,8 +1,10 @@ import { useState } from 'react' -import styles from './CartCouponApply.module.scss' + +import { Button, ButtonSize, ButtonTheme } from '@/shared/ui/Button/Button' import Heading, { HeadingType } from '@/shared/ui/Heading/Heading' import { Input, InputSize, InputTheme } from '@/shared/ui/Input/Input' -import { Button, ButtonSize, ButtonTheme } from '@/shared/ui/Button/Button' + +import styles from './CartCouponApply.module.scss' const states = { CERTIFICATE: 'CERTIFICATE', diff --git a/src/features/CartEdit/ui/CartEdit/CartEdit.stories.tsx b/src/features/CartEdit/ui/CartEdit/CartEdit.stories.tsx index 22aa1f6c..379de7d5 100644 --- a/src/features/CartEdit/ui/CartEdit/CartEdit.stories.tsx +++ b/src/features/CartEdit/ui/CartEdit/CartEdit.stories.tsx @@ -1,8 +1,10 @@ import type { Meta, StoryObj } from '@storybook/react' -import { CartEdit, TCartEditProps } from './CartEdit' -import image1 from '@/assets/images/product/2-500x500.webp' import { FC } from 'react' +import image1 from '@/assets/images/product/2-500x500.webp' + +import { CartEdit, TCartEditProps } from './CartEdit' + const CartEditWrapper: FC = props => { return (
diff --git a/src/features/CartEdit/ui/CartEdit/CartEdit.tsx b/src/features/CartEdit/ui/CartEdit/CartEdit.tsx index a179302d..6c07e5d7 100644 --- a/src/features/CartEdit/ui/CartEdit/CartEdit.tsx +++ b/src/features/CartEdit/ui/CartEdit/CartEdit.tsx @@ -1,10 +1,12 @@ -import { TCartItemExt } from '@/mockData/cartData' -import styles from './CartEdit.module.scss' import { useEffect, useState } from 'react' -import ButtonDots from '@/shared/ui/ButtonDots/ButtonDots' + import { ProductEntity } from '@/entities/ProductEntity/ui/ProductEntity/ProductEntity' -import Subheading from '@/shared/ui/Subheading/Subheading' +import { TCartItemExt } from '@/mockData/cartData' +import ButtonDots from '@/shared/ui/ButtonDots/ButtonDots' import Paragraph from '@/shared/ui/Paragraph/Paragraph' +import Subheading from '@/shared/ui/Subheading/Subheading' + +import styles from './CartEdit.module.scss' export type TCartEditProps = { product: TCartItemExt diff --git a/src/features/Contacts/Contacts.tsx b/src/features/Contacts/Contacts.tsx index c0499344..df35d504 100644 --- a/src/features/Contacts/Contacts.tsx +++ b/src/features/Contacts/Contacts.tsx @@ -1,11 +1,13 @@ -import { type FC, useState } from 'react' import classNames from 'classnames' -import { TMessenger } from '@/models/MessengerModel' -import styles from './contacts.module.scss' -import { Button, ButtonTheme, ButtonDesign } from '@/shared/ui/Button/Button' +import { type FC, useState } from 'react' + import MessageIcon from '@/assets/icons/chat.svg' import CloseIcon from '@/assets/icons/IconMessageClose.svg' import ContactCard from '@/entities/ContactCard/ContactCard' +import { TMessenger } from '@/models/MessengerModel' +import { Button, ButtonTheme, ButtonDesign } from '@/shared/ui/Button/Button' + +import styles from './contacts.module.scss' export type PropsContacts = { messenger: TMessenger[] diff --git a/src/features/QuickPurchase/ui/QuickPurchaseForm/QuickPurchaseForm.tsx b/src/features/QuickPurchase/ui/QuickPurchaseForm/QuickPurchaseForm.tsx index dace388c..4a50c4b4 100644 --- a/src/features/QuickPurchase/ui/QuickPurchaseForm/QuickPurchaseForm.tsx +++ b/src/features/QuickPurchase/ui/QuickPurchaseForm/QuickPurchaseForm.tsx @@ -1,15 +1,17 @@ -import React, { useCallback } from 'react' import { Formik, Field, Form, ErrorMessage, FormikHelpers } from 'formik' +import React, { useCallback } from 'react' + import IconClose from '@/assets/icons/IconClose.svg' -import { Input } from '@/shared/ui/Input/Input' +import { IFormValues } from '@/features/QuickPurchase/model/types/types' +import { validationSchema } from '@/features/QuickPurchase/model/validation/validation' import { Button, ButtonSize, ButtonTheme } from '@/shared/ui/Button/Button' -import { Textarea } from '@/shared/ui/Textarea/Textarea' import Heading from '@/shared/ui/Heading/Heading' -import Paragraph, { ParagraphTheme } from '@/shared/ui/Paragraph/Paragraph' +import { Input } from '@/shared/ui/Input/Input' import Label from '@/shared/ui/Label/Label' +import Paragraph, { ParagraphTheme } from '@/shared/ui/Paragraph/Paragraph' import Span from '@/shared/ui/Span/Span' -import { validationSchema } from '@/features/QuickPurchase/model/validation/validation' -import { IFormValues } from '@/features/QuickPurchase/model/types/types' +import { Textarea } from '@/shared/ui/Textarea/Textarea' + import styles from './QuickPurchaseForm.module.scss' interface QuickPurchaseProps { diff --git a/src/features/SearchProduct/slice/searchProductSlice.ts b/src/features/SearchProduct/slice/searchProductSlice.ts index c8de78c1..ea5a5cc2 100644 --- a/src/features/SearchProduct/slice/searchProductSlice.ts +++ b/src/features/SearchProduct/slice/searchProductSlice.ts @@ -1,12 +1,14 @@ import { createSlice, createAsyncThunk } from '@reduxjs/toolkit' -import { ApiError, ApiErrorTypes, ApiRoutes } from '@/shared/api/types' + import { ThunkConfig } from '@/app/providers/StoreProvider/config/StateSchema' -import { SearchResultSchema } from '../types/types' +import { Category } from '@/entities/Category/types/types' import { apiErrorIdentify } from '@/shared/api/apiErrorIdentify' import { rejectedPayloadHandle } from '@/shared/api/rejectedPayloadHandle' -import { Category } from '@/entities/Category/types/types' +import { ApiError, ApiErrorTypes, ApiRoutes } from '@/shared/api/types' import { TProduct } from '@/shared/model/types/common' +import { SearchResultSchema } from '../types/types' + type SearchPayload = { category: Category[] product: { results: TProduct[] } diff --git a/src/features/SearchProduct/ui/SearchProduct.stories.tsx b/src/features/SearchProduct/ui/SearchProduct.stories.tsx index 3c6bee42..b97b32af 100644 --- a/src/features/SearchProduct/ui/SearchProduct.stories.tsx +++ b/src/features/SearchProduct/ui/SearchProduct.stories.tsx @@ -1,4 +1,5 @@ import { Meta, Story } from '@storybook/react' + import SearchProduct from './SearchProduct' export default { diff --git a/src/features/SearchProduct/ui/SearchProduct.tsx b/src/features/SearchProduct/ui/SearchProduct.tsx index bad5ff08..487dc392 100644 --- a/src/features/SearchProduct/ui/SearchProduct.tsx +++ b/src/features/SearchProduct/ui/SearchProduct.tsx @@ -1,12 +1,14 @@ import { useRef, useEffect, useState } from 'react' +import { useNavigate } from 'react-router-dom' + import { searchResponseData } from '@/mockData/searchData' +import { Routes } from '@/shared/config/routerConfig/routes' import { TResultData } from '@/shared/model/types/common' -import SearchResult from '@/widgets/SearchResult/SearchResult' -import { Input, InputSize, InputTheme } from '@/shared/ui/Input/Input' import { Button, ButtonDesign, ButtonSize, ButtonTheme } from '@/shared/ui/Button/Button' +import { Input, InputSize, InputTheme } from '@/shared/ui/Input/Input' +import SearchResult from '@/widgets/SearchResult/SearchResult' + import styles from './SearchProduct.module.scss' -import { Routes } from '@/shared/config/routerConfig/routes' -import { useNavigate } from 'react-router-dom' // @TODO: Перевести форму на Formik + Yup // https://github.com/Studio-Yandex-Practicum/maxboom_frontend/issues/92 diff --git a/src/features/SubscribeForm/SubscribeForm.tsx b/src/features/SubscribeForm/SubscribeForm.tsx index c581dd39..4282c9ca 100644 --- a/src/features/SubscribeForm/SubscribeForm.tsx +++ b/src/features/SubscribeForm/SubscribeForm.tsx @@ -1,8 +1,10 @@ +import classNames from 'classnames' import { type FC, FormEvent } from 'react' + import SubscribeIcon from '@/assets/images/subscriptionForm/icon-subsc.svg' -import styles from './subscribeForm.module.scss' import { Input, InputSize, InputTheme } from '@/shared/ui/Input/Input' -import classNames from 'classnames' + +import styles from './subscribeForm.module.scss' type TSubscribeForm = { type: 'footer' | 'subscribe' diff --git a/src/features/login/model/services/loginByUsername/loginByUsername.ts b/src/features/login/model/services/loginByUsername/loginByUsername.ts index 53e28d59..f5b74ac9 100644 --- a/src/features/login/model/services/loginByUsername/loginByUsername.ts +++ b/src/features/login/model/services/loginByUsername/loginByUsername.ts @@ -1,11 +1,13 @@ import { createAsyncThunk } from '@reduxjs/toolkit' + import { ThunkConfig } from '@/app/providers/StoreProvider/config/StateSchema' -import { ApiError, ApiErrorTypes, ApiRoutes } from '@/shared/api/types' -import { LoginAuthData, LoginTokenData } from '../../../model/types/types' import { apiErrorIdentify } from '@/shared/api/apiErrorIdentify' +import { ApiError, ApiErrorTypes, ApiRoutes } from '@/shared/api/types' import { LOCAL_STORAGE_TOKEN_KEY } from '@/shared/constants/localStorage' import { $localStorageHandler } from '@/shared/libs/helpers/localStorageHandler' +import { LoginAuthData, LoginTokenData } from '../../../model/types/types' + export const loginByUsername = createAsyncThunk>( 'login/loginByUsername', async (authData, thunkAPI) => { diff --git a/src/features/login/model/services/logout/logout.ts b/src/features/login/model/services/logout/logout.ts index 7cc2dd80..3585c5d7 100644 --- a/src/features/login/model/services/logout/logout.ts +++ b/src/features/login/model/services/logout/logout.ts @@ -1,7 +1,8 @@ import { createAsyncThunk } from '@reduxjs/toolkit' + import { ThunkConfig } from '@/app/providers/StoreProvider/config/StateSchema' -import { ApiError, ApiErrorTypes, ApiRoutes } from '@/shared/api/types' import { apiErrorIdentify } from '@/shared/api/apiErrorIdentify' +import { ApiError, ApiErrorTypes, ApiRoutes } from '@/shared/api/types' import { LOCAL_STORAGE_TOKEN_KEY } from '@/shared/constants/localStorage' import { $localStorageHandler } from '@/shared/libs/helpers/localStorageHandler' diff --git a/src/features/login/model/slice/loginSlice.ts b/src/features/login/model/slice/loginSlice.ts index 8e5a43fb..4ea86115 100644 --- a/src/features/login/model/slice/loginSlice.ts +++ b/src/features/login/model/slice/loginSlice.ts @@ -1,8 +1,10 @@ import { createSlice } from '@reduxjs/toolkit' -import { loginByUsername } from '../services/loginByUsername/loginByUsername' + import { rejectedPayloadHandle } from '@/shared/api/rejectedPayloadHandle' -import { LoginSchema } from '../types/types' + +import { loginByUsername } from '../services/loginByUsername/loginByUsername' import { logout } from '../services/logout/logout' +import { LoginSchema } from '../types/types' const initialState: LoginSchema = { isLoading: false, diff --git a/src/features/login/ui/LoginForm/LoginForm.tsx b/src/features/login/ui/LoginForm/LoginForm.tsx index 069307e2..d2d89f45 100644 --- a/src/features/login/ui/LoginForm/LoginForm.tsx +++ b/src/features/login/ui/LoginForm/LoginForm.tsx @@ -1,17 +1,20 @@ -import { useSelector } from 'react-redux' import { ErrorMessage, Field, Form, Formik, FormikHelpers } from 'formik' -import { Input } from '@/shared/ui/Input/Input' +import { useSelector } from 'react-redux' + +import { getErrorAuthStatus } from '@/features/login/model/selectors/getUserAuthStatus' +import { useAppDispatch } from '@/shared/libs/hooks/store' import { Button, ButtonSize, ButtonTheme } from '@/shared/ui/Button/Button' import Heading from '@/shared/ui/Heading/Heading' -import { validationSchema } from '../../model/validation/validation' -import { LoginAuthData } from '../../model/types/types' +import { Input } from '@/shared/ui/Input/Input' import Link from '@/shared/ui/Link/Link' -import styles from './LoginForm.module.scss' -import { useAppDispatch } from '@/shared/libs/hooks/store' -import { loginByUsername } from '../../model/services/loginByUsername/loginByUsername' -import { getErrorAuthStatus } from '@/features/login/model/selectors/getUserAuthStatus' import Paragraph, { ParagraphTheme } from '@/shared/ui/Paragraph/Paragraph' +import { loginByUsername } from '../../model/services/loginByUsername/loginByUsername' +import { LoginAuthData } from '../../model/types/types' +import { validationSchema } from '../../model/validation/validation' + +import styles from './LoginForm.module.scss' + export interface LoginFormProps { onLogin?: VoidFunction } diff --git a/src/index.tsx b/src/index.tsx index 13b3bd19..9e2e4daa 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,9 +1,11 @@ import React from 'react' import ReactDOM from 'react-dom/client' + import './app/styles/index.scss' -import App from './app/App' import { StoreProvider } from '@/app/providers/StoreProvider' +import App from './app/App' + const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement) root.render( diff --git a/src/mockData/advantagesData.ts b/src/mockData/advantagesData.ts index c281328d..87c7f973 100644 --- a/src/mockData/advantagesData.ts +++ b/src/mockData/advantagesData.ts @@ -1,6 +1,6 @@ import img1 from '@/assets/images/advantages/img1.png' import img2 from '@/assets/images/advantages/img2.png' -import img3 from '@/assets//images/advantages/img3.png' +import img3 from '@/assets/images/advantages/img3.png' import img4 from '@/assets/images/advantages/img4.png' import img5 from '@/assets/images/advantages/img5.png' import img6 from '@/assets/images/advantages/img6.png' diff --git a/src/mockData/blogPageData.ts b/src/mockData/blogPageData.ts index 0c6e1d2b..79ebc776 100644 --- a/src/mockData/blogPageData.ts +++ b/src/mockData/blogPageData.ts @@ -1,3 +1,4 @@ +import Img10 from '@/assets/images/blogPage/image10.webp' import Img1 from '@/assets/images/blogPage/img-blog-02.png' import Img2 from '@/assets/images/blogPage/img-blog-03.png' import Img3 from '@/assets/images/blogPage/img-blog-04.png' @@ -7,7 +8,6 @@ import Img6 from '@/assets/images/blogPage/img-blog-07.webp' import Img7 from '@/assets/images/blogPage/img-blog-08.webp' import Img8 from '@/assets/images/blogPage/img-blog-09.webp' import Img9 from '@/assets/images/blogPage/img-blog-10.webp' -import Img10 from '@/assets/images/blogPage/image10.webp' export const blogPageData = [ { diff --git a/src/mockData/brandData.ts b/src/mockData/brandData.ts index 7734876b..95c81777 100644 --- a/src/mockData/brandData.ts +++ b/src/mockData/brandData.ts @@ -1,8 +1,8 @@ import Brand1 from '@/assets/images/brands/1-150x150.webp' import Brand2 from '@/assets/images/brands/10-150x150.webp' +import Brand5 from '@/assets/images/brands/3-150x150.webp' import Brand3 from '@/assets/images/brands/4-150x150.webp' import Brand4 from '@/assets/images/brands/6-150x150.webp' -import Brand5 from '@/assets/images/brands/3-150x150.webp' import Brand6 from '@/assets/images/brands/9-150x150.webp' export const brandsData = [ diff --git a/src/mockData/searchData.ts b/src/mockData/searchData.ts index f249d48e..8307f91f 100644 --- a/src/mockData/searchData.ts +++ b/src/mockData/searchData.ts @@ -1,5 +1,5 @@ -import { TResultData } from '@/shared/model/types/common' import img1 from '@/assets/images/searchItem/cream.jpeg' +import { TResultData } from '@/shared/model/types/common' export const searchResponseData: TResultData = { data: [ diff --git a/src/mockData/storiesData.ts b/src/mockData/storiesData.ts index 65be96a1..32e5c8f5 100644 --- a/src/mockData/storiesData.ts +++ b/src/mockData/storiesData.ts @@ -1,6 +1,6 @@ +import Img1 from '@/assets/images/stories/img-stories-01.png' import Img2 from '@/assets/images/stories/img-stories-02.png' import Img3 from '@/assets/images/stories/img-stories-03.png' -import Img1 from '@/assets/images/stories/img-stories-01.png' import Img4 from '@/assets/images/stories/img-stories-04.png' import Img5 from '@/assets/images/stories/img-stories-05.png' import Img6 from '@/assets/images/stories/img-stories-06.png' diff --git a/src/pages/BlogPage/BlogPage.tsx b/src/pages/BlogPage/BlogPage.tsx index 7ab211b9..719678db 100644 --- a/src/pages/BlogPage/BlogPage.tsx +++ b/src/pages/BlogPage/BlogPage.tsx @@ -1,6 +1,6 @@ import BlogMain from '@/components/BlogMain/BlogMain' -import { blogPageData } from '@/mockData/blogPageData' import WrapperForMainContent from '@/components/WrapperForMainContent/WrapperForMainContent' +import { blogPageData } from '@/mockData/blogPageData' import { TEXT_BLOG, LINK_SHOW_ALL } from '@/shared/constants/constants' const BlogPage = () => { diff --git a/src/pages/CartPage/CartPage.tsx b/src/pages/CartPage/CartPage.tsx index 9f052b1b..8d7b82b2 100644 --- a/src/pages/CartPage/CartPage.tsx +++ b/src/pages/CartPage/CartPage.tsx @@ -1,16 +1,18 @@ +import { useEffect, useState } from 'react' +import { Link } from 'react-router-dom' + +import WrapperForMainContent from '@/components/WrapperForMainContent/WrapperForMainContent' import { CartCouponApply } from '@/features/CartCouponApply/ui/CartCouponApply/CartCouponApply' import { CartEdit } from '@/features/CartEdit/ui/CartEdit/CartEdit' -import { MakeOrder } from '@/widgets/MakeOrder/ui/MakeOrder/MakeOrder' -import styles from './CartPage.module.scss' -import WrapperForMainContent from '@/components/WrapperForMainContent/WrapperForMainContent' -import Heading, { HeadingType } from '@/shared/ui/Heading/Heading' -import Subheading from '@/shared/ui/Subheading/Subheading' -import { useEffect, useState } from 'react' import { TCart, TCartItem, TCartItemExt, cartData } from '@/mockData/cartData' import { getProduct } from '@/shared/api/maxboom/product' -import { Link } from 'react-router-dom' -import { TOrder } from '@/shared/model/types/common' import { MAX_PRODUCTS_NUMBER } from '@/shared/constants/constants' +import { TOrder } from '@/shared/model/types/common' +import Heading, { HeadingType } from '@/shared/ui/Heading/Heading' +import Subheading from '@/shared/ui/Subheading/Subheading' +import { MakeOrder } from '@/widgets/MakeOrder/ui/MakeOrder/MakeOrder' + +import styles from './CartPage.module.scss' /** * Компонент страница корзины. На странице отображаются товары в корзине, можно изменять кол-во товаров в корзине, diff --git a/src/pages/ComparePage/ComparePage.tsx b/src/pages/ComparePage/ComparePage.tsx index 29c5e32e..5a6cbf87 100644 --- a/src/pages/ComparePage/ComparePage.tsx +++ b/src/pages/ComparePage/ComparePage.tsx @@ -1,6 +1,7 @@ import WrapperForMainContent from '@/components/WrapperForMainContent/WrapperForMainContent' import Heading from '@/shared/ui/Heading/Heading' import Subheading from '@/shared/ui/Subheading/Subheading' + import styles from './ComparePage.module.scss' /** diff --git a/src/pages/FavoritesPage/FavoritesPage.tsx b/src/pages/FavoritesPage/FavoritesPage.tsx index 87a8f9b1..2e426205 100644 --- a/src/pages/FavoritesPage/FavoritesPage.tsx +++ b/src/pages/FavoritesPage/FavoritesPage.tsx @@ -1,6 +1,7 @@ import WrapperForMainContent from '@/components/WrapperForMainContent/WrapperForMainContent' import Heading from '@/shared/ui/Heading/Heading' import Subheading from '@/shared/ui/Subheading/Subheading' + import styles from './FavoritesPage.module.scss' /** diff --git a/src/pages/LoginPage/LoginPage.tsx b/src/pages/LoginPage/LoginPage.tsx index e4df6faf..db9c1981 100644 --- a/src/pages/LoginPage/LoginPage.tsx +++ b/src/pages/LoginPage/LoginPage.tsx @@ -1,10 +1,12 @@ import { Suspense, lazy, useCallback } from 'react' import { useNavigate } from 'react-router' + import WrapperForMainContent from '@/components/WrapperForMainContent/WrapperForMainContent' +import { Routes } from '@/shared/config/routerConfig/routes' import Heading from '@/shared/ui/Heading/Heading' -import styles from './LoginPage.module.scss' import Spinner from '@/shared/ui/Spinner/Spinner' -import { Routes } from '@/shared/config/routerConfig/routes' + +import styles from './LoginPage.module.scss' const LazyLoginForm = lazy(() => import('@/features/login/index')) diff --git a/src/pages/MainPage/MainPage.tsx b/src/pages/MainPage/MainPage.tsx index e421ebda..c1cda542 100644 --- a/src/pages/MainPage/MainPage.tsx +++ b/src/pages/MainPage/MainPage.tsx @@ -1,16 +1,16 @@ -import WrapperForMainContent from '@/components/WrapperForMainContent/WrapperForMainContent' +import ArticleBlock from '@/components/ArticleBlock/ArticleBlock' +// import ContainerCards from '@/components/ContainerCards/ContainerCards' import SliderBlock from '@/components/SliderBlock/SliderBlock' +import WrapperForMainContent from '@/components/WrapperForMainContent/WrapperForMainContent' +// import { storiesData } from '@/mockData/storiesData' +import { TEXT_CUSTOMERS_ABOUT_US, LINK_REVIEWS_ALL } from '@/shared/constants/constants' +import Advantages from '@/widgets/Advantages/ui/Advantages/Advantages' +import BlogBlock from '@/widgets/BlogBlock/ui/BlogBlock' import BrandsBlock from '@/widgets/BrandBlock/ui/BrandBlock/BrandBlock' -import { storiesData } from '@/mockData/storiesData' -import { TEXT_STORIES, TEXT_CUSTOMERS_ABOUT_US, LINK_REVIEWS_ALL } from '@/shared/constants/constants' -import ArticleBlock from '@/components/ArticleBlock/ArticleBlock' import CategoryGrid from '@/widgets/CategoryGrid/CategoryGrid' -import ReviewsBlock from '@/widgets/ReviewsBlock/ui/ReviewsBlock/ReviewsBlock' -import Advantages from '@/widgets/Advantages/ui/Advantages/Advantages' import NewsBlock from '@/widgets/NewsBlock/ui/NewsBlock' -import ContainerCards from '@/components/ContainerCards/ContainerCards' +import ReviewsBlock from '@/widgets/ReviewsBlock/ui/ReviewsBlock/ReviewsBlock' import StoriesBlock from '@/widgets/StoriesBlock/ui/StoriesBlock' -import BlogBlock from '@/widgets/BlogBlock/ui/BlogBlock' const MainPage = () => { return ( diff --git a/src/pages/ProductsPage/ProductsPage.tsx b/src/pages/ProductsPage/ProductsPage.tsx index 83cfa7dc..d923b96f 100644 --- a/src/pages/ProductsPage/ProductsPage.tsx +++ b/src/pages/ProductsPage/ProductsPage.tsx @@ -1,14 +1,16 @@ import { useState } from 'react' -import Modal from '@/shared/ui/Modal/Modal' -import WrapperForMainContent from '@/components/WrapperForMainContent/WrapperForMainContent' + +import { CardPreview } from '@/components/CardPreview/CardPreview' import { CategoryList } from '@/components/CategoryList/CategoryList' -import { PageDescription } from '@/components/PageDescription/PageDescription' import { PageControls } from '@/components/PageControls/PageControls' +import { PageDescription } from '@/components/PageDescription/PageDescription' import { Pagination } from '@/components/Pagination/Pagination' import { ProductCard } from '@/components/ProductCard/ProductCard' +import WrapperForMainContent from '@/components/WrapperForMainContent/WrapperForMainContent' import { ITEMS_PER_PAGE_OPTION, SORT_OPTION, TOTAL_PAGES } from '@/mockData/productsPageOptions' import { ECardView } from '@/shared/model/types/common' -import { CardPreview } from '@/components/CardPreview/CardPreview' +import Modal from '@/shared/ui/Modal/Modal' + import styles from './ProductsPage.module.scss' /** diff --git a/src/pages/RootPage/RootPage.tsx b/src/pages/RootPage/RootPage.tsx index 7f16f267..2a8a9679 100644 --- a/src/pages/RootPage/RootPage.tsx +++ b/src/pages/RootPage/RootPage.tsx @@ -1,9 +1,12 @@ import { Outlet } from 'react-router' + import Header from '@/components/header/header' +import { messengerArray } from '@/shared/model/types/messengerArray' import Footer from '@/widgets/Footer/Footer' -import styles from './root.module.scss' + import Contact from '../../features/Contacts/Contacts' -import { messengerArray } from '@/shared/model/types/messengerArray' + +import styles from './root.module.scss' const RootPage = () => { return ( diff --git a/src/pages/SearchResultsPage/SearchResultsPage.tsx b/src/pages/SearchResultsPage/SearchResultsPage.tsx index c848a4e9..a1ec43cb 100644 --- a/src/pages/SearchResultsPage/SearchResultsPage.tsx +++ b/src/pages/SearchResultsPage/SearchResultsPage.tsx @@ -1,15 +1,17 @@ +import { AnyAction, ThunkDispatch } from '@reduxjs/toolkit' import { useEffect } from 'react' import { useSelector, useDispatch } from 'react-redux' import { useParams } from 'react-router-dom' + +import { ThunkExtraArg } from '@/app/providers/StoreProvider/config/StateSchema' +import { RootState } from '@/app/providers/StoreProvider/config/store' import WrapperForMainContent from '@/components/WrapperForMainContent/WrapperForMainContent' +import { selectSearchResult } from '@/features/SearchProduct/selectors/searchProductSelectors' +import { search } from '@/features/SearchProduct/slice/searchProductSlice' import Heading from '@/shared/ui/Heading/Heading' import Subheading from '@/shared/ui/Subheading/Subheading' + import styles from './SearchResultsPage.module.scss' -import { search } from '@/features/SearchProduct/slice/searchProductSlice' -import { selectSearchResult } from '@/features/SearchProduct/selectors/searchProductSelectors' -import { AnyAction, ThunkDispatch } from '@reduxjs/toolkit' -import { RootState } from '@/app/providers/StoreProvider/config/store' -import { ThunkExtraArg } from '@/app/providers/StoreProvider/config/StateSchema' /** * Страница с результатами поискового запроса diff --git a/src/shared/api/apiErrorIdentify.ts b/src/shared/api/apiErrorIdentify.ts index b5e15eff..dfd3c5a9 100644 --- a/src/shared/api/apiErrorIdentify.ts +++ b/src/shared/api/apiErrorIdentify.ts @@ -1,4 +1,5 @@ import axios from 'axios' + import { ApiErrorTypes, SERVER_ERROR_FIELD } from './types' export const apiErrorIdentify = (e: unknown, message?: ApiErrorTypes) => diff --git a/src/shared/libs/hooks/store.ts b/src/shared/libs/hooks/store.ts index a1d79179..59546958 100644 --- a/src/shared/libs/hooks/store.ts +++ b/src/shared/libs/hooks/store.ts @@ -1,4 +1,5 @@ import { useDispatch } from 'react-redux' + import type { AppDispatch } from '@/app/providers/StoreProvider/config/store' // export type AppStoreState = ReturnType diff --git a/src/shared/model/types/messengerArray.tsx b/src/shared/model/types/messengerArray.tsx index afeaabbd..77cc23ec 100644 --- a/src/shared/model/types/messengerArray.tsx +++ b/src/shared/model/types/messengerArray.tsx @@ -1,7 +1,7 @@ -import WhatsAppIcon from '@/assets/icons/whatsapp.svg' -import ViberIcon from '@/assets/icons/viber.svg' -import TelegramIcon from '@/assets/icons/telegram.svg' import EmailIcon from '@/assets/icons/email.svg' +import TelegramIcon from '@/assets/icons/telegram.svg' +import ViberIcon from '@/assets/icons/viber.svg' +import WhatsAppIcon from '@/assets/icons/whatsapp.svg' import { WHATSAPP_LINK, VIBER_LINK, TELEGRAM_LINK, EMAIL_LINK } from '../../constants/constants' diff --git a/src/shared/ui/Button/Button.stories.tsx b/src/shared/ui/Button/Button.stories.tsx index 2d4a2111..17718e3f 100644 --- a/src/shared/ui/Button/Button.stories.tsx +++ b/src/shared/ui/Button/Button.stories.tsx @@ -1,5 +1,7 @@ import type { Meta, StoryObj } from '@storybook/react' + import ChatIcon from '@/assets/icons/chat.svg' + import { Button, ButtonDesign, ButtonSize, ButtonTheme } from './Button' const meta = { diff --git a/src/shared/ui/Button/Button.tsx b/src/shared/ui/Button/Button.tsx index f8124639..3746fc5c 100644 --- a/src/shared/ui/Button/Button.tsx +++ b/src/shared/ui/Button/Button.tsx @@ -1,5 +1,6 @@ -import { ButtonHTMLAttributes, FC } from 'react' import classNames from 'classnames' +import { ButtonHTMLAttributes, FC } from 'react' + import style from './Button.module.scss' export enum ButtonTheme { @@ -37,12 +38,24 @@ interface ButtonProps extends ButtonHTMLAttributes { */ export const Button: FC = props => { - const { className, children, disabled, theme, design = ButtonDesign.SQUARE, size = ButtonSize.M, ...rest } = props + const { + className, + children, + disabled, + theme, + design = ButtonDesign.SQUARE, + size = ButtonSize.M, + ...rest + } = props const additionalClasses = [className, theme && style[theme], style[size], style[design]] return ( - ) diff --git a/src/shared/ui/ButtonDots/ButtonDots.stories.tsx b/src/shared/ui/ButtonDots/ButtonDots.stories.tsx index 6882b98b..9f437d7b 100644 --- a/src/shared/ui/ButtonDots/ButtonDots.stories.tsx +++ b/src/shared/ui/ButtonDots/ButtonDots.stories.tsx @@ -1,4 +1,5 @@ import type { Meta, StoryObj } from '@storybook/react' + import ButtonDots from './ButtonDots' const meta = { diff --git a/src/shared/ui/ButtonDots/ButtonDots.tsx b/src/shared/ui/ButtonDots/ButtonDots.tsx index 4b28594f..b211fb2f 100644 --- a/src/shared/ui/ButtonDots/ButtonDots.tsx +++ b/src/shared/ui/ButtonDots/ButtonDots.tsx @@ -1,4 +1,5 @@ import React, { useEffect, useRef, useState } from 'react' + import styles from './ButtonDots.module.scss' type TProps = { diff --git a/src/shared/ui/Carousel/Carousel.stories.tsx b/src/shared/ui/Carousel/Carousel.stories.tsx index 613e67a0..8bbb8945 100644 --- a/src/shared/ui/Carousel/Carousel.stories.tsx +++ b/src/shared/ui/Carousel/Carousel.stories.tsx @@ -1,7 +1,9 @@ import { Story, Meta } from '@storybook/react' -import Carousel, { CarouselProps } from './Carousel' -import { ECardView } from '@/shared/model/types/common' + import { PRODUCT_PHOTOS } from '@/mockData/productsPageOptions' +import { ECardView } from '@/shared/model/types/common' + +import Carousel, { CarouselProps } from './Carousel' export default { title: 'shared/Carousel', diff --git a/src/shared/ui/Carousel/Carousel.tsx b/src/shared/ui/Carousel/Carousel.tsx index ea128e97..8d3de3cc 100644 --- a/src/shared/ui/Carousel/Carousel.tsx +++ b/src/shared/ui/Carousel/Carousel.tsx @@ -1,7 +1,9 @@ -import React, { useState, useRef, useEffect } from 'react' import classNames from 'classnames' +import React, { useState, useRef, useEffect } from 'react' + import { getStylesForCurrentLayout } from '@/components/ProductCard/utils/utils' import { ECardView } from '@/shared/model/types/common' + import styles from './Carousel.module.scss' export interface CarouselProps { diff --git a/src/shared/ui/CategoryCard/ui/CategoryCard.tsx b/src/shared/ui/CategoryCard/ui/CategoryCard.tsx index 209a56ab..a80a877b 100644 --- a/src/shared/ui/CategoryCard/ui/CategoryCard.tsx +++ b/src/shared/ui/CategoryCard/ui/CategoryCard.tsx @@ -1,9 +1,12 @@ import { type FC } from 'react' -import { Routes } from '@/shared/config/routerConfig/routes' + import { TCategory } from '@/models/CategoryModel' +import { Routes } from '@/shared/config/routerConfig/routes' import Link from '@/shared/ui/Link/Link' + import Subheading from '../../Subheading/Subheading' import { COLORS } from '../constants/constants' + import styles from './CategoryCard.module.scss' interface CategoryCardProps { diff --git a/src/shared/ui/Heading/Heading.tsx b/src/shared/ui/Heading/Heading.tsx index e141c4c9..c140039a 100644 --- a/src/shared/ui/Heading/Heading.tsx +++ b/src/shared/ui/Heading/Heading.tsx @@ -1,6 +1,7 @@ +import classnames from 'classnames' import React, { FC } from 'react' + import styles from './heading.module.scss' -import classnames from 'classnames' export enum HeadingType { MAIN = 'main', diff --git a/src/shared/ui/Input/Input.tsx b/src/shared/ui/Input/Input.tsx index 9fb7060e..d95b61cc 100644 --- a/src/shared/ui/Input/Input.tsx +++ b/src/shared/ui/Input/Input.tsx @@ -1,6 +1,7 @@ +import classNames from 'classnames' import React, { InputHTMLAttributes } from 'react' import InputMask from 'react-input-mask' -import classNames from 'classnames' + import styles from './Input.module.scss' export enum InputTheme { diff --git a/src/shared/ui/Label/Label.stories.tsx b/src/shared/ui/Label/Label.stories.tsx index 6386e4e3..d520092c 100644 --- a/src/shared/ui/Label/Label.stories.tsx +++ b/src/shared/ui/Label/Label.stories.tsx @@ -1,4 +1,5 @@ import type { Meta, StoryObj } from '@storybook/react' + import Label from './Label' const meta = { diff --git a/src/shared/ui/Label/Label.tsx b/src/shared/ui/Label/Label.tsx index a473641d..971f765f 100644 --- a/src/shared/ui/Label/Label.tsx +++ b/src/shared/ui/Label/Label.tsx @@ -1,4 +1,5 @@ import React, { FC } from 'react' + import styles from './Label.module.scss' type TLabelProps = React.HTMLAttributes & { diff --git a/src/shared/ui/Link/Link.stories.tsx b/src/shared/ui/Link/Link.stories.tsx index a89f57c4..7a36a724 100644 --- a/src/shared/ui/Link/Link.stories.tsx +++ b/src/shared/ui/Link/Link.stories.tsx @@ -1,5 +1,7 @@ import { Meta, Story } from '@storybook/react' + import Svg from '@/assets/icons/IconEye.svg' + import Link from './Link' const meta: Meta = { diff --git a/src/shared/ui/Link/Link.tsx b/src/shared/ui/Link/Link.tsx index 3ae8cf75..01a2099b 100644 --- a/src/shared/ui/Link/Link.tsx +++ b/src/shared/ui/Link/Link.tsx @@ -1,6 +1,7 @@ +import classNames from 'classnames' import { FC } from 'react' import { Link as ReactLink, LinkProps } from 'react-router-dom' -import classNames from 'classnames' + import styles from './Link.module.scss' export type TLinkProps = { diff --git a/src/shared/ui/Modal/Modal.tsx b/src/shared/ui/Modal/Modal.tsx index 25d57739..4db92f9f 100644 --- a/src/shared/ui/Modal/Modal.tsx +++ b/src/shared/ui/Modal/Modal.tsx @@ -1,7 +1,8 @@ -import React, { HTMLAttributes, useCallback, useEffect, useRef } from 'react' import classNames from 'classnames' import { createFocusTrap } from 'focus-trap' +import React, { HTMLAttributes, useCallback, useEffect, useRef } from 'react' import { createPortal } from 'react-dom' + import styles from './Modal.module.scss' interface IModalProps extends HTMLAttributes { diff --git a/src/shared/ui/Paragraph/Paragraph.stories.tsx b/src/shared/ui/Paragraph/Paragraph.stories.tsx index a9472858..b31ef7bc 100644 --- a/src/shared/ui/Paragraph/Paragraph.stories.tsx +++ b/src/shared/ui/Paragraph/Paragraph.stories.tsx @@ -1,4 +1,5 @@ import type { Meta, StoryObj } from '@storybook/react' + import Paragraph, { ParagraphTheme } from './Paragraph' const meta = { diff --git a/src/shared/ui/Paragraph/Paragraph.tsx b/src/shared/ui/Paragraph/Paragraph.tsx index 88361fdd..f36a38b9 100644 --- a/src/shared/ui/Paragraph/Paragraph.tsx +++ b/src/shared/ui/Paragraph/Paragraph.tsx @@ -1,6 +1,7 @@ +import classNames from 'classnames' import React, { FC } from 'react' + import styles from './paragraph.module.scss' -import classNames from 'classnames' export enum ParagraphTheme { ERROR = 'error' diff --git a/src/shared/ui/Scroll/Scroll.stories.tsx b/src/shared/ui/Scroll/Scroll.stories.tsx index 0c28653e..79df9d49 100644 --- a/src/shared/ui/Scroll/Scroll.stories.tsx +++ b/src/shared/ui/Scroll/Scroll.stories.tsx @@ -1,5 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react' import { FC } from 'react' + import Scroll from './Scroll' import styles from './Scroll.module.scss' diff --git a/src/shared/ui/Scroll/Scroll.tsx b/src/shared/ui/Scroll/Scroll.tsx index eb0114a6..678289ce 100644 --- a/src/shared/ui/Scroll/Scroll.tsx +++ b/src/shared/ui/Scroll/Scroll.tsx @@ -1,4 +1,5 @@ import React, { FC } from 'react' + import styles from './Scroll.module.scss' export type TProps = { diff --git a/src/shared/ui/Span/Span.stories.tsx b/src/shared/ui/Span/Span.stories.tsx index 25a74a06..b80dbb39 100644 --- a/src/shared/ui/Span/Span.stories.tsx +++ b/src/shared/ui/Span/Span.stories.tsx @@ -1,4 +1,5 @@ import type { Meta, StoryObj } from '@storybook/react' + import Span from './Span' const meta = { diff --git a/src/shared/ui/Span/Span.tsx b/src/shared/ui/Span/Span.tsx index ec9fc49c..bca4c28d 100644 --- a/src/shared/ui/Span/Span.tsx +++ b/src/shared/ui/Span/Span.tsx @@ -1,4 +1,5 @@ import React, { FC } from 'react' + import styles from './Span.module.scss' type TSpanProps = React.HTMLAttributes & { diff --git a/src/shared/ui/Spinner/Spinner.stories.tsx b/src/shared/ui/Spinner/Spinner.stories.tsx index 805e6f06..4ed6de5f 100644 --- a/src/shared/ui/Spinner/Spinner.stories.tsx +++ b/src/shared/ui/Spinner/Spinner.stories.tsx @@ -1,4 +1,5 @@ import { Story, Meta } from '@storybook/react' + import Spinner from './Spinner' export default { diff --git a/src/shared/ui/Subheading/Subheading.tsx b/src/shared/ui/Subheading/Subheading.tsx index f55bdc7a..e7b3ea52 100644 --- a/src/shared/ui/Subheading/Subheading.tsx +++ b/src/shared/ui/Subheading/Subheading.tsx @@ -1,4 +1,5 @@ import React, { FC } from 'react' + import styles from './subheading.module.scss' type TSubheadingProps = React.HTMLAttributes & { diff --git a/src/shared/ui/Textarea/Textarea.stories.tsx b/src/shared/ui/Textarea/Textarea.stories.tsx index 59f5cfe0..d1acd243 100644 --- a/src/shared/ui/Textarea/Textarea.stories.tsx +++ b/src/shared/ui/Textarea/Textarea.stories.tsx @@ -1,4 +1,5 @@ import { Meta, Story } from '@storybook/react' + import { Textarea, TextareaTheme, TextareaSize } from './Textarea' const meta: Meta = { diff --git a/src/shared/ui/Textarea/Textarea.tsx b/src/shared/ui/Textarea/Textarea.tsx index 26bd6240..e25ebdf9 100644 --- a/src/shared/ui/Textarea/Textarea.tsx +++ b/src/shared/ui/Textarea/Textarea.tsx @@ -1,5 +1,6 @@ -import React, { TextareaHTMLAttributes } from 'react' import classNames from 'classnames' +import React, { TextareaHTMLAttributes } from 'react' + import styles from './Textarea.module.scss' export enum TextareaTheme { diff --git a/src/shared/ui/logo/Logo.tsx b/src/shared/ui/logo/Logo.tsx index f7e9eea7..26f1f99a 100644 --- a/src/shared/ui/logo/Logo.tsx +++ b/src/shared/ui/logo/Logo.tsx @@ -1,7 +1,9 @@ import { type FC } from 'react' -import styles from './logo.module.scss' + import Link from '@/shared/ui/Link/Link' +import styles from './logo.module.scss' + type TLogoProps = { image: string title: string diff --git a/src/ui/img/index.tsx b/src/ui/img/index.tsx index 8654c2cc..335c7bc1 100644 --- a/src/ui/img/index.tsx +++ b/src/ui/img/index.tsx @@ -1,4 +1,5 @@ import { FC, ImgHTMLAttributes, SourceHTMLAttributes } from 'react' + import styles from './img.module.scss' type Props = SourceHTMLAttributes & ImgHTMLAttributes diff --git a/src/widgets/Advantages/ui/Advantages/Advantages.tsx b/src/widgets/Advantages/ui/Advantages/Advantages.tsx index 72ac8087..c0a1af84 100644 --- a/src/widgets/Advantages/ui/Advantages/Advantages.tsx +++ b/src/widgets/Advantages/ui/Advantages/Advantages.tsx @@ -1,8 +1,8 @@ import AdvantageCard from '@/entities/AdvantageCard/ui/AdvantageCard/AdvantageCard' -import styles from './advantages.module.scss' - import { advantagesData } from '@/mockData/advantagesData' +import styles from './advantages.module.scss' + function Advantages() { return (
diff --git a/src/widgets/BlogBlock/model/services/getBlogPosts.ts b/src/widgets/BlogBlock/model/services/getBlogPosts.ts index cb844975..b1fb7e5a 100644 --- a/src/widgets/BlogBlock/model/services/getBlogPosts.ts +++ b/src/widgets/BlogBlock/model/services/getBlogPosts.ts @@ -1,10 +1,12 @@ import { createAsyncThunk } from '@reduxjs/toolkit' + import { ThunkConfig } from '@/app/providers/StoreProvider/config/StateSchema' -import { ApiError, ApiErrorTypes, ApiRoutes } from '@/shared/api/types' import { apiErrorIdentify } from '@/shared/api/apiErrorIdentify' -import { IBlogPostData } from '../types/types' +import { ApiError, ApiErrorTypes, ApiRoutes } from '@/shared/api/types' import { ACTION_GET_BLOG_POSTS } from '@/shared/constants/constants' +import { IBlogPostData } from '../types/types' + // export const getStoreReviews = createAsyncThunk>( export const getBlogPosts = createAsyncThunk>( //void1- выходные данные, void2- входные данные , thunkConfig- тип store diff --git a/src/widgets/BlogBlock/model/slice/blogPostsSlice.ts b/src/widgets/BlogBlock/model/slice/blogPostsSlice.ts index 954ead65..7efd61af 100644 --- a/src/widgets/BlogBlock/model/slice/blogPostsSlice.ts +++ b/src/widgets/BlogBlock/model/slice/blogPostsSlice.ts @@ -1,8 +1,10 @@ import { createSlice } from '@reduxjs/toolkit' -import { IBlogPostsSchema } from '../types/types' -import { getBlogPosts } from '../services/getBlogPosts' -import { REDUCER_BLOG_POSTS } from '@/shared/constants/constants' + import { rejectedPayloadHandle } from '@/shared/api/rejectedPayloadHandle' +import { REDUCER_BLOG_POSTS } from '@/shared/constants/constants' + +import { getBlogPosts } from '../services/getBlogPosts' +import { IBlogPostsSchema } from '../types/types' const initialState: IBlogPostsSchema = { isLoading: false, diff --git a/src/widgets/BlogBlock/ui/BlogBlock.stories.tsx b/src/widgets/BlogBlock/ui/BlogBlock.stories.tsx index dae2de1e..aae3c9ed 100644 --- a/src/widgets/BlogBlock/ui/BlogBlock.stories.tsx +++ b/src/widgets/BlogBlock/ui/BlogBlock.stories.tsx @@ -1,8 +1,8 @@ import type { Meta, StoryObj } from '@storybook/react' import { FC } from 'react' -import styles from './BlogBlock.module.scss' import BlogBlock from './BlogBlock' +import styles from './BlogBlock.module.scss' const StorybookWrapper: FC = () => { return ( diff --git a/src/widgets/BlogBlock/ui/BlogBlock.tsx b/src/widgets/BlogBlock/ui/BlogBlock.tsx index 238f1e42..a161f757 100644 --- a/src/widgets/BlogBlock/ui/BlogBlock.tsx +++ b/src/widgets/BlogBlock/ui/BlogBlock.tsx @@ -1,14 +1,17 @@ import { FC, useEffect } from 'react' -import { getBlogPosts } from '../model/services/getBlogPosts' -import { useAppDispatch } from '@/shared/libs/hooks/store' -import { getBlogPostsSelector } from '../model/selectors/selectors' import { useSelector } from 'react-redux' + import IconLink from '@/assets/icons/IconLink' +import BlogCard from '@/entities/BlogCard/BlogCard' +import { useAppDispatch } from '@/shared/libs/hooks/store' import Heading, { HeadingType } from '@/shared/ui/Heading/Heading' import Link from '@/shared/ui/Link/Link' -import styles from './BlogBlock.module.scss' import Scroll from '@/shared/ui/Scroll/Scroll' -import BlogCard from '@/entities/BlogCard/BlogCard' + +import { getBlogPostsSelector } from '../model/selectors/selectors' +import { getBlogPosts } from '../model/services/getBlogPosts' + +import styles from './BlogBlock.module.scss' /** * Блок группы карточек блога diff --git a/src/widgets/BrandBlock/slice/brandSlice.ts b/src/widgets/BrandBlock/slice/brandSlice.ts index df80ce9c..df09b519 100644 --- a/src/widgets/BrandBlock/slice/brandSlice.ts +++ b/src/widgets/BrandBlock/slice/brandSlice.ts @@ -1,9 +1,11 @@ import { createSlice, createAsyncThunk } from '@reduxjs/toolkit' -import { ApiError, ApiErrorTypes, ApiRoutes } from '@/shared/api/types' + import { ThunkConfig } from '@/app/providers/StoreProvider/config/StateSchema' -import { Brand, BrandSchema } from '../types/types' import { apiErrorIdentify } from '@/shared/api/apiErrorIdentify' import { rejectedPayloadHandle } from '@/shared/api/rejectedPayloadHandle' +import { ApiError, ApiErrorTypes, ApiRoutes } from '@/shared/api/types' + +import { Brand, BrandSchema } from '../types/types' const initialState: BrandSchema = { brands: [], diff --git a/src/widgets/BrandBlock/ui/BrandBlock/BrandBlock.stories.tsx b/src/widgets/BrandBlock/ui/BrandBlock/BrandBlock.stories.tsx index 8b53ce3a..b998a493 100644 --- a/src/widgets/BrandBlock/ui/BrandBlock/BrandBlock.stories.tsx +++ b/src/widgets/BrandBlock/ui/BrandBlock/BrandBlock.stories.tsx @@ -1,7 +1,9 @@ import type { Meta, StoryObj } from '@storybook/react' -import BrandBlock from './BrandBlock' + import { brandsData } from '@/mockData/brandData' +import BrandBlock from './BrandBlock' + const meta = { title: 'widgets/BrandBlock', component: BrandBlock, diff --git a/src/widgets/BrandBlock/ui/BrandBlock/BrandBlock.tsx b/src/widgets/BrandBlock/ui/BrandBlock/BrandBlock.tsx index 7e5aa95f..0ba876df 100644 --- a/src/widgets/BrandBlock/ui/BrandBlock/BrandBlock.tsx +++ b/src/widgets/BrandBlock/ui/BrandBlock/BrandBlock.tsx @@ -1,16 +1,19 @@ import { useEffect } from 'react' import { useDispatch, useSelector } from 'react-redux' -import { Routes } from '@/shared/config/routerConfig/routes' -import { brandSelector } from '../../selectors/selectors' -import { fetchBrands } from '../../slice/brandSlice' + import { AppDispatch } from '@/app/providers/StoreProvider/config/store' import IconLink from '@/assets/icons/IconLink' -import Heading, { HeadingType } from '@/shared/ui/Heading/Heading' -import Link from '@/shared/ui/Link/Link' import BrandCard from '@/entities/BrandCard/BrandCard' +import { Routes } from '@/shared/config/routerConfig/routes' import { TEXT_OUR_BRANDS, TEXT_ALL_BRANDS } from '@/shared/constants/constants' -import styles from './BrandBlock.module.scss' import { BRANDS_FOR_MAIN_NUMBER } from '@/shared/constants/constants' +import Heading, { HeadingType } from '@/shared/ui/Heading/Heading' +import Link from '@/shared/ui/Link/Link' + +import { brandSelector } from '../../selectors/selectors' +import { fetchBrands } from '../../slice/brandSlice' + +import styles from './BrandBlock.module.scss' /** * Компонент списка брендов для главной страницы. diff --git a/src/widgets/CatalogNodeItem/CatalogNodeItem.stories.tsx b/src/widgets/CatalogNodeItem/CatalogNodeItem.stories.tsx index 9d38b924..9988f671 100644 --- a/src/widgets/CatalogNodeItem/CatalogNodeItem.stories.tsx +++ b/src/widgets/CatalogNodeItem/CatalogNodeItem.stories.tsx @@ -1,5 +1,6 @@ // CatalogNodeItem.stories.tsx import { Meta, StoryObj } from '@storybook/react' + import CatalogNodeItem from './CatalogNodeItem' const meta = { diff --git a/src/widgets/CatalogNodeItem/CatalogNodeItem.tsx b/src/widgets/CatalogNodeItem/CatalogNodeItem.tsx index e87f7b5c..1346d02c 100644 --- a/src/widgets/CatalogNodeItem/CatalogNodeItem.tsx +++ b/src/widgets/CatalogNodeItem/CatalogNodeItem.tsx @@ -1,6 +1,7 @@ import { Category } from '@/entities/Category/types/types' import { Routes } from '@/shared/config/routerConfig/routes' import Link from '@/shared/ui/Link/Link' + import styles from './CatalogNodeItem.module.scss' /** diff --git a/src/widgets/CategoryGrid/CategoryGrid.tsx b/src/widgets/CategoryGrid/CategoryGrid.tsx index c7483486..4ffbedab 100644 --- a/src/widgets/CategoryGrid/CategoryGrid.tsx +++ b/src/widgets/CategoryGrid/CategoryGrid.tsx @@ -1,7 +1,8 @@ -import Heading from '@/shared/ui/Heading/Heading' -import CategoryCard from '@/shared/ui/CategoryCard/ui/CategoryCard' import { catalogListData } from '@/mockData/catalogListData' import { TEXT_POPULAR_CATEGORIES } from '@/shared/constants/constants' +import CategoryCard from '@/shared/ui/CategoryCard/ui/CategoryCard' +import Heading from '@/shared/ui/Heading/Heading' + import styles from './CategoryGrid.module.scss' /** diff --git a/src/widgets/MakeOrder/ui/MakeOrder/MakeOrder.stories.tsx b/src/widgets/MakeOrder/ui/MakeOrder/MakeOrder.stories.tsx index ec08f0d1..6a31d670 100644 --- a/src/widgets/MakeOrder/ui/MakeOrder/MakeOrder.stories.tsx +++ b/src/widgets/MakeOrder/ui/MakeOrder/MakeOrder.stories.tsx @@ -1,4 +1,5 @@ import type { Meta, StoryObj } from '@storybook/react' + import { MakeOrder } from './MakeOrder' const meta = { diff --git a/src/widgets/MakeOrder/ui/MakeOrder/MakeOrder.tsx b/src/widgets/MakeOrder/ui/MakeOrder/MakeOrder.tsx index 6d0b91a7..2a4b54d5 100644 --- a/src/widgets/MakeOrder/ui/MakeOrder/MakeOrder.tsx +++ b/src/widgets/MakeOrder/ui/MakeOrder/MakeOrder.tsx @@ -1,7 +1,9 @@ import { Link } from 'react-router-dom' -import styles from './MakeOrder.module.scss' + import { TOrder } from '@/shared/model/types/common' +import styles from './MakeOrder.module.scss' + /** * Компонент Сделать Заказ: тут представлены суммы за заказ , а также кнопки быстрого и обычного заказа * @param {number} amount -кол-во всех продуктов в заказе; diff --git a/src/widgets/NavigationLink/NavigationLink.stories.tsx b/src/widgets/NavigationLink/NavigationLink.stories.tsx index 64d2c0e8..977384c3 100644 --- a/src/widgets/NavigationLink/NavigationLink.stories.tsx +++ b/src/widgets/NavigationLink/NavigationLink.stories.tsx @@ -1,4 +1,5 @@ import { Meta, Story } from '@storybook/react' + import NavigationLink, { NavigationLinkProps } from './NavigationLink' export default { diff --git a/src/widgets/NavigationLink/NavigationLink.tsx b/src/widgets/NavigationLink/NavigationLink.tsx index e523444e..92412a20 100644 --- a/src/widgets/NavigationLink/NavigationLink.tsx +++ b/src/widgets/NavigationLink/NavigationLink.tsx @@ -1,4 +1,5 @@ import Link from '@/shared/ui/Link/Link' + import styles from './NavigationLink.module.scss' export type NavigationLinkProps = { diff --git a/src/widgets/NewsBlock/model/services/getShopNews.ts b/src/widgets/NewsBlock/model/services/getShopNews.ts index 25843a43..6dd0215b 100644 --- a/src/widgets/NewsBlock/model/services/getShopNews.ts +++ b/src/widgets/NewsBlock/model/services/getShopNews.ts @@ -1,10 +1,12 @@ import { createAsyncThunk } from '@reduxjs/toolkit' + import { ThunkConfig } from '@/app/providers/StoreProvider/config/StateSchema' -import { ApiError, ApiErrorTypes, ApiRoutes } from '@/shared/api/types' import { apiErrorIdentify } from '@/shared/api/apiErrorIdentify' -import { ShopNewsData } from '../types/types' +import { ApiError, ApiErrorTypes, ApiRoutes } from '@/shared/api/types' import { ACTION_GET_SHOP_NEWS } from '@/shared/constants/constants' +import { ShopNewsData } from '../types/types' + // export const getStoreReviews = createAsyncThunk>( export const getShopNews = createAsyncThunk>( //void1- выходные данные, void2- входные данные , thunkConfig- тип store diff --git a/src/widgets/NewsBlock/model/slice/shopNewsSlice.ts b/src/widgets/NewsBlock/model/slice/shopNewsSlice.ts index d5969d09..5cc7b031 100644 --- a/src/widgets/NewsBlock/model/slice/shopNewsSlice.ts +++ b/src/widgets/NewsBlock/model/slice/shopNewsSlice.ts @@ -1,7 +1,9 @@ import { createSlice } from '@reduxjs/toolkit' + +import { REDUCER_SHOP_NEWS } from '@/shared/constants/constants' + import { getShopNews } from '../services/getShopNews' import { ShopNewsSchema } from '../types/types' -import { REDUCER_SHOP_NEWS } from '@/shared/constants/constants' const initialState: ShopNewsSchema = { isLoading: false, diff --git a/src/widgets/NewsBlock/ui/NewsBlock.stories.tsx b/src/widgets/NewsBlock/ui/NewsBlock.stories.tsx index 3b80068a..22e4b5b4 100644 --- a/src/widgets/NewsBlock/ui/NewsBlock.stories.tsx +++ b/src/widgets/NewsBlock/ui/NewsBlock.stories.tsx @@ -1,7 +1,8 @@ import type { Meta, StoryObj } from '@storybook/react' -import styles from './NewsBlock.module.scss' import { FC } from 'react' + import NewsBlock from './NewsBlock' +import styles from './NewsBlock.module.scss' const StorybookWrapper: FC = () => { return ( diff --git a/src/widgets/NewsBlock/ui/NewsBlock.tsx b/src/widgets/NewsBlock/ui/NewsBlock.tsx index 63340cad..20b0b574 100644 --- a/src/widgets/NewsBlock/ui/NewsBlock.tsx +++ b/src/widgets/NewsBlock/ui/NewsBlock.tsx @@ -1,15 +1,18 @@ import { FC, useEffect } from 'react' -import { getShopNewsSelector } from '../model/selectors/selectors' import { useSelector } from 'react-redux' -import { useAppDispatch } from '@/shared/libs/hooks/store' -import { getShopNews } from '../model/services/getShopNews' + import IconLink from '@/assets/icons/IconLink' +import NewsCard from '@/entities/NewsCard/NewsCard' +import { useAppDispatch } from '@/shared/libs/hooks/store' import Heading, { HeadingType } from '@/shared/ui/Heading/Heading' import Link from '@/shared/ui/Link/Link' -import styles from './NewsBlock.module.scss' -import NewsCard from '@/entities/NewsCard/NewsCard' import Scroll from '@/shared/ui/Scroll/Scroll' +import { getShopNewsSelector } from '../model/selectors/selectors' +import { getShopNews } from '../model/services/getShopNews' + +import styles from './NewsBlock.module.scss' + /** * Блок группы новостей */ diff --git a/src/widgets/ReviewsBlock/model/services/getStoreReviews.ts b/src/widgets/ReviewsBlock/model/services/getStoreReviews.ts index 798312fc..852a16f5 100644 --- a/src/widgets/ReviewsBlock/model/services/getStoreReviews.ts +++ b/src/widgets/ReviewsBlock/model/services/getStoreReviews.ts @@ -1,7 +1,9 @@ import { createAsyncThunk } from '@reduxjs/toolkit' + import { ThunkConfig } from '@/app/providers/StoreProvider/config/StateSchema' -import { ApiError, ApiErrorTypes, ApiRoutes } from '@/shared/api/types' import { apiErrorIdentify } from '@/shared/api/apiErrorIdentify' +import { ApiError, ApiErrorTypes, ApiRoutes } from '@/shared/api/types' + import { StoreReviewData } from '../types/types' export const getStoreReviews = createAsyncThunk>( diff --git a/src/widgets/ReviewsBlock/model/slice/reviewsSlice.ts b/src/widgets/ReviewsBlock/model/slice/reviewsSlice.ts index 1792dc3b..81ea14d5 100644 --- a/src/widgets/ReviewsBlock/model/slice/reviewsSlice.ts +++ b/src/widgets/ReviewsBlock/model/slice/reviewsSlice.ts @@ -1,6 +1,7 @@ import { createSlice } from '@reduxjs/toolkit' -import { StoreReviewsSchema } from '../types/types' + import { getStoreReviews } from '../services/getStoreReviews' +import { StoreReviewsSchema } from '../types/types' const initialState: StoreReviewsSchema = { isLoading: false, diff --git a/src/widgets/ReviewsBlock/ui/ReviewsBlock/ReviewsBlock.stories.tsx b/src/widgets/ReviewsBlock/ui/ReviewsBlock/ReviewsBlock.stories.tsx index da46ff64..edcb1ffe 100644 --- a/src/widgets/ReviewsBlock/ui/ReviewsBlock/ReviewsBlock.stories.tsx +++ b/src/widgets/ReviewsBlock/ui/ReviewsBlock/ReviewsBlock.stories.tsx @@ -1,7 +1,9 @@ import type { Meta, StoryObj } from '@storybook/react' -import ReviewsBlock from './ReviewsBlock' + import { LINK_REVIEWS_ALL, TEXT_CUSTOMERS_ABOUT_US } from '@/shared/constants/constants' +import ReviewsBlock from './ReviewsBlock' + const meta = { title: 'widgets/ReviewsBlock', component: ReviewsBlock, diff --git a/src/widgets/ReviewsBlock/ui/ReviewsBlock/ReviewsBlock.tsx b/src/widgets/ReviewsBlock/ui/ReviewsBlock/ReviewsBlock.tsx index 629ed3e5..c11d7296 100644 --- a/src/widgets/ReviewsBlock/ui/ReviewsBlock/ReviewsBlock.tsx +++ b/src/widgets/ReviewsBlock/ui/ReviewsBlock/ReviewsBlock.tsx @@ -1,15 +1,18 @@ -import { getStoreReviewsSelector } from '../../model/selectors/selectors' -import { useSelector } from 'react-redux' -import { useAppDispatch } from '@/shared/libs/hooks/store' import { useEffect, type FC } from 'react' -import IconHand from '@/assets/images/img-hand.png.png' +import { useSelector } from 'react-redux' + import IconLink from '@/assets/icons/IconLink' +import IconHand from '@/assets/images/img-hand.png.png' +import CardReview from '@/entities/CardReview/ui/CardReview/CardReview' +import { useAppDispatch } from '@/shared/libs/hooks/store' import Heading, { HeadingType } from '@/shared/ui/Heading/Heading' import Link from '@/shared/ui/Link/Link' -import styles from './reviewsBlock.module.scss' -import CardReview from '@/entities/CardReview/ui/CardReview/CardReview' + +import { getStoreReviewsSelector } from '../../model/selectors/selectors' import { getStoreReviews } from '../../model/services/getStoreReviews' +import styles from './reviewsBlock.module.scss' + export type Props = { title: string linkText?: string diff --git a/src/widgets/SearchResult/SearchResult.stories.tsx b/src/widgets/SearchResult/SearchResult.stories.tsx index 716aaec1..781edd54 100644 --- a/src/widgets/SearchResult/SearchResult.stories.tsx +++ b/src/widgets/SearchResult/SearchResult.stories.tsx @@ -1,7 +1,9 @@ import { Meta, Story } from '@storybook/react' -import SearchResult from './SearchResult' + import { searchResponseData } from '@/mockData/searchData' +import SearchResult from './SearchResult' + export default { title: 'Widgets/SearchResult', component: SearchResult diff --git a/src/widgets/SearchResult/SearchResult.tsx b/src/widgets/SearchResult/SearchResult.tsx index d5163210..f3ec08c3 100644 --- a/src/widgets/SearchResult/SearchResult.tsx +++ b/src/widgets/SearchResult/SearchResult.tsx @@ -1,11 +1,13 @@ import { forwardRef } from 'react' + +import SearchIcon from '@/assets/images/search/search-icon.svg' import SearchItem from '@/entities/SearchItem/SearchItem' +import { TCategory } from '@/models/CategoryModel' +import { Routes } from '@/shared/config/routerConfig/routes' import { SEARCH_CATEGORY, SEARCH_PRODUCT } from '@/shared/constants/constants' import type { TProduct } from '@/shared/model/types/common' -import { TCategory } from '@/models/CategoryModel' -import SearchIcon from '@/assets/images/search/search-icon.svg' import Link from '@/shared/ui/Link/Link' -import { Routes } from '@/shared/config/routerConfig/routes' + import styles from './SearchResult.module.scss' type TProps = { diff --git a/src/widgets/StoriesBlock/ui/StoriesBlock.stories.tsx b/src/widgets/StoriesBlock/ui/StoriesBlock.stories.tsx index 9edae4a0..3f771518 100644 --- a/src/widgets/StoriesBlock/ui/StoriesBlock.stories.tsx +++ b/src/widgets/StoriesBlock/ui/StoriesBlock.stories.tsx @@ -1,7 +1,8 @@ -import { FC } from 'react' import type { Meta, StoryObj } from '@storybook/react' -import styles from './StoriesBlock.module.scss' +import { FC } from 'react' + import StoriesBlock from './StoriesBlock' +import styles from './StoriesBlock.module.scss' const StorybookWrapper: FC = () => { return ( diff --git a/src/widgets/StoriesBlock/ui/StoriesBlock.tsx b/src/widgets/StoriesBlock/ui/StoriesBlock.tsx index b81fd60d..641cafed 100644 --- a/src/widgets/StoriesBlock/ui/StoriesBlock.tsx +++ b/src/widgets/StoriesBlock/ui/StoriesBlock.tsx @@ -1,9 +1,11 @@ import { FC } from 'react' + +import StoryCard from '@/entities/StoryCard/StoryCard' +import { storiesData } from '@/mockData/storiesData' import Heading, { HeadingType } from '@/shared/ui/Heading/Heading' -import styles from './StoriesBlock.module.scss' import Scroll from '@/shared/ui/Scroll/Scroll' -import { storiesData } from '@/mockData/storiesData' -import StoryCard from '@/entities/StoryCard/StoryCard' + +import styles from './StoriesBlock.module.scss' /** * Блок группы историй