From c05a8ab0ca6eef2c325dfc32be22a326e860fdfa Mon Sep 17 00:00:00 2001 From: bowd Date: Sat, 13 Jan 2024 17:15:04 +0100 Subject: [PATCH 1/9] feat: setup eslint with prettier --- .eslintrc.json | 7 +- package-lock.json | 178 +++++++++++++++++++++++++++++++++++++++------- package.json | 8 ++- 3 files changed, 165 insertions(+), 28 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index bffb357a..cef8b6ea 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,3 +1,6 @@ { - "extends": "next/core-web-vitals" -} + "extends": [ + "next/core-web-vitals", + "plugin:prettier/recommended" + ] +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 981fc085..bad155b5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,8 +31,7 @@ "viem": "^1.16.6", "wagmi": "^1.4.4", "yup": "^1.3.2", - "zustand": "^4.4.7", - "zustand-store-addons": "^0.1.12" + "zustand": "^4.4.7" }, "devDependencies": { "@tailwindcss/typography": "^0.5.10", @@ -44,7 +43,10 @@ "autoprefixer": "^10", "eslint": "^8", "eslint-config-next": "13.5.4", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-prettier": "^5.1.3", "postcss": "^8", + "prettier": "^3.2.1", "tailwindcss": "^3", "typescript": "^5" } @@ -1687,6 +1689,18 @@ "node": ">=14" } }, + "node_modules/@pkgr/core": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.0.tgz", + "integrity": "sha512-Zwq5OCzuwJC2jwqmpEQt7Ds1DTi6BWSwoGkbb1n9pO3hzb35BoJELx7c0T23iDkBGkh2e7tvOtjF3tr3OaQHDQ==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, "node_modules/@radix-ui/colors": { "version": "0.1.9", "resolved": "https://registry.npmjs.org/@radix-ui/colors/-/colors-0.1.9.tgz", @@ -4175,6 +4189,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "is-array-buffer": "^3.0.1" @@ -4283,6 +4298,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.2.tgz", "integrity": "sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw==", + "dev": true, "dependencies": { "array-buffer-byte-length": "^1.0.0", "call-bind": "^1.0.2", @@ -5098,6 +5114,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, "dependencies": { "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", @@ -5343,6 +5360,7 @@ "version": "1.22.3", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.3.tgz", "integrity": "sha512-eiiY8HQeYfYH2Con2berK+To6GrK2RxbPawDkGq4UiCQQfZHb6wX9qQqkbpPqaxQFcl8d9QzZqo0tGE0VcrdwA==", + "dev": true, "dependencies": { "array-buffer-byte-length": "^1.0.0", "arraybuffer.prototype.slice": "^1.0.2", @@ -5417,6 +5435,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.2.tgz", "integrity": "sha512-BuDyupZt65P9D2D2vA/zqcI3G5xRsklm5N3xCwuiy+/vKy8i0ifdsQP1sLgO4tZDSCaQUSnmC48khknGMV3D2Q==", + "dev": true, "dependencies": { "get-intrinsic": "^1.2.2", "has-tostringtag": "^1.0.0", @@ -5439,6 +5458,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, "dependencies": { "is-callable": "^1.1.4", "is-date-object": "^1.0.1", @@ -5604,6 +5624,18 @@ } } }, + "node_modules/eslint-config-prettier": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", + "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", + "dev": true, + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "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", @@ -5766,6 +5798,36 @@ "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8" } }, + "node_modules/eslint-plugin-prettier": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.1.3.tgz", + "integrity": "sha512-C9GCVAs4Eq7ZC/XFQHITLiHJxQngdtraXaM+LoUFoFp/lHNl2Zn8f3WQbe9HvTBBQ9YnKFB0/2Ajdqwo5D1EAw==", + "dev": true, + "dependencies": { + "prettier-linter-helpers": "^1.0.0", + "synckit": "^0.8.6" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint-plugin-prettier" + }, + "peerDependencies": { + "@types/eslint": ">=8.0.0", + "eslint": ">=8.0.0", + "eslint-config-prettier": "*", + "prettier": ">=3.0.0" + }, + "peerDependenciesMeta": { + "@types/eslint": { + "optional": true + }, + "eslint-config-prettier": { + "optional": true + } + } + }, "node_modules/eslint-plugin-react": { "version": "7.33.2", "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.33.2.tgz", @@ -6104,6 +6166,12 @@ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, + "node_modules/fast-diff": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", + "dev": true + }, "node_modules/fast-glob": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", @@ -6343,6 +6411,7 @@ "version": "1.1.6", "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", @@ -6360,6 +6429,7 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -6414,6 +6484,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.1.1" @@ -6493,6 +6564,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "dev": true, "dependencies": { "define-properties": "^1.1.3" }, @@ -6564,6 +6636,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -7647,6 +7720,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.6.tgz", "integrity": "sha512-Xj6dv+PsbtwyPpEflsejS+oIZxmMlV44zAhG479uYu89MsjcYOhCFnNyKrkJrihbsiasQyY0afoCl/9BLR65bg==", + "dev": true, "dependencies": { "get-intrinsic": "^1.2.2", "hasown": "^2.0.0", @@ -7741,6 +7815,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.2.0", @@ -7769,6 +7844,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, "dependencies": { "has-bigints": "^1.0.1" }, @@ -7791,6 +7867,7 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -7851,6 +7928,7 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dev": true, "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -7959,6 +8037,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", + "dev": true, "engines": { "node": ">= 0.4" }, @@ -7978,6 +8057,7 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dev": true, "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -8012,6 +8092,7 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -8036,6 +8117,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "dev": true, "dependencies": { "call-bind": "^1.0.2" }, @@ -8058,6 +8140,7 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dev": true, "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -8072,6 +8155,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dev": true, "dependencies": { "has-symbols": "^1.0.2" }, @@ -8114,6 +8198,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dev": true, "dependencies": { "call-bind": "^1.0.2" }, @@ -8581,11 +8666,6 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, - "node_modules/lodash-es": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", - "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==" - }, "node_modules/lodash.castarray": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.castarray/-/lodash.castarray-4.4.0.tgz", @@ -9896,6 +9976,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, "engines": { "node": ">= 0.4" } @@ -9904,6 +9985,7 @@ "version": "4.1.5", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", + "dev": true, "dependencies": { "call-bind": "^1.0.5", "define-properties": "^1.2.1", @@ -10467,6 +10549,33 @@ "node": ">= 0.8.0" } }, + "node_modules/prettier": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.1.tgz", + "integrity": "sha512-qSUWshj1IobVbKc226Gw2pync27t0Kf0EdufZa9j7uBSJay1CC+B3K5lAAZoqgX3ASiKuWsk6OmzKRetXNObWg==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "dependencies": { + "fast-diff": "^1.1.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/prismjs": { "version": "1.29.0", "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz", @@ -11149,6 +11258,7 @@ "version": "1.5.1", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz", "integrity": "sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", @@ -12661,6 +12771,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.1.tgz", "integrity": "sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.2.1", @@ -12677,7 +12788,8 @@ "node_modules/safe-array-concat/node_modules/isarray": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true }, "node_modules/safe-buffer": { "version": "5.2.1", @@ -12702,6 +12814,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.1.3", @@ -12780,6 +12893,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.1.tgz", "integrity": "sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA==", + "dev": true, "dependencies": { "define-data-property": "^1.0.1", "functions-have-names": "^1.2.3", @@ -13013,6 +13127,7 @@ "version": "4.0.10", "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.10.tgz", "integrity": "sha512-rGXbGmOEosIQi6Qva94HUjgPs9vKW+dkG7Y8Q5O2OYkWL6wFaTRZO8zM4mhP94uX55wgyrXzfS2aGtGzUL7EJQ==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", @@ -13032,6 +13147,7 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz", "integrity": "sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", @@ -13048,6 +13164,7 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz", "integrity": "sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", @@ -13061,6 +13178,7 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz", "integrity": "sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", @@ -13276,6 +13394,28 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/synckit": { + "version": "0.8.8", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.8.tgz", + "integrity": "sha512-HwOKAP7Wc5aRGYdKH+dw0PRRpbO841v2DENBtjnR5HFWoiNByAl7vrx3p0G/rCyYXQsrxqtX48TImFtPcIHSpQ==", + "dev": true, + "dependencies": { + "@pkgr/core": "^0.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, + "node_modules/synckit/node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true + }, "node_modules/tailwindcss": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.0.tgz", @@ -13497,6 +13637,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz", "integrity": "sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.2.1", @@ -13510,6 +13651,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz", "integrity": "sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "for-each": "^0.3.3", @@ -13527,6 +13669,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz", "integrity": "sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==", + "dev": true, "dependencies": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", @@ -13545,6 +13688,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "for-each": "^0.3.3", @@ -13613,6 +13757,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "has-bigints": "^1.0.2", @@ -14316,6 +14461,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, "dependencies": { "is-bigint": "^1.0.1", "is-boolean-object": "^1.1.0", @@ -14639,22 +14785,6 @@ } } }, - "node_modules/zustand-store-addons": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/zustand-store-addons/-/zustand-store-addons-0.1.12.tgz", - "integrity": "sha512-AZqKUD6PRGe8y40ei84NRtNtBIXaTAh0+HJlWfYkSlX9R8JEb8+4bpuaJNMqAC26fLlz3sKJV8UE0uK5cGhwqg==", - "dependencies": { - "lodash-es": "^4.17.15", - "string.prototype.matchall": "^4.0.2" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "react": ">=16", - "zustand": ">=3.0.0" - } - }, "node_modules/zwitch": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz", diff --git a/package.json b/package.json index 14c3dd58..3e663aa9 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "dev": "next dev", "build": "next build", "start": "next start", - "lint": "next lint" + "lint": "next lint", + "lint:fix": "next lint --fix" }, "dependencies": { "@celo/rainbowkit-celo": "^1.1.2", @@ -44,8 +45,11 @@ "autoprefixer": "^10", "eslint": "^8", "eslint-config-next": "13.5.4", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-prettier": "^5.1.3", "postcss": "^8", + "prettier": "^3.2.1", "tailwindcss": "^3", "typescript": "^5" } -} +} \ No newline at end of file From 5c4f4564e01e236db47e4a8099cdb0eb3c7484bf Mon Sep 17 00:00:00 2001 From: bowd Date: Sat, 13 Jan 2024 17:16:06 +0100 Subject: [PATCH 2/9] fix: fix code formatting issues --- app/(api)/api/proposals/[id]/route.ts | 22 +- .../api/proposals/[id]/votes/[type]/route.ts | 10 +- app/(api)/api/proposals/[id]/votes/route.ts | 450 ++++++++------ app/(api)/api/proposals/route.ts | 222 ++++--- .../api/users/[address]/balance/route.ts | 32 +- .../[address]/locks/[id]/extend/route.ts | 32 +- app/(api)/api/users/[address]/locks/route.ts | 32 +- app/(routes)/create-proposal/page.tsx | 33 +- app/(routes)/layout.tsx | 50 +- app/(routes)/my-voting-power/page.tsx | 37 +- app/(routes)/page.tsx | 64 +- app/(routes)/proposals/[id]/page.tsx | 348 ++++++----- app/(routes)/providers.tsx | 32 +- app/components/_icons/celo-logo.icon.tsx | 39 +- app/components/_icons/chevron.icon.tsx | 66 ++- app/components/_icons/copy.icon.tsx | 33 +- app/components/_icons/dark-mode.icon.tsx | 24 +- app/components/_icons/discord.icon.tsx | 42 +- app/components/_icons/github.icon.tsx | 43 +- app/components/_icons/index.tsx | 22 +- app/components/_icons/learn-more.icon.tsx | 558 ++++++++++++++---- app/components/_icons/light-mode.icon.tsx | 28 +- app/components/_icons/mento-logo.icon.tsx | 43 +- .../_icons/mento-text-logo.icon.tsx | 48 +- app/components/_icons/mento.icon.tsx | 43 +- app/components/_icons/twitter.icon.tsx | 30 +- .../_shared/avatar/avatar.component.tsx | 27 +- .../_shared/badge/badge.component.tsx | 29 +- .../breadcrumbs/breadcrumbs.component.tsx | 12 +- .../_shared/button/button.component.tsx | 92 +-- .../_shared/card/card.component.tsx | 50 +- .../connect-button.component.tsx | 134 ++--- .../date-picker/date-picker.component.tsx | 96 ++- .../_shared/divider/divider.component.tsx | 6 +- .../dropdown-button.addons.tsx | 28 +- .../dropdown-button.component.tsx | 69 ++- .../expandable/expandable.component.tsx | 25 +- .../_shared/footer/footer.component.tsx | 57 +- .../_shared/header/header.component.tsx | 168 +++--- app/components/_shared/index.tsx | 48 +- .../_shared/input/input.component.tsx | 53 +- .../_shared/loader/loader.component.tsx | 22 +- .../markdown-editor.component.tsx | 153 ++--- .../markdown-view/markdown-view.component.tsx | 24 +- .../_shared/mnto-lock/mnto-lock.component.tsx | 247 ++++---- .../progress-bar/progress-bar.component.tsx | 35 +- .../_shared/slider/slider.component.tsx | 100 ++-- .../step-counter/step-counter.component.tsx | 16 +- .../_shared/tabs/tab-list.component.tsx | 52 +- app/components/_shared/tabs/tab.component.tsx | 18 +- .../_shared/textarea/textarea.component.tsx | 36 +- .../wallet-address-with-copy.component.tsx | 21 +- .../contract-params.component.tsx | 224 +++---- .../countdown/countdown.component.tsx | 83 ++- ...create-proposal-content-step.component.tsx | 83 +-- ...eate-proposal-execution-step.component.tsx | 43 +- ...create-proposal-preview-step.component.tsx | 32 +- .../create-proposal-wallet-step.component.tsx | 98 +-- app/components/create-proposal/index.tsx | 8 +- .../wrapper/wrapper.component.tsx | 69 ++- .../locks-list/locks-list.component.tsx | 70 +-- .../proposals-list.component.tsx | 120 ++-- .../theme-switch/theme-switch.component.tsx | 43 +- .../votes-list/votes-list.component.tsx | 51 +- .../wallet-address.component.tsx | 10 +- app/helpers/numbers.service.ts | 2 +- app/helpers/routing.map.ts | 11 +- app/helpers/string.service.ts | 4 +- app/helpers/wallet.helper.ts | 4 +- app/helpers/wallet.ts | 74 +-- app/hooks/useOutsideAlerter.ts | 4 +- .../base-component-props.interface.ts | 4 +- app/interfaces/base-icon-props.interface.ts | 2 +- app/interfaces/base-input-props.interface.ts | 2 +- app/interfaces/create-proposal.interface.ts | 65 +- app/interfaces/lock.interface.ts | 2 +- app/interfaces/proposal.interface.ts | 22 +- app/interfaces/vote.interface.ts | 2 +- app/providers/modal.provider.tsx | 158 ++--- app/store/create-proposal.store.ts | 63 +- app/store/index.ts | 8 +- app/store/proposal-details.store.ts | 30 +- app/store/proposal-list.store.ts | 12 +- app/store/user.store.ts | 60 +- app/types/index.ts | 14 +- 85 files changed, 3084 insertions(+), 2394 deletions(-) diff --git a/app/(api)/api/proposals/[id]/route.ts b/app/(api)/api/proposals/[id]/route.ts index 6f03c16c..71eafb25 100644 --- a/app/(api)/api/proposals/[id]/route.ts +++ b/app/(api)/api/proposals/[id]/route.ts @@ -1,5 +1,5 @@ -import {NextRequest} from "next/server"; -import IProposal, {ProposalStatus} from "@interfaces/proposal.interface"; +import { NextRequest } from "next/server"; +import IProposal, { ProposalStatus } from "@interfaces/proposal.interface"; import addDays from "date-fns/addDays"; const proposalDescription = `This is an amended draft proposal by the RARI Foundation, addressing community feedback. @@ -99,11 +99,11 @@ Payment terms: The 100,000 USD amount is payable in ARB under the exchange rate on the day of the proposal submission. As of Sept 13, the rate is 1 ARB = $0.785339, which translates to 127,351 ARB. -Note that the Rari Foundation will absorb costs related to the service and maintainance of the Protocol upkeep after the integration implementation.` +Note that the Rari Foundation will absorb costs related to the service and maintainance of the Protocol upkeep after the integration implementation.`; const singleProposal: IProposal = { - id: '599ca521-df39-442f-937c-03b20bcafc2d', - title: 'Building the Building the Future of NFTs: The Rarible Protocol', + id: "599ca521-df39-442f-937c-03b20bcafc2d", + title: "Building the Building the Future of NFTs: The Rarible Protocol", description: proposalDescription, status: ProposalStatus.active, votesYes: 2700, @@ -111,20 +111,20 @@ const singleProposal: IProposal = { votesTotal: 4100, createdAt: addDays(new Date(), Math.round(Math.random() * 10) * -1), deadlineAt: addDays(new Date(), Math.round(Math.random() * 10)), - creator: 'Andrzej' -} + creator: "Andrzej", +}; interface GetMethodContext { params: { id: string; - } + }; } export async function GET(req: NextRequest, { params: { id } }: GetMethodContext) { const data = { ...singleProposal, - id - } + id, + }; return Response.json(data); -} \ No newline at end of file +} diff --git a/app/(api)/api/proposals/[id]/votes/[type]/route.ts b/app/(api)/api/proposals/[id]/votes/[type]/route.ts index dbdc841c..3ba1aee2 100644 --- a/app/(api)/api/proposals/[id]/votes/[type]/route.ts +++ b/app/(api)/api/proposals/[id]/votes/[type]/route.ts @@ -1,11 +1,11 @@ -import {NextRequest} from "next/server"; -import {IVoteType} from "@interfaces/vote.interface"; +import { NextRequest } from "next/server"; +import { IVoteType } from "@interfaces/vote.interface"; interface PutMethodContext { params: { id: string; type: IVoteType; - } + }; } export async function PUT(req: NextRequest, { params: { type, id } }: PutMethodContext) { @@ -14,8 +14,8 @@ export async function PUT(req: NextRequest, { params: { type, id } }: PutMethodC const data = { id, type, - ...body + ...body, }; return Response.json(data); -} \ No newline at end of file +} diff --git a/app/(api)/api/proposals/[id]/votes/route.ts b/app/(api)/api/proposals/[id]/votes/route.ts index 56b522c7..071269bd 100644 --- a/app/(api)/api/proposals/[id]/votes/route.ts +++ b/app/(api)/api/proposals/[id]/votes/route.ts @@ -1,270 +1,330 @@ -import {IVote, IVoteType} from "@interfaces/vote.interface"; -import {NextRequest} from "next/server"; +import { IVote, IVoteType } from "@interfaces/vote.interface"; +import { NextRequest } from "next/server"; const votesMock: IVote[] = [ { - address: '0xBFA98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + address: "0xBFA98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 250, - type: 'for', - },{ - address: '0xBFA98CF93CDDEE1FCA31F2C6D42DB66A9AB8A80D', + type: "for", + }, + { + address: "0xBFA98CF93CDDEE1FCA31F2C6D42DB66A9AB8A80D", votes: 456, - type: 'against' - },{ - address: '0xBFA98CF93CDC5E1FBA31F2C6D42DB66A9AB8A80D', + type: "against", + }, + { + address: "0xBFA98CF93CDC5E1FBA31F2C6D42DB66A9AB8A80D", votes: 1000, - type: 'against' - },{ - address: '0xBFA98CF93CDC5E1FCA31F2C6D42DB64A9AB8A80D', + type: "against", + }, + { + address: "0xBFA98CF93CDC5E1FCA31F2C6D42DB64A9AB8A80D", votes: 234, - type: 'for' - },{ - address: '0xBFA98CF93CDC5E1FCA31F3C6D42DB66A9AB8A80D', + type: "for", + }, + { + address: "0xBFA98CF93CDC5E1FCA31F3C6D42DB66A9AB8A80D", votes: 123, - type: 'for' - },{ - address: '0xBFA98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "for", + }, + { + address: "0xBFA98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 250, - type: 'for' - },{ - address: '0xBFA98CF93CDC5E1FCA31F2C6D42DB64A9AB8A80D', + type: "for", + }, + { + address: "0xBFA98CF93CDC5E1FCA31F2C6D42DB64A9AB8A80D", votes: 234, - type: 'for' - },{ - address: '0xBFA98CF93CDC5E1FCA31F3C6D42DB66A9AB8A80D', + type: "for", + }, + { + address: "0xBFA98CF93CDC5E1FCA31F3C6D42DB66A9AB8A80D", votes: 123, - type: 'for' - },{ - address: '0xBFA98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "for", + }, + { + address: "0xBFA98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 250, - type: 'for' - },{ - address: '0xBFA98CF93CDC5E1FCA31F2C6D42DB64A9AB8A80D', + type: "for", + }, + { + address: "0xBFA98CF93CDC5E1FCA31F2C6D42DB64A9AB8A80D", votes: 234, - type: 'for' - },{ - address: '0xBFA98CF93CDC5E1FCA31F3C6D42DB66A9AB8A80D', + type: "for", + }, + { + address: "0xBFA98CF93CDC5E1FCA31F3C6D42DB66A9AB8A80D", votes: 123, - type: 'for' - },{ - address: '0xBFA98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "for", + }, + { + address: "0xBFA98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 250, - type: 'for' - },{ - address: '0xBFA91CF93CDC5E1FCA31F2C6D42DB66A9AB8A10D', + type: "for", + }, + { + address: "0xBFA91CF93CDC5E1FCA31F2C6D42DB66A9AB8A10D", votes: 567, - type: 'for' - },{ - address: '0xBFA98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "for", + }, + { + address: "0xBFA98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 45, - type: 'for' - },{ - address: '0xBFA98CF93CDC8E1FCA31F2C6D42DB66A9AB8A80D', + type: "for", + }, + { + address: "0xBFA98CF93CDC8E1FCA31F2C6D42DB66A9AB8A80D", votes: 987, - type: 'for' - },{ - address: '0xBFA98CF93CDC5E1FCA31F2C6D42DB66A9AB8A82D', + type: "for", + }, + { + address: "0xBFA98CF93CDC5E1FCA31F2C6D42DB66A9AB8A82D", votes: 345, - type: 'for' - },{ - address: '0xBFA78CF93CDC5E1FCA31F2C6D42DB66A9AB8A80C', + type: "for", + }, + { + address: "0xBFA78CF93CDC5E1FCA31F2C6D42DB66A9AB8A80C", votes: 4856, - type: 'for' - },{ - address: '0xBFA16CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "for", + }, + { + address: "0xBFA16CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 234, - type: 'for' - },{ - address: '0xBFA10CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "for", + }, + { + address: "0xBFA10CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 819, - type: 'for' - },{ - address: '0xBFA20CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "for", + }, + { + address: "0xBFA20CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 981, - type: 'for' - },{ - address: '0xBFA98BB93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "for", + }, + { + address: "0xBFA98BB93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 234, - type: 'for' - },{ - address: '0xBFA98CF93ADC5E1CCA31F126D42DB66A9AB8A80D', + type: "for", + }, + { + address: "0xBFA98CF93ADC5E1CCA31F126D42DB66A9AB8A80D", votes: 456, - type: 'for' - },{ - address: '0xBFA98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "for", + }, + { + address: "0xBFA98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 1091, - type: 'abstain' - },{ - address: '0xCDA98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "abstain", + }, + { + address: "0xCDA98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 987, - type: 'for' - },{ - address: '0x12398CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "for", + }, + { + address: "0x12398CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 716, - type: 'abstain' - },{ - address: '0xABC98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "abstain", + }, + { + address: "0xABC98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 189, - type: 'for' - },{ - address: '0xBFA98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "for", + }, + { + address: "0xBFA98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 45, - type: 'abstain' - },{ - address: '0xBFA98CF93CDC8E1FCA31F2C6D42DB66A9AB8A80D', + type: "abstain", + }, + { + address: "0xBFA98CF93CDC8E1FCA31F2C6D42DB66A9AB8A80D", votes: 987, - type: 'for' - },{ - address: '0xBFA98CF93CDC5E1FCA31F2C6D42DB66A9AB8A82D', + type: "for", + }, + { + address: "0xBFA98CF93CDC5E1FCA31F2C6D42DB66A9AB8A82D", votes: 345, - type: 'for' - },{ - address: '0xBFA78CF93CDC5E1FCA31F2C6D42DB66A9AB8A80C', + type: "for", + }, + { + address: "0xBFA78CF93CDC5E1FCA31F2C6D42DB66A9AB8A80C", votes: 4856, - type: 'abstain' - },{ - address: '0xBFA16CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "abstain", + }, + { + address: "0xBFA16CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 234, - type: 'for' - },{ - address: '0xBFA10CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "for", + }, + { + address: "0xBFA10CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 819, - type: 'abstain' - },{ - address: '0xBFA20CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "abstain", + }, + { + address: "0xBFA20CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 981, - type: 'abstain' - },{ - address: '0xBFA98BB93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "abstain", + }, + { + address: "0xBFA98BB93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 234, - type: 'abstain' - },{ - address: '0xBFA10CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "abstain", + }, + { + address: "0xBFA10CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 819, - type: 'abstain' - },{ - address: '0xBFA20CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "abstain", + }, + { + address: "0xBFA20CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 981, - type: 'abstain' - },{ - address: '0xBFA98BB93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "abstain", + }, + { + address: "0xBFA98BB93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 234, - type: 'abstain' - },{ - address: '0xBFA10CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "abstain", + }, + { + address: "0xBFA10CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 819, - type: 'abstain' - },{ - address: '0xBFA20CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "abstain", + }, + { + address: "0xBFA20CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 981, - type: 'abstain' - },{ - address: '0xBFA98BB93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "abstain", + }, + { + address: "0xBFA98BB93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 234, - type: 'abstain' - },{ - address: '0xBFA10CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "abstain", + }, + { + address: "0xBFA10CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 819, - type: 'abstain' - },{ - address: '0xBFA20CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "abstain", + }, + { + address: "0xBFA20CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 981, - type: 'abstain' - },{ - address: '0xBFA98BB93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "abstain", + }, + { + address: "0xBFA98BB93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 234, - type: 'abstain' - },{ - address: '0xBFA98CF93ADC5E1CCA31F126D42DB66A9AB8A80D', + type: "abstain", + }, + { + address: "0xBFA98CF93ADC5E1CCA31F126D42DB66A9AB8A80D", votes: 456, - type: 'for' - },{ - address: '0xBFA98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "for", + }, + { + address: "0xBFA98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 1091, - type: 'for' - },{ - address: '0xCDA98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "for", + }, + { + address: "0xCDA98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 987, - type: 'abstain' - },{ - address: '0x12398CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "abstain", + }, + { + address: "0x12398CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 716, - type: 'against' - },{ - address: '0xABC98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "against", + }, + { + address: "0xABC98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 189, - type: 'against' - },{ - address: '0xCDA98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "against", + }, + { + address: "0xCDA98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 987, - type: 'abstain' - },{ - address: '0x12398CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "abstain", + }, + { + address: "0x12398CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 716, - type: 'against' - },{ - address: '0xABC98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "against", + }, + { + address: "0xABC98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 189, - type: 'against' - },{ - address: '0xCDA98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "against", + }, + { + address: "0xCDA98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 987, - type: 'abstain' - },{ - address: '0x12398CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "abstain", + }, + { + address: "0x12398CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 716, - type: 'against' - },{ - address: '0xABC98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "against", + }, + { + address: "0xABC98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 189, - type: 'against' - },{ - address: '0xCDA98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "against", + }, + { + address: "0xCDA98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 987, - type: 'abstain' - },{ - address: '0x12398CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "abstain", + }, + { + address: "0x12398CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 716, - type: 'against' - },{ - address: '0xABC98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "against", + }, + { + address: "0xABC98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 189, - type: 'against' - },{ - address: '0xCDA98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "against", + }, + { + address: "0xCDA98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 987, - type: 'abstain' - },{ - address: '0x12398CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "abstain", + }, + { + address: "0x12398CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 716, - type: 'against' - },{ - address: '0xABC98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "against", + }, + { + address: "0xABC98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 189, - type: 'against' - },{ - address: '0xCDA98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "against", + }, + { + address: "0xCDA98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 987, - type: 'abstain' - },{ - address: '0x12398CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "abstain", + }, + { + address: "0x12398CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 716, - type: 'against' - },{ - address: '0xABC98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D', + type: "against", + }, + { + address: "0xABC98CF93CDC5E1FCA31F2C6D42DB66A9AB8A80D", votes: 189, - type: 'against' + type: "against", }, -] - +]; interface GetMethodContext { params: { id: String; - } + }; } - export async function GET(req: NextRequest, { params: { id } }: GetMethodContext) { return Response.json(votesMock); -} \ No newline at end of file +} diff --git a/app/(api)/api/proposals/route.ts b/app/(api)/api/proposals/route.ts index c7a15cb3..957b3699 100644 --- a/app/(api)/api/proposals/route.ts +++ b/app/(api)/api/proposals/route.ts @@ -1,213 +1,247 @@ -import IProposal, {ProposalStatus} from "@interfaces/proposal.interface"; -import {MentoIcon} from "@components/_icons"; -import {NextRequest} from "next/server"; +import IProposal, { ProposalStatus } from "@interfaces/proposal.interface"; +import { MentoIcon } from "@components/_icons"; +import { NextRequest } from "next/server"; const proposalsMock: IProposal[] = [ { - id: '599ca521-df39-442f-937c-03b20bcafc2d', - title: 'Building the Building the Future of NFTs: The Rarible Protocol', - description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', + id: "599ca521-df39-442f-937c-03b20bcafc2d", + title: "Building the Building the Future of NFTs: The Rarible Protocol", + description: + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", status: ProposalStatus.active, votesYes: 2700, votesNo: 1400, votesTotal: 4100, createdAt: new Date(), deadlineAt: new Date(), - creator: 'Andrzej' - }, { - id: '599ca521-df39-442f-937c-03b20bcafc2d', - title: 'Building the Building the Future of NFTs: The Rarible Protocol', - description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', + creator: "Andrzej", + }, + { + id: "599ca521-df39-442f-937c-03b20bcafc2d", + title: "Building the Building the Future of NFTs: The Rarible Protocol", + description: + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", status: ProposalStatus.active, votesYes: 2700, votesNo: 1400, votesTotal: 4100, createdAt: new Date(), deadlineAt: new Date(), - creator: 'Andrzej' - }, { - id: '599ca521-df39-442f-937c-03b20bcafc2d', - title: 'Building the Building the Future of NFTs: The Rarible Protocol', - description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', + creator: "Andrzej", + }, + { + id: "599ca521-df39-442f-937c-03b20bcafc2d", + title: "Building the Building the Future of NFTs: The Rarible Protocol", + description: + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", status: ProposalStatus.active, votesYes: 2700, votesNo: 1400, votesTotal: 4100, createdAt: new Date(), deadlineAt: new Date(), - creator: 'Andrzej' - }, { - id: '599ca521-df39-442f-937c-03b20bcafc2d', - title: 'Building the Building the Future of NFTs: The Rarible Protocol', - description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', + creator: "Andrzej", + }, + { + id: "599ca521-df39-442f-937c-03b20bcafc2d", + title: "Building the Building the Future of NFTs: The Rarible Protocol", + description: + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", status: ProposalStatus.active, votesYes: 2700, votesNo: 1400, votesTotal: 4100, createdAt: new Date(), deadlineAt: new Date(), - creator: 'Andrzej' - }, { - id: '599ca521-df39-442f-937c-03b20bcafc2d', - title: 'Building the Building the Future of NFTs: The Rarible Protocol', - description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', + creator: "Andrzej", + }, + { + id: "599ca521-df39-442f-937c-03b20bcafc2d", + title: "Building the Building the Future of NFTs: The Rarible Protocol", + description: + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", status: ProposalStatus.active, votesYes: 2700, votesNo: 1400, votesTotal: 4100, createdAt: new Date(), deadlineAt: new Date(), - creator: 'Andrzej' - }, { - id: '599ca521-df39-442f-937c-03b20bcafc2d', - title: 'Building the Building the Future of NFTs: The Rarible Protocol', - description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', + creator: "Andrzej", + }, + { + id: "599ca521-df39-442f-937c-03b20bcafc2d", + title: "Building the Building the Future of NFTs: The Rarible Protocol", + description: + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", status: ProposalStatus.active, votesYes: 2700, votesNo: 1400, votesTotal: 4100, createdAt: new Date(), deadlineAt: new Date(), - creator: 'Andrzej' - }, { - id: '599ca521-df39-442f-937c-03b20bcafc2d', - title: 'Building the Building the Future of NFTs: The Rarible Protocol', - description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', + creator: "Andrzej", + }, + { + id: "599ca521-df39-442f-937c-03b20bcafc2d", + title: "Building the Building the Future of NFTs: The Rarible Protocol", + description: + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", status: ProposalStatus.active, votesYes: 2700, votesNo: 1400, votesTotal: 4100, createdAt: new Date(), deadlineAt: new Date(), - creator: 'Andrzej' - }, { - id: '599ca521-df39-442f-937c-03b20bcafc2d', + creator: "Andrzej", + }, + { + id: "599ca521-df39-442f-937c-03b20bcafc2d", - title: 'Building the Building the Future of NFTs: The Rarible Protocol', - description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', + title: "Building the Building the Future of NFTs: The Rarible Protocol", + description: + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", status: ProposalStatus.active, votesYes: 2700, votesNo: 1400, votesTotal: 4100, createdAt: new Date(), deadlineAt: new Date(), - creator: 'Andrzej' - }, { - id: '599ca521-df39-442f-937c-03b20bcafc2d', - title: 'Building the Building the Future of NFTs: The Rarible Protocol', - description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', + creator: "Andrzej", + }, + { + id: "599ca521-df39-442f-937c-03b20bcafc2d", + title: "Building the Building the Future of NFTs: The Rarible Protocol", + description: + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", status: ProposalStatus.active, votesYes: 2700, votesNo: 1400, votesTotal: 4100, createdAt: new Date(), deadlineAt: new Date(), - creator: 'Andrzej' - }, { - id: '599ca521-df39-442f-937c-03b20bcafc2d', - title: 'Building the Building the Future of NFTs: The Rarible Protocol', - description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', + creator: "Andrzej", + }, + { + id: "599ca521-df39-442f-937c-03b20bcafc2d", + title: "Building the Building the Future of NFTs: The Rarible Protocol", + description: + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", status: ProposalStatus.active, votesYes: 2700, votesNo: 1400, votesTotal: 4100, createdAt: new Date(), deadlineAt: new Date(), - creator: 'Andrzej' - }, { - id: '599ca521-df39-442f-937c-03b20bcafc2d', - title: 'Building the Building the Future of NFTs: The Rarible Protocol', - description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', + creator: "Andrzej", + }, + { + id: "599ca521-df39-442f-937c-03b20bcafc2d", + title: "Building the Building the Future of NFTs: The Rarible Protocol", + description: + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", status: ProposalStatus.active, votesYes: 2700, votesNo: 1400, votesTotal: 4100, createdAt: new Date(), deadlineAt: new Date(), - creator: 'Andrzej' - }, { - id: '599ca521-df39-442f-937c-03b20bcafc2d', + creator: "Andrzej", + }, + { + id: "599ca521-df39-442f-937c-03b20bcafc2d", - title: 'Building the Building the Future of NFTs: The Rarible Protocol', - description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', + title: "Building the Building the Future of NFTs: The Rarible Protocol", + description: + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", status: ProposalStatus.active, votesYes: 2700, votesNo: 1400, votesTotal: 4100, createdAt: new Date(), deadlineAt: new Date(), - creator: 'Andrzej' - }, { - id: '599ca521-df39-442f-937c-03b20bcafc2d', - title: 'Building the Building the Future of NFTs: The Rarible Protocol', - description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', + creator: "Andrzej", + }, + { + id: "599ca521-df39-442f-937c-03b20bcafc2d", + title: "Building the Building the Future of NFTs: The Rarible Protocol", + description: + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", status: ProposalStatus.active, votesYes: 2700, votesNo: 1400, votesTotal: 4100, createdAt: new Date(), deadlineAt: new Date(), - creator: 'Andrzej' - }, { - id: '599ca521-df39-442f-937c-03b20bcafc2d', - title: 'Building the Building the Future of NFTs: The Rarible Protocol', - description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', + creator: "Andrzej", + }, + { + id: "599ca521-df39-442f-937c-03b20bcafc2d", + title: "Building the Building the Future of NFTs: The Rarible Protocol", + description: + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", status: ProposalStatus.active, votesYes: 2700, votesNo: 1400, votesTotal: 4100, createdAt: new Date(), deadlineAt: new Date(), - creator: 'Andrzej' - }, { - id: '599ca521-df39-442f-937c-03b20bcafc2d', - title: 'Building the Building the Future of NFTs: The Rarible Protocol', - description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', + creator: "Andrzej", + }, + { + id: "599ca521-df39-442f-937c-03b20bcafc2d", + title: "Building the Building the Future of NFTs: The Rarible Protocol", + description: + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", status: ProposalStatus.active, votesYes: 2700, votesNo: 1400, votesTotal: 4100, createdAt: new Date(), deadlineAt: new Date(), - creator: 'Andrzej' - }, { - id: '599ca521-df39-442f-937c-03b20bcafc2d', + creator: "Andrzej", + }, + { + id: "599ca521-df39-442f-937c-03b20bcafc2d", - title: 'Building the Building the Future of NFTs: The Rarible Protocol', - description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', + title: "Building the Building the Future of NFTs: The Rarible Protocol", + description: + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", status: ProposalStatus.active, votesYes: 2700, votesNo: 1400, votesTotal: 4100, createdAt: new Date(), deadlineAt: new Date(), - creator: 'Andrzej' - }, { - id: '599ca521-df39-442f-937c-03b20bcafc2d', - title: 'Building the Building the Future of NFTs: The Rarible Protocol', - description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', + creator: "Andrzej", + }, + { + id: "599ca521-df39-442f-937c-03b20bcafc2d", + title: "Building the Building the Future of NFTs: The Rarible Protocol", + description: + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", status: ProposalStatus.active, votesYes: 2700, votesNo: 1400, votesTotal: 4100, createdAt: new Date(), deadlineAt: new Date(), - creator: 'Andrzej' - }, { - id: '599ca521-df39-442f-937c-03b20bcafc2d', - title: 'Building the Building the Future of NFTs: The Rarible Protocol', - description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', + creator: "Andrzej", + }, + { + id: "599ca521-df39-442f-937c-03b20bcafc2d", + title: "Building the Building the Future of NFTs: The Rarible Protocol", + description: + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", status: ProposalStatus.active, votesYes: 2700, votesNo: 1400, votesTotal: 4100, createdAt: new Date(), deadlineAt: new Date(), - creator: 'Andrzej' + creator: "Andrzej", }, ]; - export async function GET(req: NextRequest) { return Response.json(proposalsMock); } @@ -215,4 +249,4 @@ export async function GET(req: NextRequest) { export async function PUT(req: NextRequest) { const body = await req.json(); return Response.json(proposalsMock); -} \ No newline at end of file +} diff --git a/app/(api)/api/users/[address]/balance/route.ts b/app/(api)/api/users/[address]/balance/route.ts index 8195cee7..941a45e2 100644 --- a/app/(api)/api/users/[address]/balance/route.ts +++ b/app/(api)/api/users/[address]/balance/route.ts @@ -1,50 +1,50 @@ -import {NextRequest} from "next/server"; -import {ILock} from "@interfaces/lock.interface"; -import {addYears} from "date-fns"; +import { NextRequest } from "next/server"; +import { ILock } from "@interfaces/lock.interface"; +import { addYears } from "date-fns"; const locksMock: ILock[] = [ { - owner: '0xabc', - id: '599ca521-df39-442f-937c-03b20bcafc2d', + owner: "0xabc", + id: "599ca521-df39-442f-937c-03b20bcafc2d", amountMNTO: 1500, amountsVeMNTO: 100000, expireDate: addYears(new Date(), 2), }, { - owner: '0xabc', - id: '599ca521-df39-442f-937c-03b20bcafc2a', + owner: "0xabc", + id: "599ca521-df39-442f-937c-03b20bcafc2a", amountMNTO: 500, amountsVeMNTO: 6700, expireDate: addYears(new Date(), 1), }, { - owner: '0xabc', - id: '599ca521-df39-442f-937c-03b20bcafc3d', + owner: "0xabc", + id: "599ca521-df39-442f-937c-03b20bcafc3d", amountMNTO: 200, amountsVeMNTO: 1500, expireDate: addYears(new Date(), 2), }, { - owner: '0xabc', - id: '599ca521-df39-442f-937c-03b20bcafcfd', + owner: "0xabc", + id: "599ca521-df39-442f-937c-03b20bcafcfd", amountMNTO: 1000, amountsVeMNTO: 80000, expireDate: addYears(new Date(), 3), }, -] +]; interface GetMethodContext { params: { address: string; - } + }; } export async function GET(req: NextRequest, { params: { address } }: GetMethodContext) { const data = { walletAddress: address, balanceMENTO: Math.round(Math.random() * 5000), - balanceVeMENTO: locksMock.reduce((acc, lock) => acc + lock.amountsVeMNTO, 0) - } + balanceVeMENTO: locksMock.reduce((acc, lock) => acc + lock.amountsVeMNTO, 0), + }; return Response.json(data); -} \ No newline at end of file +} diff --git a/app/(api)/api/users/[address]/locks/[id]/extend/route.ts b/app/(api)/api/users/[address]/locks/[id]/extend/route.ts index f13a7f35..6cbd902b 100644 --- a/app/(api)/api/users/[address]/locks/[id]/extend/route.ts +++ b/app/(api)/api/users/[address]/locks/[id]/extend/route.ts @@ -1,50 +1,50 @@ -import {NextRequest} from "next/server"; -import {ILock} from "@interfaces/lock.interface"; -import {addYears} from "date-fns"; +import { NextRequest } from "next/server"; +import { ILock } from "@interfaces/lock.interface"; +import { addYears } from "date-fns"; interface PutMethodContext { params: { address: string; id: string; - } + }; } const locksMock: ILock[] = [ { - owner: '0xabc', - id: '599ca521-df39-442f-937c-03b20bcafc2d', + owner: "0xabc", + id: "599ca521-df39-442f-937c-03b20bcafc2d", amountMNTO: 1500, amountsVeMNTO: 100000, expireDate: addYears(new Date(), 2), }, { - owner: '0xabc', - id: '599ca521-df39-442f-937c-03b20bcafc2a', + owner: "0xabc", + id: "599ca521-df39-442f-937c-03b20bcafc2a", amountMNTO: 500, amountsVeMNTO: 6700, expireDate: addYears(new Date(), 1), }, { - owner: '0xabc', - id: '599ca521-df39-442f-937c-03b20bcafc3d', + owner: "0xabc", + id: "599ca521-df39-442f-937c-03b20bcafc3d", amountMNTO: 200, amountsVeMNTO: 1500, expireDate: addYears(new Date(), 2), }, { - owner: '0xabc', - id: '599ca521-df39-442f-937c-03b20bcafcfd', + owner: "0xabc", + id: "599ca521-df39-442f-937c-03b20bcafcfd", amountMNTO: 1000, amountsVeMNTO: 80000, expireDate: addYears(new Date(), 3), }, -] +]; export async function PUT(req: NextRequest, { params: { address, id } }: PutMethodContext) { - const lockToExtend = locksMock.find(lock => lock.id === id); + const lockToExtend = locksMock.find((lock) => lock.id === id); if (!lockToExtend) { return Response.json({ - error: 'Lock not found' + error: "Lock not found", }); } const body = await req.json(); @@ -54,4 +54,4 @@ export async function PUT(req: NextRequest, { params: { address, id } }: PutMeth owner: address, expireDate: new Date(body.date), } as ILock); -} \ No newline at end of file +} diff --git a/app/(api)/api/users/[address]/locks/route.ts b/app/(api)/api/users/[address]/locks/route.ts index 446725c8..37c1c0bb 100644 --- a/app/(api)/api/users/[address]/locks/route.ts +++ b/app/(api)/api/users/[address]/locks/route.ts @@ -1,48 +1,48 @@ -import {NextRequest} from "next/server"; -import {ILock} from "@interfaces/lock.interface"; -import {addYears} from "date-fns"; +import { NextRequest } from "next/server"; +import { ILock } from "@interfaces/lock.interface"; +import { addYears } from "date-fns"; const locksMock: ILock[] = [ { - owner: '0xabc', - id: '599ca521-df39-442f-937c-03b20bcafc2d', + owner: "0xabc", + id: "599ca521-df39-442f-937c-03b20bcafc2d", amountMNTO: 1500, amountsVeMNTO: 100000, expireDate: addYears(new Date(), 2), }, { - owner: '0xabc', - id: '599ca521-df39-442f-937c-03b20bcafc2a', + owner: "0xabc", + id: "599ca521-df39-442f-937c-03b20bcafc2a", amountMNTO: 500, amountsVeMNTO: 6700, expireDate: addYears(new Date(), 1), }, { - owner: '0xabc', - id: '599ca521-df39-442f-937c-03b20bcafc3d', + owner: "0xabc", + id: "599ca521-df39-442f-937c-03b20bcafc3d", amountMNTO: 200, amountsVeMNTO: 1500, expireDate: addYears(new Date(), 2), }, { - owner: '0xabc', - id: '599ca521-df39-442f-937c-03b20bcafcfd', + owner: "0xabc", + id: "599ca521-df39-442f-937c-03b20bcafcfd", amountMNTO: 1000, amountsVeMNTO: 80000, expireDate: addYears(new Date(), 3), }, -] +]; interface GetMethodContext { params: { address: string; - } + }; } interface PutMethodContext { params: { address: string; - } + }; } export async function GET(req: NextRequest, { params: { address } }: GetMethodContext) { @@ -53,6 +53,6 @@ export async function PUT(req: NextRequest, { params: { address } }: PutMethodCo const body = await req.json(); return Response.json({ owner: address, - ...body + ...body, } as ILock); -} \ No newline at end of file +} diff --git a/app/(routes)/create-proposal/page.tsx b/app/(routes)/create-proposal/page.tsx index 81bf0a6a..3383eae5 100644 --- a/app/(routes)/create-proposal/page.tsx +++ b/app/(routes)/create-proposal/page.tsx @@ -4,28 +4,29 @@ import { CreateProposalExecutionStep, CreateProposalContentStep, CreateProposalWalletStep, - CreateProposalPreviewStep + CreateProposalPreviewStep, } from "@components/create-proposal"; -import {useEffect} from "react"; -import {useCreateProposalStore} from "@/app/store"; +import { useEffect } from "react"; +import { useCreateProposalStore } from "@/app/store"; const Page = () => { - - const {reset} = useCreateProposalStore(); + const { reset } = useCreateProposalStore(); useEffect(() => { reset(); }, []); - return
-

Create a Proposal

-
- - - - -
-
-} + return ( +
+

Create a Proposal

+
+ + + + +
+
+ ); +}; -export default Page; \ No newline at end of file +export default Page; diff --git a/app/(routes)/layout.tsx b/app/(routes)/layout.tsx index bcdefb3b..b8a9d959 100644 --- a/app/(routes)/layout.tsx +++ b/app/(routes)/layout.tsx @@ -1,39 +1,39 @@ "use client"; -import '../globals.scss'; -import '@rainbow-me/rainbowkit/styles.css'; -import {Inter} from 'next/font/google'; -import {Footer, Header, Breadcrumbs} from "@components/_shared"; -import React, {ReactNode} from "react"; -import {Providers} from "@/app/(routes)/providers"; -import {ModalProvider} from "@/app/providers/modal.provider"; -import {usePathname} from 'next/navigation'; +import "../globals.scss"; +import "@rainbow-me/rainbowkit/styles.css"; +import { Inter } from "next/font/google"; +import { Footer, Header, Breadcrumbs } from "@components/_shared"; +import React, { ReactNode } from "react"; +import { Providers } from "@/app/(routes)/providers"; +import { ModalProvider } from "@/app/providers/modal.provider"; +import { usePathname } from "next/navigation"; -const inter = Inter({subsets: ['latin']}) +const inter = Inter({ subsets: ["latin"] }); interface RootLayoutProps { children: ReactNode; } -export default function RootLayout({children}: RootLayoutProps) { +export default function RootLayout({ children }: RootLayoutProps) { const path = usePathname(); - const homePage = path === '/'; + const homePage = path === "/"; return ( - + - - -
-
-
- {!homePage && } - {children} + + +
+
+
+ {!homePage && } + {children} +
+
-
-
- - + + - - ) + + ); } diff --git a/app/(routes)/my-voting-power/page.tsx b/app/(routes)/my-voting-power/page.tsx index eb09b77e..450f9105 100644 --- a/app/(routes)/my-voting-power/page.tsx +++ b/app/(routes)/my-voting-power/page.tsx @@ -1,24 +1,23 @@ "use client"; -import {Card, MntoLock} from "@components/_shared"; -import {LocksList} from "@components/locks-list/locks-list.component"; +import { Card, MntoLock } from "@components/_shared"; +import { LocksList } from "@components/locks-list/locks-list.component"; const Page = () => { - - return
-

My Voting Power

- -
- -
- TODO: Chart + return ( +
+

My Voting Power

+ +
+ +
TODO: Chart
-
- -

My Locks

- - - -
-} + +

My Locks

+ + + + + ); +}; -export default Page; \ No newline at end of file +export default Page; diff --git a/app/(routes)/page.tsx b/app/(routes)/page.tsx index 70b2e769..7b4da01c 100644 --- a/app/(routes)/page.tsx +++ b/app/(routes)/page.tsx @@ -1,23 +1,25 @@ "use client"; -import {MentoIcon} from "@components/_icons/mento.icon"; -import {MentoTextLogoIcon, CeloLogoIcon} from "@components/_icons"; -import {Badge, Button, Card, Divider, DropdownButton, Expandable} from "@components/_shared"; -import {ProposalsListComponent} from "@components/proposals-list/proposals-list.component"; +import { MentoIcon } from "@components/_icons/mento.icon"; +import { MentoTextLogoIcon, CeloLogoIcon } from "@components/_icons"; +import { Badge, Button, Card, Divider, DropdownButton, Expandable } from "@components/_shared"; +import { ProposalsListComponent } from "@components/proposals-list/proposals-list.component"; import NumbersService from "@/app/helpers/numbers.service"; -import {ContractParams} from "@components/contract-params/contract-params.component"; -import {useRouter} from "next/navigation"; -import {useUserStore} from "@/app/store"; +import { ContractParams } from "@components/contract-params/contract-params.component"; +import { useRouter } from "next/navigation"; +import { useUserStore } from "@/app/store"; const Page = () => { const router = useRouter(); - const {walletAddress} = useUserStore(); + const { walletAddress } = useUserStore(); return (
-

Claim your part and participate in
shaping the future - of digital assets

+

+ Claim your part and participate in +
shaping the future of digital assets +

@@ -36,10 +38,10 @@ const Page = () => {
- router.push('/create-proposal')}> + router.push("/create-proposal")}> Create new proposal - router.push('/my-voting-power')}> + router.push("/my-voting-power")}> My voting power @@ -47,17 +49,22 @@ const Page = () => {
-

Transparent Digital Asset Solutions

- -  CELO - ERC20 - {(9999999998).toLocaleString()} Supply + + +  CELO + + + ERC20 + + + {(9999999998).toLocaleString()} Supply +
- + @@ -73,20 +80,27 @@ const Page = () => {
Active proposals
-
{NumbersService.parseNumericValue(2097, 3)}
+
+ {NumbersService.parseNumericValue(2097, 3)} +
Voters
-
{NumbersService.parseNumericValue(120340, 3)}
-
Total veMento
Voting Power
+
+ {NumbersService.parseNumericValue(120340, 3)} +
+
+ Total veMento +
+ Voting Power +
- ) -} - + ); +}; -export default Page; \ No newline at end of file +export default Page; diff --git a/app/(routes)/proposals/[id]/page.tsx b/app/(routes)/proposals/[id]/page.tsx index be622011..429ee179 100644 --- a/app/(routes)/proposals/[id]/page.tsx +++ b/app/(routes)/proposals/[id]/page.tsx @@ -1,44 +1,42 @@ "use client"; -import {statusToBadgeColorMap} from "@interfaces/proposal.interface"; -import {Avatar, Badge, Button, Card, Input, Loader, TabList, WalletAddressWithCopy} from "@components/_shared"; -import {Countdown} from "@components/countdown/countdown.component"; -import {format} from "date-fns"; -import {useForm} from "react-hook-form"; +import { statusToBadgeColorMap } from "@interfaces/proposal.interface"; +import { Avatar, Badge, Button, Card, Input, Loader, TabList, WalletAddressWithCopy } from "@components/_shared"; +import { Countdown } from "@components/countdown/countdown.component"; +import { format } from "date-fns"; +import { useForm } from "react-hook-form"; import styles from "./page.module.scss"; -import {InferType, number, object, setLocale} from "yup"; -import {yupResolver} from "@hookform/resolvers/yup"; -import {VotesList} from "@components/votes-list/votes-list.component"; +import { InferType, number, object, setLocale } from "yup"; +import { yupResolver } from "@hookform/resolvers/yup"; +import { VotesList } from "@components/votes-list/votes-list.component"; import classNames from "classnames"; -import {useEffect, useState} from "react"; -import {MarkdownView} from "@/app/components/_shared/markdown-view/markdown-view.component"; +import { useEffect, useState } from "react"; +import { MarkdownView } from "@/app/components/_shared/markdown-view/markdown-view.component"; import useModal from "@/app/providers/modal.provider"; -import {IVoteType} from "@interfaces/vote.interface"; -import {useProposalDetailsStore, useUserStore} from "@/app/store"; +import { IVoteType } from "@interfaces/vote.interface"; +import { useProposalDetailsStore, useUserStore } from "@/app/store"; const validationSchema = object({ - votingPower: number().required().typeError('Invalid number').max(400) + votingPower: number().required().typeError("Invalid number").max(400), }); -type FormData = InferType +type FormData = InferType; const voteTypeToModalType = (voteType: IVoteType) => { switch (voteType) { - case 'for': - return 'success'; - case 'against': - return 'error'; - case 'abstain': + case "for": + return "success"; + case "against": + return "error"; + case "abstain": default: - return 'info'; + return "info"; } -} +}; -const Page = ({params}: { params: { id: string } }) => { - - const {showConfirm, showModal} = useModal(); - - const {proposal, isFetching, fetch, vote} = useProposalDetailsStore(); - const {walletAddress, balanceVeMENTO} = useUserStore(); +const Page = ({ params }: { params: { id: string } }) => { + const { showConfirm, showModal } = useModal(); + const { proposal, isFetching, fetch, vote } = useProposalDetailsStore(); + const { walletAddress, balanceVeMENTO } = useUserStore(); useEffect(() => { fetch(params.id); @@ -46,150 +44,204 @@ const Page = ({params}: { params: { id: string } }) => { setLocale({ mixed: { - default: 'Invalid number', + default: "Invalid number", }, number: { - max: ({max}) => (`Must not exceed ${max}`), + max: ({ max }) => `Must not exceed ${max}`, }, }); const [votingOpened, setVotingOpened] = useState(false); const [votesListOpened, setVotesListOpened] = useState(false); - const {register, handleSubmit, setValue, formState: {errors, isValid}} = useForm({ + const { + register, + handleSubmit, + setValue, + formState: { errors, isValid }, + } = useForm({ resolver: yupResolver(validationSchema), - mode: 'all' + mode: "all", }); const onSubmit = (data: FormData, voteType: IVoteType) => { - showConfirm(`Are you sure you want to vote with ${data.votingPower} power?`, { modalType: voteTypeToModalType(voteType), }).then((result) => { if (result) { - setValue('votingPower', 0); - vote(voteType, data.votingPower, 'xD'); + setValue("votingPower", 0); + vote(voteType, data.votingPower, "xD"); } }); }; - return
- {isFetching && } - {!isFetching && !proposal &&
Proposal not found
} - {!isFetching && proposal && <> - {proposal.status.toString()} -
-
-

{proposal.title}

-
-
- -
-
-
-
- -
by {proposal.creator}
-
-
- ID - -
-
- Proposed on: - {format(proposal.createdAt, 'MMMM do, yyyy')} -
-
- Voting deadline: - {format(proposal.deadlineAt, 'MMMM do, yyyy')} -
-
- -
-
-

Details

- -
-
-
- - + return ( +
+ {isFetching && } + {!isFetching && !proposal &&
Proposal not found
} + {!isFetching && proposal && ( + <> + + {proposal.status.toString()} + +
+
+

{proposal.title}

+
+
+ +
-
- - - Voting - - -
- -
- { - !!walletAddress ? <> -
Max available
-
{balanceVeMENTO} MENT
- :
Please connect wallet
- } -
-
}/> -

Vote

- - -
- -
-
- - - Votes - - - - - - - - +
+ + + Voting + + +
+ +
+ {!!walletAddress ? ( + <> +
Max available
+
{balanceVeMENTO} MENT
+ + ) : ( +
Please connect wallet
+ )} +
+
+ } + /> +

Vote

+ + + +
+ +
+
+ + + Votes + + + + + + + + +
+
- - - } -
-} + + )} + + ); +}; -export default Page; \ No newline at end of file +export default Page; diff --git a/app/(routes)/providers.tsx b/app/(routes)/providers.tsx index 25f78d86..08210858 100644 --- a/app/(routes)/providers.tsx +++ b/app/(routes)/providers.tsx @@ -1,20 +1,18 @@ -import {configureChains, createConfig, WagmiConfig} from 'wagmi'; -import {Alfajores, Baklava, Celo} from '@celo/rainbowkit-celo/chains' -import {jsonRpcProvider} from 'wagmi/providers/jsonRpc' -import {connectorsForWallets, RainbowKitProvider} from "@rainbow-me/rainbowkit"; -import {getWalletConnectors} from "@/app/helpers/wallet"; -import {ReactNode, useEffect, useState} from "react"; +import { configureChains, createConfig, WagmiConfig } from "wagmi"; +import { Alfajores, Baklava, Celo } from "@celo/rainbowkit-celo/chains"; +import { jsonRpcProvider } from "wagmi/providers/jsonRpc"; +import { connectorsForWallets, RainbowKitProvider } from "@rainbow-me/rainbowkit"; +import { getWalletConnectors } from "@/app/helpers/wallet"; +import { ReactNode, useEffect, useState } from "react"; -const {chains, publicClient} = configureChains( +const { chains, publicClient } = configureChains( [Alfajores, Baklava, Celo], - [ - jsonRpcProvider({rpc: (chain: any) => ({http: chain.rpcUrls.default.http[0]})}) - ] + [jsonRpcProvider({ rpc: (chain: any) => ({ http: chain.rpcUrls.default.http[0] }) })], ); const connectors = connectorsForWallets([ { - groupName: 'Recommended for Celo chains', + groupName: "Recommended for Celo chains", wallets: getWalletConnectors(chains), }, ]); @@ -22,17 +20,15 @@ const connectors = connectorsForWallets([ const wagmiConfig = createConfig({ autoConnect: true, connectors, - publicClient -}) + publicClient, +}); -export function Providers({children}: { children: ReactNode }) { +export function Providers({ children }: { children: ReactNode }) { const [mounted, setMounted] = useState(false); useEffect(() => setMounted(true), []); return ( - - {mounted && children} - + {mounted && children} ); -} \ No newline at end of file +} diff --git a/app/components/_icons/celo-logo.icon.tsx b/app/components/_icons/celo-logo.icon.tsx index e88ba12f..7bd1e167 100644 --- a/app/components/_icons/celo-logo.icon.tsx +++ b/app/components/_icons/celo-logo.icon.tsx @@ -1,22 +1,31 @@ import BaseIconProps from "@interfaces/base-icon-props.interface"; -import exports from '@styles/exports.module.scss'; +import exports from "@styles/exports.module.scss"; export const CeloLogoIcon = ({ width = 23, height = 23, color = exports.black, - backgroundColor = "#FCFF52" + backgroundColor = "#FCFF52", }: BaseIconProps) => { - return - - - - - - - - - - -} \ No newline at end of file + return ( + + + + + + + + + + + + ); +}; diff --git a/app/components/_icons/chevron.icon.tsx b/app/components/_icons/chevron.icon.tsx index 82a91852..5572d3e3 100644 --- a/app/components/_icons/chevron.icon.tsx +++ b/app/components/_icons/chevron.icon.tsx @@ -1,45 +1,51 @@ import BaseIconProps from "@interfaces/base-icon-props.interface"; -import exports from '@styles/exports.module.scss'; +import exports from "@styles/exports.module.scss"; import classNames from "classnames"; interface ChevronIconProps extends BaseIconProps { - direction?: 'up' | 'down' | 'left' | 'right'; + direction?: "up" | "down" | "left" | "right"; } export const ChevronIcon = ({ - width = 5, - height = 10, - color = exports.black, - direction, - useThemeColor, - className, - style - }: ChevronIconProps) => { - - let transform = 'rotate(0deg)'; + width = 5, + height = 10, + color = exports.black, + direction, + useThemeColor, + className, + style, +}: ChevronIconProps) => { + let transform = "rotate(0deg)"; switch (direction) { - case 'up': - transform = 'rotate(270deg)'; + case "up": + transform = "rotate(270deg)"; break; - case 'down': - transform = 'rotate(90deg)'; + case "down": + transform = "rotate(90deg)"; break; - case 'left': - transform = 'rotate(180deg)'; + case "left": + transform = "rotate(180deg)"; break; - case 'right': - transform = 'rotate(0deg)'; + case "right": + transform = "rotate(0deg)"; break; } - return - - -} \ No newline at end of file + return ( + + + + ); +}; diff --git a/app/components/_icons/copy.icon.tsx b/app/components/_icons/copy.icon.tsx index a79c603f..cf417386 100644 --- a/app/components/_icons/copy.icon.tsx +++ b/app/components/_icons/copy.icon.tsx @@ -1,14 +1,23 @@ import BaseIconProps from "@interfaces/base-icon-props.interface"; -import exports from '@styles/exports.module.scss'; +import exports from "@styles/exports.module.scss"; -export const CopyIcon = ({ - width = 24, - height = 29, - color = exports.lightGrey -}: BaseIconProps) => { - return - - - -} \ No newline at end of file +export const CopyIcon = ({ width = 24, height = 29, color = exports.lightGrey }: BaseIconProps) => { + return ( + + + + + ); +}; diff --git a/app/components/_icons/dark-mode.icon.tsx b/app/components/_icons/dark-mode.icon.tsx index 45a0626f..bb3b9a06 100644 --- a/app/components/_icons/dark-mode.icon.tsx +++ b/app/components/_icons/dark-mode.icon.tsx @@ -1,12 +1,16 @@ import BaseIconProps from "@interfaces/base-icon-props.interface"; -import exports from '@styles/exports.module.scss'; +import exports from "@styles/exports.module.scss"; -export const DarkModeIcon = ({ - width = 13, - height = 13, - color = exports.black, -}: BaseIconProps) => { - return - - -} \ No newline at end of file +export const DarkModeIcon = ({ width = 13, height = 13, color = exports.black }: BaseIconProps) => { + return ( + + + + ); +}; diff --git a/app/components/_icons/discord.icon.tsx b/app/components/_icons/discord.icon.tsx index 0fc5b1fc..df4e9700 100644 --- a/app/components/_icons/discord.icon.tsx +++ b/app/components/_icons/discord.icon.tsx @@ -1,21 +1,29 @@ import BaseIconProps from "@interfaces/base-icon-props.interface"; -import exports from '@styles/exports.module.scss'; +import exports from "@styles/exports.module.scss"; import classNames from "classnames"; export const DiscordIcon = ({ - width = 20, - height = 16, - color = exports.black, - useThemeColor = true, - className, - style - }: BaseIconProps) => { - - return - - ; -} \ No newline at end of file + width = 20, + height = 16, + color = exports.black, + useThemeColor = true, + className, + style, +}: BaseIconProps) => { + return ( + + + + ); +}; diff --git a/app/components/_icons/github.icon.tsx b/app/components/_icons/github.icon.tsx index 12aaaef7..c982313a 100644 --- a/app/components/_icons/github.icon.tsx +++ b/app/components/_icons/github.icon.tsx @@ -1,22 +1,29 @@ import BaseIconProps from "@interfaces/base-icon-props.interface"; -import exports from '@styles/exports.module.scss'; +import exports from "@styles/exports.module.scss"; import classNames from "classnames"; export const GithubIcon = ({ - width = 20, - height = 20, - color = exports.black, - useThemeColor = true, - className, - style - }: BaseIconProps) => { - - return - - ; - - -} \ No newline at end of file + width = 20, + height = 20, + color = exports.black, + useThemeColor = true, + className, + style, +}: BaseIconProps) => { + return ( + + + + ); +}; diff --git a/app/components/_icons/index.tsx b/app/components/_icons/index.tsx index 5fc18cfc..0434c05e 100644 --- a/app/components/_icons/index.tsx +++ b/app/components/_icons/index.tsx @@ -1,11 +1,11 @@ -export { MentoLogoIcon } from './mento-logo.icon'; -export { ChevronIcon } from './chevron.icon'; -export { MentoIcon } from './mento.icon'; -export { MentoTextLogoIcon } from './mento-text-logo.icon'; -export { TwitterIcon } from './twitter.icon'; -export { DiscordIcon } from './discord.icon'; -export { GithubIcon } from './github.icon'; -export { LightModeIcon } from './light-mode.icon'; -export { DarkModeIcon } from './dark-mode.icon'; -export { LearnMoreIcon } from './learn-more.icon'; -export { CeloLogoIcon } from './celo-logo.icon'; +export { MentoLogoIcon } from "./mento-logo.icon"; +export { ChevronIcon } from "./chevron.icon"; +export { MentoIcon } from "./mento.icon"; +export { MentoTextLogoIcon } from "./mento-text-logo.icon"; +export { TwitterIcon } from "./twitter.icon"; +export { DiscordIcon } from "./discord.icon"; +export { GithubIcon } from "./github.icon"; +export { LightModeIcon } from "./light-mode.icon"; +export { DarkModeIcon } from "./dark-mode.icon"; +export { LearnMoreIcon } from "./learn-more.icon"; +export { CeloLogoIcon } from "./celo-logo.icon"; diff --git a/app/components/_icons/learn-more.icon.tsx b/app/components/_icons/learn-more.icon.tsx index a9a4ee5d..7986b764 100644 --- a/app/components/_icons/learn-more.icon.tsx +++ b/app/components/_icons/learn-more.icon.tsx @@ -1,106 +1,456 @@ import BaseIconProps from "@interfaces/base-icon-props.interface"; -export const LearnMoreIcon = ({ - width = 397, - height = 315 -}: BaseIconProps) => { - return - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -} \ No newline at end of file +export const LearnMoreIcon = ({ width = 397, height = 315 }: BaseIconProps) => { + return ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); +}; diff --git a/app/components/_icons/light-mode.icon.tsx b/app/components/_icons/light-mode.icon.tsx index ffb698ae..6fa89ad5 100644 --- a/app/components/_icons/light-mode.icon.tsx +++ b/app/components/_icons/light-mode.icon.tsx @@ -1,14 +1,18 @@ import BaseIconProps from "@interfaces/base-icon-props.interface"; -import exports from '@styles/exports.module.scss'; +import exports from "@styles/exports.module.scss"; -export const LightModeIcon = ({ - width = 13, - height = 13, - color = exports.black, -}: BaseIconProps) => { - return - - - - -} \ No newline at end of file +export const LightModeIcon = ({ width = 13, height = 13, color = exports.black }: BaseIconProps) => { + return ( + + + + + + ); +}; diff --git a/app/components/_icons/mento-logo.icon.tsx b/app/components/_icons/mento-logo.icon.tsx index 0218ed97..d1a05712 100644 --- a/app/components/_icons/mento-logo.icon.tsx +++ b/app/components/_icons/mento-logo.icon.tsx @@ -1,5 +1,5 @@ import BaseIconProps from "@interfaces/base-icon-props.interface"; -import exports from '@styles/exports.module.scss'; +import exports from "@styles/exports.module.scss"; import classNames from "classnames"; export const MentoLogoIcon = ({ @@ -8,13 +8,36 @@ export const MentoLogoIcon = ({ color = exports.black, useThemeColor = false, className, - style + style, }: BaseIconProps) => { - return - - - - - -} \ No newline at end of file + return ( + + + + + + + ); +}; diff --git a/app/components/_icons/mento-text-logo.icon.tsx b/app/components/_icons/mento-text-logo.icon.tsx index 24a25429..cb6c59c4 100644 --- a/app/components/_icons/mento-text-logo.icon.tsx +++ b/app/components/_icons/mento-text-logo.icon.tsx @@ -1,23 +1,33 @@ import BaseIconProps from "@interfaces/base-icon-props.interface"; -import exports from '@styles/exports.module.scss'; +import exports from "@styles/exports.module.scss"; import classNames from "classnames"; export const MentoTextLogoIcon = ({ - width = 554, - height = 38, - color = exports.black, - useThemeColor, - className, - style - }: BaseIconProps) => { - return - - - -} \ No newline at end of file + width = 554, + height = 38, + color = exports.black, + useThemeColor, + className, + style, +}: BaseIconProps) => { + return ( + + + + + ); +}; diff --git a/app/components/_icons/mento.icon.tsx b/app/components/_icons/mento.icon.tsx index 34bf27b0..bc020c5b 100644 --- a/app/components/_icons/mento.icon.tsx +++ b/app/components/_icons/mento.icon.tsx @@ -1,24 +1,33 @@ import BaseIconProps from "@interfaces/base-icon-props.interface"; -import exports from '@styles/exports.module.scss'; +import exports from "@styles/exports.module.scss"; interface MentoIconProps extends BaseIconProps { backgroundColor?: string; } export const MentoIcon = ({ - width = 60, - height = 60, - color = exports.black, - backgroundColor = exports.success, - className, - style - }: MentoIconProps) => { - return - - - - -} \ No newline at end of file + width = 60, + height = 60, + color = exports.black, + backgroundColor = exports.success, + className, + style, +}: MentoIconProps) => { + return ( + + + + + ); +}; diff --git a/app/components/_icons/twitter.icon.tsx b/app/components/_icons/twitter.icon.tsx index 2bd57b33..ed803c94 100644 --- a/app/components/_icons/twitter.icon.tsx +++ b/app/components/_icons/twitter.icon.tsx @@ -1,5 +1,5 @@ import BaseIconProps from "@interfaces/base-icon-props.interface"; -import exports from '@styles/exports.module.scss'; +import exports from "@styles/exports.module.scss"; import classNames from "classnames"; export const TwitterIcon = ({ @@ -8,13 +8,23 @@ export const TwitterIcon = ({ color = exports.black, useThemeColor = true, className, - style + style, }: BaseIconProps) => { - - return - - - - -} \ No newline at end of file + return ( + + + + + ); +}; diff --git a/app/components/_shared/avatar/avatar.component.tsx b/app/components/_shared/avatar/avatar.component.tsx index ef2d3ca8..ff8317ad 100644 --- a/app/components/_shared/avatar/avatar.component.tsx +++ b/app/components/_shared/avatar/avatar.component.tsx @@ -1,19 +1,24 @@ import styles from "./avatar.module.scss"; import classNames from "classnames"; import BaseComponentProps from "@interfaces/base-component-props.interface"; -import {create} from "ethereum-blockies"; +import { create } from "ethereum-blockies"; interface AvatarProps extends BaseComponentProps { address: string; } -export const Avatar = ({className, style, address}: AvatarProps) => { - return
- {`Avatar -
- -} \ No newline at end of file +export const Avatar = ({ className, style, address }: AvatarProps) => { + return ( +
+ {`Avatar +
+ ); +}; diff --git a/app/components/_shared/badge/badge.component.tsx b/app/components/_shared/badge/badge.component.tsx index b6ff6c23..91f2add0 100644 --- a/app/components/_shared/badge/badge.component.tsx +++ b/app/components/_shared/badge/badge.component.tsx @@ -1,8 +1,8 @@ import classNames from "classnames"; -import styles from './badge.module.scss'; +import styles from "./badge.module.scss"; import BaseComponentProps from "@interfaces/base-component-props.interface"; -import {BadgeType} from "@/app/types"; -import {ReactNode} from "react"; +import { BadgeType } from "@/app/types"; +import { ReactNode } from "react"; interface BadgeProps extends BaseComponentProps { children: ReactNode; type: BadgeType; @@ -10,10 +10,19 @@ interface BadgeProps extends BaseComponentProps { block?: boolean; } -export const Badge = ({children, type, block = false, rounded = false, className, style}: BadgeProps) => { - return
- {children} -
-} \ No newline at end of file +export const Badge = ({ children, type, block = false, rounded = false, className, style }: BadgeProps) => { + return ( +
+ {children} +
+ ); +}; diff --git a/app/components/_shared/breadcrumbs/breadcrumbs.component.tsx b/app/components/_shared/breadcrumbs/breadcrumbs.component.tsx index 82dcd935..65f38024 100644 --- a/app/components/_shared/breadcrumbs/breadcrumbs.component.tsx +++ b/app/components/_shared/breadcrumbs/breadcrumbs.component.tsx @@ -12,24 +12,18 @@ type CrumbProps = { const Crumb = ({ path, index, last }: CrumbProps) => { const pathName = routingMap[path]; - + return (
  • {index > 0 && pathName && {">"}} - {last ? ( - {pathName} - ) : ( - - {pathName} - - )} + {last ? {pathName} : {pathName}}
  • ); }; export const Breadcrumbs = () => { const paths = usePathname().split("/"); - const crumbPaths = useMemo(() => paths.filter(path => routingMap[path]), [paths]); + const crumbPaths = useMemo(() => paths.filter((path) => routingMap[path]), [paths]); return (