diff --git a/package-lock.json b/package-lock.json index a2a4a56dc..5d35c8119 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "0.1.0", "dependencies": { "@svgr/webpack": "^8.1.0", + "axios": "^1.7.9", "dayjs": "^1.11.13", "next": "14.2.23", "react": "^18", @@ -1874,6 +1875,7 @@ "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "license": "MIT", + "engines": { "node": ">=6.0.0" } @@ -2038,6 +2040,253 @@ "node": ">= 10" } }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nolyfill/is-core-module": { + "version": "1.0.39", + "resolved": "https://registry.npmjs.org/@nolyfill/is-core-module/-/is-core-module-1.0.39.tgz", + "integrity": "sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.4.0" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@rtsao/scc": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", + "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==", + "dev": true, + "license": "MIT" + }, + "node_modules/@rushstack/eslint-patch": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.10.5.tgz", + "integrity": "sha512-kkKUDVlII2DQiKy7UstOR1ErJP8kUKAQ4oa+SQtM0K+lPdmmjj0YnnxBgtTVYH7mUKtbsxeFC9y0AmK7Yb78/A==", + "dev": true, + "license": "MIT" + }, + "node_modules/@svgr/babel-plugin-add-jsx-attribute": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-add-jsx-attribute/-/babel-plugin-add-jsx-attribute-8.0.0.tgz", + "integrity": "sha512-b9MIk7yhdS1pMCZM8VeNfUlSKVRhsHZNMl5O9SfaX0l0t5wjdgu4IDzGB8bpnGBBOjGST3rRFVsaaEtI4W6f7g==", + "license": "MIT", + "engines": { + "node": ">=14" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@svgr/babel-plugin-remove-jsx-attribute": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-remove-jsx-attribute/-/babel-plugin-remove-jsx-attribute-8.0.0.tgz", + "integrity": "sha512-BcCkm/STipKvbCl6b7QFrMh/vx00vIP63k2eM66MfHJzPr6O2U0jYEViXkHJWqXqQYjdeA9cuCl5KWmlwjDvbA==", + "license": "MIT", + "engines": { + "node": ">=14" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@svgr/babel-plugin-remove-jsx-empty-expression": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-remove-jsx-empty-expression/-/babel-plugin-remove-jsx-empty-expression-8.0.0.tgz", + "integrity": "sha512-5BcGCBfBxB5+XSDSWnhTThfI9jcO5f0Ai2V24gZpG+wXF14BzwxxdDb4g6trdOux0rhibGs385BeFMSmxtS3uA==", + "license": "MIT", + "engines": { + "node": ">=14" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@svgr/babel-plugin-replace-jsx-attribute-value": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-replace-jsx-attribute-value/-/babel-plugin-replace-jsx-attribute-value-8.0.0.tgz", + "integrity": "sha512-KVQ+PtIjb1BuYT3ht8M5KbzWBhdAjjUPdlMtpuw/VjT8coTrItWX6Qafl9+ji831JaJcu6PJNKCV0bp01lBNzQ==", + "license": "MIT", + "engines": { + "node": ">=14" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@svgr/babel-plugin-svg-dynamic-title": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-svg-dynamic-title/-/babel-plugin-svg-dynamic-title-8.0.0.tgz", + "integrity": "sha512-omNiKqwjNmOQJ2v6ge4SErBbkooV2aAWwaPFs2vUY7p7GhVkzRkJ00kILXQvRhA6miHnNpXv7MRnnSjdRjK8og==", + "license": "MIT", + "engines": { + "node": ">=14" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@svgr/babel-plugin-svg-em-dimensions": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-svg-em-dimensions/-/babel-plugin-svg-em-dimensions-8.0.0.tgz", + "integrity": "sha512-mURHYnu6Iw3UBTbhGwE/vsngtCIbHE43xCRK7kCw4t01xyGqb2Pd+WXekRRoFOBIY29ZoOhUCTEweDMdrjfi9g==", + "license": "MIT", + "engines": { + "node": ">=14" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@svgr/babel-plugin-transform-react-native-svg": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-transform-react-native-svg/-/babel-plugin-transform-react-native-svg-8.1.0.tgz", + "integrity": "sha512-Tx8T58CHo+7nwJ+EhUwx3LfdNSG9R2OKfaIXXs5soiy5HtgoAEkDay9LIimLOcG8dJQH1wPZp/cnAv6S9CrR1Q==", + "license": "MIT", + "engines": { + "node": ">=14" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@svgr/babel-plugin-transform-svg-component": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-transform-svg-component/-/babel-plugin-transform-svg-component-8.0.0.tgz", + "integrity": "sha512-DFx8xa3cZXTdb/k3kfPeaixecQLgKh5NVBMwD0AQxOzcZawK4oo1Jh9LbrcACUivsCA7TLG8eeWgrDXjTMhRmw==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@svgr/babel-preset": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-preset/-/babel-preset-8.1.0.tgz", + "integrity": "sha512-7EYDbHE7MxHpv4sxvnVPngw5fuR6pw79SkcrILHJ/iMpuKySNCl5W1qcwPEpU+LgyRXOaAFgH0KhwD18wwg6ug==", + "license": "MIT", + "dependencies": { + "@svgr/babel-plugin-add-jsx-attribute": "8.0.0", + "@svgr/babel-plugin-remove-jsx-attribute": "8.0.0", + "@svgr/babel-plugin-remove-jsx-empty-expression": "8.0.0", + "@svgr/babel-plugin-replace-jsx-attribute-value": "8.0.0", + "@svgr/babel-plugin-svg-dynamic-title": "8.0.0", + "@svgr/babel-plugin-svg-em-dimensions": "8.0.0", + "@svgr/babel-plugin-transform-react-native-svg": "8.1.0", + "@svgr/babel-plugin-transform-svg-component": "8.0.0" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@svgr/core": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@svgr/core/-/core-8.1.0.tgz", + "integrity": "sha512-8QqtOQT5ACVlmsvKOJNEaWmRPmcojMOzCz4Hs2BGG/toAp/K38LcsMRyLp349glq5AzJbCEeimEoxaX6v/fLrA==", + "license": "MIT", + "dependencies": { + "@babel/core": "^7.21.3", + "@svgr/babel-preset": "8.1.0", + "camelcase": "^6.2.0", + "cosmiconfig": "^8.1.3", + "snake-case": "^3.0.4" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + } + }, "node_modules/@next/swc-win32-x64-msvc": { "version": "14.2.23", "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.23.tgz", @@ -2050,8 +2299,13 @@ "os": [ "win32" ], + "engines": { - "node": ">= 10" + "node": ">=14" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" } }, "node_modules/@nodelib/fs.scandir": { @@ -2061,11 +2315,20 @@ "dev": true, "license": "MIT", "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" + "@babel/core": "^7.21.3", + "@svgr/babel-preset": "8.1.0", + "@svgr/hast-util-to-babel-ast": "8.0.0", + "svg-parser": "^2.0.4" }, "engines": { - "node": ">= 8" + "node": ">=14" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + }, + "peerDependencies": { + "@svgr/core": "*" } }, "node_modules/@nodelib/fs.stat": { @@ -2075,7 +2338,14 @@ "dev": true, "license": "MIT", "engines": { - "node": ">= 8" + "node": ">=14" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + }, + "peerDependencies": { + "@svgr/core": "*" } }, "node_modules/@nodelib/fs.walk": { @@ -2085,11 +2355,21 @@ "dev": true, "license": "MIT", "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" + "@babel/core": "^7.21.3", + "@babel/plugin-transform-react-constant-elements": "^7.21.3", + "@babel/preset-env": "^7.20.2", + "@babel/preset-react": "^7.18.6", + "@babel/preset-typescript": "^7.21.0", + "@svgr/core": "8.1.0", + "@svgr/plugin-jsx": "8.1.0", + "@svgr/plugin-svgo": "8.1.0" }, "engines": { - "node": ">= 8" + "node": ">=14" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" } }, "node_modules/@nolyfill/is-core-module": { @@ -2926,6 +3206,12 @@ "dev": true, "license": "MIT" }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" + }, "node_modules/available-typed-arrays": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", @@ -2952,6 +3238,17 @@ "node": ">=4" } }, + "node_modules/axios": { + "version": "1.7.9", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.9.tgz", + "integrity": "sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw==", + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, "node_modules/axobject-query": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz", @@ -3124,6 +3421,40 @@ "node": ">= 0.4" } }, + "node_modules/call-bind": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.0", + "es-define-property": "^1.0.0", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", + "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz", @@ -3225,6 +3556,18 @@ "dev": true, "license": "MIT" }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/commander": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", @@ -3369,6 +3712,7 @@ "dependencies": { "mdn-data": "2.0.28", "source-map-js": "^1.0.1" + }, "engines": { "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0", @@ -3524,17 +3868,52 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/domutils": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.2.2.tgz", + "integrity": "sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw==", + "license": "BSD-2-Clause", + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, + "node_modules/dot-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", + "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", + "license": "MIT", + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", "dev": true, "license": "Apache-2.0", "dependencies": { - "esutils": "^2.0.2" + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" }, "engines": { - "node": ">=6.0.0" + "node": ">= 0.4" } }, "node_modules/dom-serializer": { @@ -4439,6 +4818,26 @@ "dev": true, "license": "ISC" }, + "node_modules/follow-redirects": { + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", + "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, "node_modules/for-each": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", @@ -4466,6 +4865,20 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/form-data": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", + "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -5587,6 +6000,27 @@ "node": ">=8.6" } }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -6098,6 +6532,12 @@ "react-is": "^16.13.1" } }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "license": "MIT" + }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", diff --git a/package.json b/package.json index 3355b8b05..feaea2535 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ }, "dependencies": { "@svgr/webpack": "^8.1.0", + "axios": "^1.7.9", "dayjs": "^1.11.13", "next": "14.2.23", "react": "^18", diff --git a/public/assets/img/icon_google.svg b/public/assets/img/icon_google.svg new file mode 100644 index 000000000..39de6337b --- /dev/null +++ b/public/assets/img/icon_google.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/public/assets/img/icon_kakao.svg b/public/assets/img/icon_kakao.svg new file mode 100644 index 000000000..15dc4d0ff --- /dev/null +++ b/public/assets/img/icon_kakao.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/components/form/form-input.tsx b/src/components/form/form-input.tsx index b2e35890e..e9432db3d 100644 --- a/src/components/form/form-input.tsx +++ b/src/components/form/form-input.tsx @@ -4,16 +4,18 @@ interface Props { type: string; placeholder: string; value?: string; + name?: string; onChange: (e: React.ChangeEvent) => void; } -const FormInput = ({ type, placeholder, value, onChange }: Props) => { +const FormInput = ({ type, placeholder, value, name, onChange }: Props) => { return ( ); diff --git a/src/components/header-layout.module.css b/src/components/header-layout.module.css index db8066599..aafaaafe1 100644 --- a/src/components/header-layout.module.css +++ b/src/components/header-layout.module.css @@ -38,6 +38,7 @@ } .header .my { margin-left: auto; + cursor: pointer; } @media (max-width: 744px) { diff --git a/src/components/header-layout.tsx b/src/components/header-layout.tsx index 9787450be..da89ce0b2 100644 --- a/src/components/header-layout.tsx +++ b/src/components/header-layout.tsx @@ -1,7 +1,30 @@ import Link from "next/link"; import styles from "./header-layout.module.css"; +import { useEffect, useState } from "react"; +import { useRouter } from "next/router"; export default function HeaderLayout() { + const [isLoggedIn, setIsLoggedIn] = useState(false); + const router = useRouter(); + + useEffect(() => { + const accessToken = localStorage.getItem("accessToken"); + if (accessToken) { + setIsLoggedIn(true); + } + }, [router.pathname]); + + const onLogout: React.MouseEventHandler = () => { + const result = confirm("로그아웃 하시겠습니까?"); + if (result) { + localStorage.removeItem("accessToken"); + localStorage.removeItem("refreshToken"); + localStorage.removeItem("user"); + setIsLoggedIn(false); + } else { + return; + } + }; return (
@@ -27,9 +50,15 @@ export default function HeaderLayout() { 중고마켓 - - 마이페이지 - + {isLoggedIn ? ( +
+ 마이페이지 +
+ ) : ( + + 로그인 + + )}
); diff --git a/src/lib/axios.ts b/src/lib/axios.ts new file mode 100644 index 000000000..c490ba216 --- /dev/null +++ b/src/lib/axios.ts @@ -0,0 +1,8 @@ +import axios from "axios"; + +const Instance = axios.create({ + baseURL: "https://panda-market-api.vercel.app", +}); + +export default Instance; +export { axios }; diff --git a/src/lib/format-data.ts b/src/lib/format-data.ts index 97d6fc2a6..a4e4df966 100644 --- a/src/lib/format-data.ts +++ b/src/lib/format-data.ts @@ -3,6 +3,5 @@ import dayjs from "dayjs"; export default function formatDate(dateString: string) { const isoDate = new Date(dateString); const formattedDate = dayjs(isoDate).format("YYYY. MM. DD"); - return formattedDate; } diff --git a/src/pages/boards/index.tsx b/src/pages/boards/index.tsx index 691da7189..89d61f54a 100644 --- a/src/pages/boards/index.tsx +++ b/src/pages/boards/index.tsx @@ -34,8 +34,6 @@ export default function Page() { setBestPageSize(3); } }, [isMo, isTa]); - - const onSortToggle = () => { setSortState(!sortState); }; @@ -93,13 +91,11 @@ export default function Page() { setTimeout(() => { setSearch(""); }, 100); - }; const ref = useOutsideClick(() => { setSortState(false); }); - const handleScroll = () => { const bottom = window.innerHeight + document.documentElement.scrollTop === @@ -132,7 +128,6 @@ export default function Page() {
게시글
- 글쓰기
diff --git a/src/pages/login/index.tsx b/src/pages/login/index.tsx new file mode 100644 index 000000000..532c3dc61 --- /dev/null +++ b/src/pages/login/index.tsx @@ -0,0 +1,153 @@ +import FormInput from "@/components/form/form-input"; +import styles from "./../signup/signup.module.css"; +import { useEffect, useState } from "react"; +import Link from "next/link"; +import Instance, { axios } from "@/lib/axios"; +import { isAxiosError } from "axios"; +import { useRouter } from "next/router"; + +export default function Page() { + const router = useRouter(); + const [loginValue, setLoginValue] = useState({ + email: "", + password: "", + }); + + useEffect(() => { + const accessToken = localStorage.getItem("accessToken"); + if (accessToken) { + router.push("/"); + } + }, [router]); + + const onChange = (e: React.ChangeEvent) => { + const { name, value } = e.target; + setLoginValue((prev) => ({ + ...prev, + [name]: value, + })); + }; + + const onSignInSubmit: React.FormEventHandler = async (e) => { + e.preventDefault(); + + const { email, password } = loginValue; + + if (!email || !password) { + alert("모든 필드를 채워주세요."); + return; + } + if (!/\S+@\S+\.\S+/.test(email)) { + alert("유효한 이메일 주소를 입력해주세요."); + return; + } + if (password.length < 8) { + alert("비밀번호는 최소 8자 이상이어야 합니다."); + return; + } + + try { + const response = await Instance.post("/auth/signIn", { + email, + password, + }); + alert("로그인이 성공적으로 완료되었습니다!"); + + // 서버로부터 받은 데이터 추출 + const { user, accessToken, refreshToken } = response.data; + + // 로컬스토리지에 토큰과 사용자 데이터 저장 + localStorage.setItem("accessToken", accessToken); + localStorage.setItem("refreshToken", refreshToken); + localStorage.setItem("user", JSON.stringify(user)); // 객체는 JSON 문자열로 변환 + + setLoginValue({ + email: "", + password: "", + }); + router.push("/"); + } catch (error) { + if (isAxiosError(error) && error.response) { + console.error("서버 응답 상태 코드:", error.response.status); + console.error("서버 응답 데이터:", error.response.data); + alert(error.response.data.message || "로그인에 실패했습니다."); + } else { + console.error("알 수 없는 오류:", error); + alert("로그인 중 문제가 발생했습니다. 다시 시도해주세요."); + } + } + }; + + return ( +
+
+ + 로고 + +
+
+
    +
  • +
    이메일
    +
    + +
    +
  • +
  • +
    비밀번호
    +
    + +
    +
  • +
  • + +
  • +
  • +
    +

    간편 로그인하기

    +
      +
    • + + 구글 간편로그인 + +
    • +
    • + + 카카오 간편로그인 + +
    • +
    +
    +
  • +
  • +
    +

    + 판다마켓이 처음이신가요? 회원가입 +

    +
    +
  • +
+
+
+ ); +} diff --git a/src/pages/signup/index.tsx b/src/pages/signup/index.tsx new file mode 100644 index 000000000..fc03b6dba --- /dev/null +++ b/src/pages/signup/index.tsx @@ -0,0 +1,178 @@ +import FormInput from "@/components/form/form-input"; +import styles from "./signup.module.css"; +import { useEffect, useState } from "react"; +import Link from "next/link"; +import Instance, { axios } from "@/lib/axios"; +import { isAxiosError } from "axios"; +import { useRouter } from "next/router"; + +export default function Page() { + const router = useRouter(); + const [signupValue, setSignupValue] = useState({ + email: "", + nickname: "", + password: "", + passwordConfirmation: "", + }); + + useEffect(() => { + const accessToken = localStorage.getItem("accessToken"); + if (accessToken) { + router.push("/"); + } + }, [router]); + + const onChange = (e: React.ChangeEvent) => { + const { name, value } = e.target; + setSignupValue((prev) => ({ + ...prev, + [name]: value, + })); + }; + + const onSignupSubmit: React.FormEventHandler = async (e) => { + e.preventDefault(); + + const { email, nickname, password, passwordConfirmation } = signupValue; + + if (!email || !nickname || !password || !passwordConfirmation) { + alert("모든 필드를 채워주세요."); + return; + } + if (!/\S+@\S+\.\S+/.test(email)) { + alert("유효한 이메일 주소를 입력해주세요."); + return; + } + if (password.length < 8) { + alert("비밀번호는 최소 8자 이상이어야 합니다."); + return; + } + if (password !== passwordConfirmation) { + alert("비밀번호가 일치하지 않습니다."); + return; + } + + try { + await Instance.post("/auth/signUp", { + email, + nickname, + password, + passwordConfirmation, + }); + alert("회원가입이 성공적으로 완료되었습니다!"); + setSignupValue({ + email: "", + nickname: "", + password: "", + passwordConfirmation: "", + }); + router.push("/login"); + } catch (error) { + if (isAxiosError(error) && error.response) { + console.error("서버 응답 상태 코드:", error.response.status); + console.error("서버 응답 데이터:", error.response.data); + alert(error.response.data.message || "회원가입에 실패했습니다."); + } else { + console.error("알 수 없는 오류:", error); + alert("회원가입 중 문제가 발생했습니다. 다시 시도해주세요."); + } + } + }; + + return ( +
+
+ + 로고 + +
+
+
    +
  • +
    이메일
    +
    + +
    +
  • +
  • +
    닉네임
    +
    + +
    +
  • +
  • +
    비밀번호
    +
    + +
    +
  • +
  • +
    비밀번호 확인
    +
    + +
    +
  • +
  • + +
  • +
  • +
    +

    간편 로그인하기

    +
      +
    • + + 구글 간편로그인 + +
    • +
    • + + 카카오 간편로그인 + +
    • +
    +
    +
  • +
  • +
    +

    + 이미 회원이신가요? 로그인 +

    +
    +
  • +
+
+
+ ); +} diff --git a/src/pages/signup/signup.module.css b/src/pages/signup/signup.module.css new file mode 100644 index 000000000..5e4c06970 --- /dev/null +++ b/src/pages/signup/signup.module.css @@ -0,0 +1,67 @@ +.login_wrap { + max-width: 640px; + width: 100%; + margin: 0 auto; +} +.logo { + margin-bottom: 40px; + text-align: center; +} +.login_list { +} +.login_list > li { +} +.login_list > li + li { + margin-top: 24px; +} +.login_list > li .title { + margin-bottom: 16px; + font-size: 18px; + font-weight: 700; +} +.login_list > li .content { +} +.login_list > li .sns { + padding: 16px 23px; + background-color: #e6f2ff; + border-radius: 8px; + display: flex; + align-items: center; + justify-content: space-between; +} +.login_list > li .sns h3 { + font-size: 16px; + font-weight: 500; + line-height: 1; +} +.login_list > li .sns ul { + display: flex; + align-items: center; +} +.login_list > li .sns ul > li { +} +.login_list > li .sns ul > li + li { + margin-left: 16px; +} +.login_list > li .sns ul > li img { + height: 42px; +} +.login_list > li .link > p { + text-align: center; + font-size: 14px; + font-weight: 500; + line-height: 1.7142; +} +.login_list > li .link p > a { + color: #3182f6; + text-decoration: underline; + text-underline-offset: 3px; +} +@media (max-width: 744px) { + .logo { + margin-bottom: 24px; + } + .logo img { + height: 70px; + } +} diff --git a/src/styles/globals.css b/src/styles/globals.css index bf2d943e4..e713caecb 100644 --- a/src/styles/globals.css +++ b/src/styles/globals.css @@ -162,6 +162,14 @@ body { font-size: 16px; font-weight: 600; } +.btn.large { + height: 56px; + font-size: 20px; +} +.btn.block { + display: block; + width: 100%; +} .btn.round { border-radius: 999px; } diff --git a/test.http b/test.http new file mode 100644 index 000000000..732473d1a --- /dev/null +++ b/test.http @@ -0,0 +1,8 @@ + +POST https://panda-market-api.vercel.app/auth/signIn +Content-Type: application/json + +{ + "email": "kss53043@naver.com", + "password": "123123123" +}