Compare commits

..

No commits in common. "master" and "0.1.0" have entirely different histories.

47 changed files with 426 additions and 800 deletions

View File

@ -1,7 +1,7 @@
# Crypto Viewer
A cross-platform desktop software for displaying cryptocurrency data and price trends. Written in Typescript and based on an Electron architecture with a React-driven user interface. (The published source code does not include the Electron source code currently.)
A cross-platform desktop software for displaying cryptocurrency data and price trends. Based on an Electron architecture with a React-driven user interface. (The published source code does not include the Electron source code currently.)
[Online preview](https://crypto-viewer.baryluk.de) without the Electron wrapper for demonstration purpose.

411
package-lock.json generated
View File

@ -1,36 +1,30 @@
{
"name": "react-crypto-ts",
"name": "react-crypto",
"version": "0.1.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "react-crypto-ts",
"name": "react-crypto",
"version": "0.1.0",
"dependencies": {
"@jridgewell/resolve-uri": "^3.1.0",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.2",
"@testing-library/react": "^16.3.1",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.5.2",
"@types/node": "^16.18.126",
"@types/react": "^19.2.9",
"@types/react-dom": "^19.2.3",
"axios": "^1.13.0",
"chart.js": "^4.5.0",
"chartjs-adapter-date-fns": "^3.0.0",
"date-fns": "^4.1.0",
"react": "^19.2.4",
"react": "^19.2.0",
"react-chartjs-2": "^5.3.0",
"react-dom": "^19.2.4",
"react-dom": "^19.2.0",
"react-hot-toast": "^2.6.0",
"react-icons": "^5.5.0",
"react-router": "^7.7.0",
"react-scripts": "5.0.1",
"react-spinners": "^0.17.0",
"sass": "^1.97.0",
"typescript": "^4.9.5",
"web-vitals": "^2.1.4",
"zustand": "^5.0.0"
}
@ -261,16 +255,16 @@
}
},
"node_modules/@babel/helper-define-polyfill-provider": {
"version": "0.6.6",
"resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.6.tgz",
"integrity": "sha512-mOAsxeeKkUKayvZR3HeTYD/fICpCPLJrU5ZjelT/PA6WHtNDBOE436YiaEUvHN454bRM3CebhDsIpieCc4texA==",
"version": "0.6.5",
"resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.5.tgz",
"integrity": "sha512-uJnGFcPsWQK8fvjgGP5LZUZZsYGIoPeRjSF5PGwrelYgq7Q15/Ft9NGFp1zglwgIv//W0uG4BevRuSJRyylZPg==",
"license": "MIT",
"dependencies": {
"@babel/helper-compilation-targets": "^7.28.6",
"@babel/helper-plugin-utils": "^7.28.6",
"debug": "^4.4.3",
"@babel/helper-compilation-targets": "^7.27.2",
"@babel/helper-plugin-utils": "^7.27.1",
"debug": "^4.4.1",
"lodash.debounce": "^4.0.8",
"resolve": "^1.22.11"
"resolve": "^1.22.10"
},
"peerDependencies": {
"@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0"
@ -2948,9 +2942,9 @@
}
},
"node_modules/@parcel/watcher": {
"version": "2.5.6",
"resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.6.tgz",
"integrity": "sha512-tmmZ3lQxAe/k/+rNnXQRawJ4NjxO2hqiOLTHvWchtGZULp4RyFeh6aU4XdOYBFe2KE1oShQTv4AblOs2iOrNnQ==",
"version": "2.5.4",
"resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.4.tgz",
"integrity": "sha512-WYa2tUVV5HiArWPB3ydlOc4R2ivq0IDrlqhMi3l7mVsFEXNcTfxYFPIHXHXIh/ca/y/V5N4E1zecyxdIBjYnkQ==",
"hasInstallScript": true,
"license": "MIT",
"optional": true,
@ -2968,25 +2962,25 @@
"url": "https://opencollective.com/parcel"
},
"optionalDependencies": {
"@parcel/watcher-android-arm64": "2.5.6",
"@parcel/watcher-darwin-arm64": "2.5.6",
"@parcel/watcher-darwin-x64": "2.5.6",
"@parcel/watcher-freebsd-x64": "2.5.6",
"@parcel/watcher-linux-arm-glibc": "2.5.6",
"@parcel/watcher-linux-arm-musl": "2.5.6",
"@parcel/watcher-linux-arm64-glibc": "2.5.6",
"@parcel/watcher-linux-arm64-musl": "2.5.6",
"@parcel/watcher-linux-x64-glibc": "2.5.6",
"@parcel/watcher-linux-x64-musl": "2.5.6",
"@parcel/watcher-win32-arm64": "2.5.6",
"@parcel/watcher-win32-ia32": "2.5.6",
"@parcel/watcher-win32-x64": "2.5.6"
"@parcel/watcher-android-arm64": "2.5.4",
"@parcel/watcher-darwin-arm64": "2.5.4",
"@parcel/watcher-darwin-x64": "2.5.4",
"@parcel/watcher-freebsd-x64": "2.5.4",
"@parcel/watcher-linux-arm-glibc": "2.5.4",
"@parcel/watcher-linux-arm-musl": "2.5.4",
"@parcel/watcher-linux-arm64-glibc": "2.5.4",
"@parcel/watcher-linux-arm64-musl": "2.5.4",
"@parcel/watcher-linux-x64-glibc": "2.5.4",
"@parcel/watcher-linux-x64-musl": "2.5.4",
"@parcel/watcher-win32-arm64": "2.5.4",
"@parcel/watcher-win32-ia32": "2.5.4",
"@parcel/watcher-win32-x64": "2.5.4"
}
},
"node_modules/@parcel/watcher-android-arm64": {
"version": "2.5.6",
"resolved": "https://registry.npmjs.org/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.5.6.tgz",
"integrity": "sha512-YQxSS34tPF/6ZG7r/Ih9xy+kP/WwediEUsqmtf0cuCV5TPPKw/PQHRhueUo6JdeFJaqV3pyjm0GdYjZotbRt/A==",
"version": "2.5.4",
"resolved": "https://registry.npmjs.org/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.5.4.tgz",
"integrity": "sha512-hoh0vx4v+b3BNI7Cjoy2/B0ARqcwVNrzN/n7DLq9ZB4I3lrsvhrkCViJyfTj/Qi5xM9YFiH4AmHGK6pgH1ss7g==",
"cpu": [
"arm64"
],
@ -3004,9 +2998,9 @@
}
},
"node_modules/@parcel/watcher-darwin-arm64": {
"version": "2.5.6",
"resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.5.6.tgz",
"integrity": "sha512-Z2ZdrnwyXvvvdtRHLmM4knydIdU9adO3D4n/0cVipF3rRiwP+3/sfzpAwA/qKFL6i1ModaabkU7IbpeMBgiVEA==",
"version": "2.5.4",
"resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.5.4.tgz",
"integrity": "sha512-kphKy377pZiWpAOyTgQYPE5/XEKVMaj6VUjKT5VkNyUJlr2qZAn8gIc7CPzx+kbhvqHDT9d7EqdOqRXT6vk0zw==",
"cpu": [
"arm64"
],
@ -3024,9 +3018,9 @@
}
},
"node_modules/@parcel/watcher-darwin-x64": {
"version": "2.5.6",
"resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.5.6.tgz",
"integrity": "sha512-HgvOf3W9dhithcwOWX9uDZyn1lW9R+7tPZ4sug+NGrGIo4Rk1hAXLEbcH1TQSqxts0NYXXlOWqVpvS1SFS4fRg==",
"version": "2.5.4",
"resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.5.4.tgz",
"integrity": "sha512-UKaQFhCtNJW1A9YyVz3Ju7ydf6QgrpNQfRZ35wNKUhTQ3dxJ/3MULXN5JN/0Z80V/KUBDGa3RZaKq1EQT2a2gg==",
"cpu": [
"x64"
],
@ -3044,9 +3038,9 @@
}
},
"node_modules/@parcel/watcher-freebsd-x64": {
"version": "2.5.6",
"resolved": "https://registry.npmjs.org/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.5.6.tgz",
"integrity": "sha512-vJVi8yd/qzJxEKHkeemh7w3YAn6RJCtYlE4HPMoVnCpIXEzSrxErBW5SJBgKLbXU3WdIpkjBTeUNtyBVn8TRng==",
"version": "2.5.4",
"resolved": "https://registry.npmjs.org/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.5.4.tgz",
"integrity": "sha512-Dib0Wv3Ow/m2/ttvLdeI2DBXloO7t3Z0oCp4bAb2aqyqOjKPPGrg10pMJJAQ7tt8P4V2rwYwywkDhUia/FgS+Q==",
"cpu": [
"x64"
],
@ -3064,9 +3058,9 @@
}
},
"node_modules/@parcel/watcher-linux-arm-glibc": {
"version": "2.5.6",
"resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.5.6.tgz",
"integrity": "sha512-9JiYfB6h6BgV50CCfasfLf/uvOcJskMSwcdH1PHH9rvS1IrNy8zad6IUVPVUfmXr+u+Km9IxcfMLzgdOudz9EQ==",
"version": "2.5.4",
"resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.5.4.tgz",
"integrity": "sha512-I5Vb769pdf7Q7Sf4KNy8Pogl/URRCKu9ImMmnVKYayhynuyGYMzuI4UOWnegQNa2sGpsPSbzDsqbHNMyeyPCgw==",
"cpu": [
"arm"
],
@ -3084,9 +3078,9 @@
}
},
"node_modules/@parcel/watcher-linux-arm-musl": {
"version": "2.5.6",
"resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-musl/-/watcher-linux-arm-musl-2.5.6.tgz",
"integrity": "sha512-Ve3gUCG57nuUUSyjBq/MAM0CzArtuIOxsBdQ+ftz6ho8n7s1i9E1Nmk/xmP323r2YL0SONs1EuwqBp2u1k5fxg==",
"version": "2.5.4",
"resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-musl/-/watcher-linux-arm-musl-2.5.4.tgz",
"integrity": "sha512-kGO8RPvVrcAotV4QcWh8kZuHr9bXi9a3bSZw7kFarYR0+fGliU7hd/zevhjw8fnvIKG3J9EO5G6sXNGCSNMYPQ==",
"cpu": [
"arm"
],
@ -3104,9 +3098,9 @@
}
},
"node_modules/@parcel/watcher-linux-arm64-glibc": {
"version": "2.5.6",
"resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.5.6.tgz",
"integrity": "sha512-f2g/DT3NhGPdBmMWYoxixqYr3v/UXcmLOYy16Bx0TM20Tchduwr4EaCbmxh1321TABqPGDpS8D/ggOTaljijOA==",
"version": "2.5.4",
"resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.5.4.tgz",
"integrity": "sha512-KU75aooXhqGFY2W5/p8DYYHt4hrjHZod8AhcGAmhzPn/etTa+lYCDB2b1sJy3sWJ8ahFVTdy+EbqSBvMx3iFlw==",
"cpu": [
"arm64"
],
@ -3124,9 +3118,9 @@
}
},
"node_modules/@parcel/watcher-linux-arm64-musl": {
"version": "2.5.6",
"resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.5.6.tgz",
"integrity": "sha512-qb6naMDGlbCwdhLj6hgoVKJl2odL34z2sqkC7Z6kzir8b5W65WYDpLB6R06KabvZdgoHI/zxke4b3zR0wAbDTA==",
"version": "2.5.4",
"resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.5.4.tgz",
"integrity": "sha512-Qx8uNiIekVutnzbVdrgSanM+cbpDD3boB1f8vMtnuG5Zau4/bdDbXyKwIn0ToqFhIuob73bcxV9NwRm04/hzHQ==",
"cpu": [
"arm64"
],
@ -3144,9 +3138,9 @@
}
},
"node_modules/@parcel/watcher-linux-x64-glibc": {
"version": "2.5.6",
"resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.5.6.tgz",
"integrity": "sha512-kbT5wvNQlx7NaGjzPFu8nVIW1rWqV780O7ZtkjuWaPUgpv2NMFpjYERVi0UYj1msZNyCzGlaCWEtzc+exjMGbQ==",
"version": "2.5.4",
"resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.5.4.tgz",
"integrity": "sha512-UYBQvhYmgAv61LNUn24qGQdjtycFBKSK3EXr72DbJqX9aaLbtCOO8+1SkKhD/GNiJ97ExgcHBrukcYhVjrnogA==",
"cpu": [
"x64"
],
@ -3164,9 +3158,9 @@
}
},
"node_modules/@parcel/watcher-linux-x64-musl": {
"version": "2.5.6",
"resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.5.6.tgz",
"integrity": "sha512-1JRFeC+h7RdXwldHzTsmdtYR/Ku8SylLgTU/reMuqdVD7CtLwf0VR1FqeprZ0eHQkO0vqsbvFLXUmYm/uNKJBg==",
"version": "2.5.4",
"resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.5.4.tgz",
"integrity": "sha512-YoRWCVgxv8akZrMhdyVi6/TyoeeMkQ0PGGOf2E4omODrvd1wxniXP+DBynKoHryStks7l+fDAMUBRzqNHrVOpg==",
"cpu": [
"x64"
],
@ -3184,9 +3178,9 @@
}
},
"node_modules/@parcel/watcher-win32-arm64": {
"version": "2.5.6",
"resolved": "https://registry.npmjs.org/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.5.6.tgz",
"integrity": "sha512-3ukyebjc6eGlw9yRt678DxVF7rjXatWiHvTXqphZLvo7aC5NdEgFufVwjFfY51ijYEWpXbqF5jtrK275z52D4Q==",
"version": "2.5.4",
"resolved": "https://registry.npmjs.org/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.5.4.tgz",
"integrity": "sha512-iby+D/YNXWkiQNYcIhg8P5hSjzXEHaQrk2SLrWOUD7VeC4Ohu0WQvmV+HDJokZVJ2UjJ4AGXW3bx7Lls9Ln4TQ==",
"cpu": [
"arm64"
],
@ -3204,9 +3198,9 @@
}
},
"node_modules/@parcel/watcher-win32-ia32": {
"version": "2.5.6",
"resolved": "https://registry.npmjs.org/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.5.6.tgz",
"integrity": "sha512-k35yLp1ZMwwee3Ez/pxBi5cf4AoBKYXj00CZ80jUz5h8prpiaQsiRPKQMxoLstNuqe2vR4RNPEAEcjEFzhEz/g==",
"version": "2.5.4",
"resolved": "https://registry.npmjs.org/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.5.4.tgz",
"integrity": "sha512-vQN+KIReG0a2ZDpVv8cgddlf67J8hk1WfZMMP7sMeZmJRSmEax5xNDNWKdgqSe2brOKTQQAs3aCCUal2qBHAyg==",
"cpu": [
"ia32"
],
@ -3224,9 +3218,9 @@
}
},
"node_modules/@parcel/watcher-win32-x64": {
"version": "2.5.6",
"resolved": "https://registry.npmjs.org/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.5.6.tgz",
"integrity": "sha512-hbQlYcCq5dlAX9Qx+kFb0FHue6vbjlf0FrNzSKdYK2APUf7tGfGxQCk2ihEREmbR6ZMc0MVAD5RIX/41gpUzTw==",
"version": "2.5.4",
"resolved": "https://registry.npmjs.org/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.5.4.tgz",
"integrity": "sha512-3A6efb6BOKwyw7yk9ro2vus2YTt2nvcd56AuzxdMiVOxL9umDyN5PKkKfZ/gZ9row41SjVmTVQNWQhaRRGpOKw==",
"cpu": [
"x64"
],
@ -3697,9 +3691,9 @@
"license": "MIT"
},
"node_modules/@testing-library/react": {
"version": "16.3.2",
"resolved": "https://registry.npmjs.org/@testing-library/react/-/react-16.3.2.tgz",
"integrity": "sha512-XU5/SytQM+ykqMnAnvB2umaJNIOsLF3PVv//1Ew4CTcpz0/BRyy/af40qqrt7SjKpDdT1saBMc42CUok5gaw+g==",
"version": "16.3.1",
"resolved": "https://registry.npmjs.org/@testing-library/react/-/react-16.3.1.tgz",
"integrity": "sha512-gr4KtAWqIOQoucWYD/f6ki+j5chXfcPc74Col/6poTyqTmn7zRmodWahWRCp8tYd+GMqBonw6hstNzqjbs6gjw==",
"license": "MIT",
"dependencies": {
"@babel/runtime": "^7.12.5"
@ -3958,16 +3952,6 @@
"@types/istanbul-lib-report": "*"
}
},
"node_modules/@types/jest": {
"version": "27.5.2",
"resolved": "https://registry.npmjs.org/@types/jest/-/jest-27.5.2.tgz",
"integrity": "sha512-mpT8LJJ4CMeeahobofYWIjFo0xonRS/HfxnVEPMPFSQdGUt1uHCnoPT7Zhb+sjDU2wz0oKV0OLUR0WzrHNgfeA==",
"license": "MIT",
"dependencies": {
"jest-matcher-utils": "^27.0.0",
"pretty-format": "^27.0.0"
}
},
"node_modules/@types/json-schema": {
"version": "7.0.15",
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz",
@ -3987,10 +3971,13 @@
"license": "MIT"
},
"node_modules/@types/node": {
"version": "16.18.126",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.126.tgz",
"integrity": "sha512-OTcgaiwfGFBKacvfwuHzzn1KLxH/er8mluiy8/uM3sGXHaRe73RrSIj01jow9t4kJEW633Ov+cOexXeiApTyAw==",
"license": "MIT"
"version": "25.0.9",
"resolved": "https://registry.npmjs.org/@types/node/-/node-25.0.9.tgz",
"integrity": "sha512-/rpCXHlCWeqClNBwUhDcusJxXYDjZTyE8v5oTO7WbL8eij2nKhUeU89/6xgjU7N4/Vh3He0BtyhJdQbDyhiXAw==",
"license": "MIT",
"dependencies": {
"undici-types": "~7.16.0"
}
},
"node_modules/@types/node-forge": {
"version": "1.3.14",
@ -4031,24 +4018,6 @@
"integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==",
"license": "MIT"
},
"node_modules/@types/react": {
"version": "19.2.10",
"resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.10.tgz",
"integrity": "sha512-WPigyYuGhgZ/cTPRXB2EwUw+XvsRA3GqHlsP4qteqrnnjDrApbS7MxcGr/hke5iUoeB7E/gQtrs9I37zAJ0Vjw==",
"license": "MIT",
"dependencies": {
"csstype": "^3.2.2"
}
},
"node_modules/@types/react-dom": {
"version": "19.2.3",
"resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.2.3.tgz",
"integrity": "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==",
"license": "MIT",
"peerDependencies": {
"@types/react": "^19.2.0"
}
},
"node_modules/@types/resolve": {
"version": "1.17.1",
"resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz",
@ -4799,15 +4768,12 @@
}
},
"node_modules/ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz",
"integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==",
"license": "MIT",
"dependencies": {
"color-convert": "^2.0.1"
},
"engines": {
"node": ">=8"
"node": ">=10"
},
"funding": {
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
@ -5148,9 +5114,9 @@
}
},
"node_modules/axios": {
"version": "1.13.4",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.13.4.tgz",
"integrity": "sha512-1wVkUaAO6WyaYtCkcYCOx12ZgpGf9Zif+qXa4n+oYzK558YryKqiL6UWwd5DqiH3VRW0GYhTZQ/vlgJrCoNQlg==",
"version": "1.13.2",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.13.2.tgz",
"integrity": "sha512-VPk9ebNqPcy5lRGuSlKx752IlDatOjT9paPlm8A7yOuW2Fbvp4X3JznJtT4f0GzGLLiWE9W8onz51SqLYwzGaA==",
"license": "MIT",
"dependencies": {
"follow-redirects": "^1.15.6",
@ -5282,13 +5248,13 @@
}
},
"node_modules/babel-plugin-polyfill-corejs2": {
"version": "0.4.15",
"resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.15.tgz",
"integrity": "sha512-hR3GwrRwHUfYwGfrisXPIDP3JcYfBrW7wKE7+Au6wDYl7fm/ka1NEII6kORzxNU556JjfidZeBsO10kYvtV1aw==",
"version": "0.4.14",
"resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.14.tgz",
"integrity": "sha512-Co2Y9wX854ts6U8gAAPXfn0GmAyctHuK8n0Yhfjd6t30g7yvKjspvvOo9yG+z52PZRgFErt7Ka2pYnXCjLKEpg==",
"license": "MIT",
"dependencies": {
"@babel/compat-data": "^7.28.6",
"@babel/helper-define-polyfill-provider": "^0.6.6",
"@babel/compat-data": "^7.27.7",
"@babel/helper-define-polyfill-provider": "^0.6.5",
"semver": "^6.3.1"
},
"peerDependencies": {
@ -5318,12 +5284,12 @@
}
},
"node_modules/babel-plugin-polyfill-regenerator": {
"version": "0.6.6",
"resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.6.6.tgz",
"integrity": "sha512-hYm+XLYRMvupxiQzrvXUj7YyvFFVfv5gI0R71AJzudg1g2AI2vyCPPIFEBjk162/wFzti3inBHo7isWFuEVS/A==",
"version": "0.6.5",
"resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.6.5.tgz",
"integrity": "sha512-ISqQ2frbiNU9vIJkzg7dlPpznPZ4jOiUQ1uSmB0fEHeowtN3COYRsXr/xexn64NpU13P06jc/L5TgiJXOgrbEg==",
"license": "MIT",
"dependencies": {
"@babel/helper-define-polyfill-provider": "^0.6.6"
"@babel/helper-define-polyfill-provider": "^0.6.5"
},
"peerDependencies": {
"@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0"
@ -5428,9 +5394,9 @@
"license": "MIT"
},
"node_modules/baseline-browser-mapping": {
"version": "2.9.18",
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.9.18.tgz",
"integrity": "sha512-e23vBV1ZLfjb9apvfPk4rHVu2ry6RIr2Wfs+O324okSidrX7pTAnEJPCh/O5BtRlr7QtZI7ktOP3vsqr7Z5XoA==",
"version": "2.9.15",
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.9.15.tgz",
"integrity": "sha512-kX8h7K2srmDyYnXRIppo4AH/wYgzWVCs+eKr3RusRSQ5PvRYoEFmR/I0PbdTjKFAoKqp5+kbxnNTFO9jOfSVJg==",
"license": "Apache-2.0",
"bin": {
"baseline-browser-mapping": "dist/cli.js"
@ -5749,9 +5715,9 @@
}
},
"node_modules/caniuse-lite": {
"version": "1.0.30001766",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001766.tgz",
"integrity": "sha512-4C0lfJ0/YPjJQHagaE9x2Elb69CIqEPZeG0anQt9SIvIoOH4a4uaRl73IavyO+0qZh6MDLH//DrXThEYKHkmYA==",
"version": "1.0.30001764",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001764.tgz",
"integrity": "sha512-9JGuzl2M+vPL+pz70gtMF9sHdMFbY9FJaQBi186cHKH3pSzDvzoUJUPV6fqiKIMyXbud9ZLg4F3Yza1vJ1+93g==",
"funding": [
{
"type": "opencollective",
@ -5793,6 +5759,21 @@
"url": "https://github.com/chalk/chalk?sponsor=1"
}
},
"node_modules/chalk/node_modules/ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"license": "MIT",
"dependencies": {
"color-convert": "^2.0.1"
},
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/char-regex": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz",
@ -6208,9 +6189,9 @@
"license": "MIT"
},
"node_modules/core-js": {
"version": "3.48.0",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.48.0.tgz",
"integrity": "sha512-zpEHTy1fjTMZCKLHUZoVeylt9XrzaIN2rbPXEt0k+q7JE5CkCZdo6bNq55bn24a69CH7ErAVLKijxJja4fw+UQ==",
"version": "3.47.0",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.47.0.tgz",
"integrity": "sha512-c3Q2VVkGAUyupsjRnaNX6u8Dq2vAdzm9iuPj5FW0fRxzlxgq9Q39MDq10IvmQSpLgHQNyQzQmOo6bgGHmH3NNg==",
"hasInstallScript": true,
"license": "MIT",
"funding": {
@ -6219,12 +6200,12 @@
}
},
"node_modules/core-js-compat": {
"version": "3.48.0",
"resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.48.0.tgz",
"integrity": "sha512-OM4cAF3D6VtH/WkLtWvyNC56EZVXsZdU3iqaMG2B4WvYrlqU831pc4UtG5yp0sE9z8Y02wVN7PjW5Zf9Gt0f1Q==",
"version": "3.47.0",
"resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.47.0.tgz",
"integrity": "sha512-IGfuznZ/n7Kp9+nypamBhvwdwLsW6KC8IOaURw2doAK5e98AG3acVLdh0woOnEqCfUtS+Vu882JE4k/DAm3ItQ==",
"license": "MIT",
"dependencies": {
"browserslist": "^4.28.1"
"browserslist": "^4.28.0"
},
"funding": {
"type": "opencollective",
@ -6232,9 +6213,9 @@
}
},
"node_modules/core-js-pure": {
"version": "3.48.0",
"resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.48.0.tgz",
"integrity": "sha512-1slJgk89tWC51HQ1AEqG+s2VuwpTRr8ocu4n20QUcH1v9lAN0RXen0Q0AABa/DK1I7RrNWLucplOHMx8hfTGTw==",
"version": "3.47.0",
"resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.47.0.tgz",
"integrity": "sha512-BcxeDbzUrRnXGYIVAGFtcGQVNpFcUhVjr6W7F8XktvQW2iJP9e66GP6xdKotCRFlrxBvNIBrhwKteRXqMV86Nw==",
"hasInstallScript": true,
"license": "MIT",
"funding": {
@ -7158,9 +7139,9 @@
}
},
"node_modules/electron-to-chromium": {
"version": "1.5.279",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.279.tgz",
"integrity": "sha512-0bblUU5UNdOt5G7XqGiJtpZMONma6WAfq9vsFmtn9x1+joAObr6x1chfqyxFSDCAFwFhCQDrqeAr6MYdpwJ9Hg==",
"version": "1.5.267",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.267.tgz",
"integrity": "sha512-0Drusm6MVRXSOJpGbaSVgcQsuB4hEkMpHXaVstcPmhu5LIedxs1xNK/nIxmQIU/RPC0+1/o0AVZfBTkTNJOdUw==",
"license": "ISC"
},
"node_modules/emittery": {
@ -10891,18 +10872,6 @@
"@types/yargs-parser": "*"
}
},
"node_modules/jest-watch-typeahead/node_modules/ansi-styles": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz",
"integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==",
"license": "MIT",
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/jest-watch-typeahead/node_modules/emittery": {
"version": "0.10.2",
"resolved": "https://registry.npmjs.org/emittery/-/emittery-0.10.2.tgz",
@ -11490,9 +11459,9 @@
}
},
"node_modules/lodash": {
"version": "4.17.23",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz",
"integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==",
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"license": "MIT"
},
"node_modules/lodash.debounce": {
@ -13793,18 +13762,6 @@
"node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0"
}
},
"node_modules/pretty-format/node_modules/ansi-styles": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz",
"integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==",
"license": "MIT",
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/process-nextick-args": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
@ -14006,9 +13963,9 @@
}
},
"node_modules/react": {
"version": "19.2.4",
"resolved": "https://registry.npmjs.org/react/-/react-19.2.4.tgz",
"integrity": "sha512-9nfp2hYpCwOjAN+8TZFGhtWEwgvWHXqESH8qT89AT/lWklpLON22Lc8pEtnpsZz7VmawabSU0gCjnj8aC0euHQ==",
"version": "19.2.3",
"resolved": "https://registry.npmjs.org/react/-/react-19.2.3.tgz",
"integrity": "sha512-Ku/hhYbVjOQnXDZFv2+RibmLFGwFdeeKHFcOTlrt7xplBnya5OGn/hIRDsqDiSUcfORsDC7MPxwork8jBwsIWA==",
"license": "MIT",
"engines": {
"node": ">=0.10.0"
@ -14147,15 +14104,15 @@
}
},
"node_modules/react-dom": {
"version": "19.2.4",
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.4.tgz",
"integrity": "sha512-AXJdLo8kgMbimY95O2aKQqsz2iWi9jMgKJhRBAxECE4IFxfcazB2LmzloIoibJI3C12IlY20+KFaLv+71bUJeQ==",
"version": "19.2.3",
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.3.tgz",
"integrity": "sha512-yELu4WmLPw5Mr/lmeEpox5rw3RETacE++JgHqQzd2dg+YbJuat3jH4ingc+WPZhxaoFzdv9y33G+F7Nl5O0GBg==",
"license": "MIT",
"dependencies": {
"scheduler": "^0.27.0"
},
"peerDependencies": {
"react": "^19.2.4"
"react": "^19.2.3"
}
},
"node_modules/react-error-overlay": {
@ -14181,15 +14138,6 @@
"react-dom": ">=16"
}
},
"node_modules/react-icons": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/react-icons/-/react-icons-5.5.0.tgz",
"integrity": "sha512-MEFcXdkP3dLo8uumGI5xN3lDFNsRtrjbOEKDLD7yv76v4wpnEq2Lt2qeHaQOr34I/wPN3s3+N08WkQ+CW37Xiw==",
"license": "MIT",
"peerDependencies": {
"react": "*"
}
},
"node_modules/react-is": {
"version": "17.0.2",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
@ -14206,9 +14154,9 @@
}
},
"node_modules/react-router": {
"version": "7.13.0",
"resolved": "https://registry.npmjs.org/react-router/-/react-router-7.13.0.tgz",
"integrity": "sha512-PZgus8ETambRT17BUm/LL8lX3Of+oiLaPuVTRH3l1eLvSPpKO3AvhAEb5N7ihAFZQrYDqkvvWfFh9p0z9VsjLw==",
"version": "7.12.0",
"resolved": "https://registry.npmjs.org/react-router/-/react-router-7.12.0.tgz",
"integrity": "sha512-kTPDYPFzDVGIIGNLS5VJykK0HfHLY5MF3b+xj0/tTyNYL1gF1qs7u67Z9jEhQk2sQ98SUaHxlG31g1JtF7IfVw==",
"license": "MIT",
"dependencies": {
"cookie": "^1.0.1",
@ -14836,9 +14784,9 @@
"license": "CC0-1.0"
},
"node_modules/sass": {
"version": "1.97.3",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.97.3.tgz",
"integrity": "sha512-fDz1zJpd5GycprAbu4Q2PV/RprsRtKC/0z82z0JLgdytmcq0+ujJbJ/09bPGDxCLkKY3Np5cRAOcWiVkLXJURg==",
"version": "1.97.2",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.97.2.tgz",
"integrity": "sha512-y5LWb0IlbO4e97Zr7c3mlpabcbBtS+ieiZ9iwDooShpFKWXf62zz5pEPdwrLYm+Bxn1fnbwFGzHuCLSA9tBmrw==",
"license": "MIT",
"dependencies": {
"chokidar": "^4.0.0",
@ -15078,25 +15026,21 @@
}
},
"node_modules/serve-index": {
"version": "1.9.2",
"resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.2.tgz",
"integrity": "sha512-KDj11HScOaLmrPxl70KYNW1PksP4Nb/CLL2yvC+Qd2kHMPEEpfc4Re2e4FOay+bC/+XQl/7zAcWON3JVo5v3KQ==",
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz",
"integrity": "sha512-pXHfKNP4qujrtteMrSBb0rc8HJ9Ms/GrXwcUtUtD5s4ewDJI8bT3Cz2zTVRMKtri49pLx2e0Ya8ziP5Ya2pZZw==",
"license": "MIT",
"dependencies": {
"accepts": "~1.3.8",
"accepts": "~1.3.4",
"batch": "0.6.1",
"debug": "2.6.9",
"escape-html": "~1.0.3",
"http-errors": "~1.8.0",
"mime-types": "~2.1.35",
"parseurl": "~1.3.3"
"http-errors": "~1.6.2",
"mime-types": "~2.1.17",
"parseurl": "~1.3.2"
},
"engines": {
"node": ">= 0.8.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/express"
}
},
"node_modules/serve-index/node_modules/debug": {
@ -15118,27 +15062,38 @@
}
},
"node_modules/serve-index/node_modules/http-errors": {
"version": "1.8.1",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz",
"integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==",
"version": "1.6.3",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz",
"integrity": "sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A==",
"license": "MIT",
"dependencies": {
"depd": "~1.1.2",
"inherits": "2.0.4",
"setprototypeof": "1.2.0",
"statuses": ">= 1.5.0 < 2",
"toidentifier": "1.0.1"
"inherits": "2.0.3",
"setprototypeof": "1.1.0",
"statuses": ">= 1.4.0 < 2"
},
"engines": {
"node": ">= 0.6"
}
},
"node_modules/serve-index/node_modules/inherits": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==",
"license": "ISC"
},
"node_modules/serve-index/node_modules/ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
"license": "MIT"
},
"node_modules/serve-index/node_modules/setprototypeof": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz",
"integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==",
"license": "ISC"
},
"node_modules/serve-index/node_modules/statuses": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
@ -16720,16 +16675,17 @@
}
},
"node_modules/typescript": {
"version": "4.9.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
"integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
"version": "5.9.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
"license": "Apache-2.0",
"peer": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=4.2.0"
"node": ">=14.17"
}
},
"node_modules/unbox-primitive": {
@ -16756,6 +16712,12 @@
"integrity": "sha512-hEQt0+ZLDVUMhebKxL4x1BTtDY7bavVofhZ9KZ4aI26X9SRaE+Y3m83XUL1UP2jn8ynjndwCCpEHdUG+9pP1Tw==",
"license": "MIT"
},
"node_modules/undici-types": {
"version": "7.16.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz",
"integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==",
"license": "MIT"
},
"node_modules/unicode-canonical-property-names-ecmascript": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.1.tgz",
@ -17774,6 +17736,21 @@
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
}
},
"node_modules/wrap-ansi/node_modules/ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"license": "MIT",
"dependencies": {
"color-convert": "^2.0.1"
},
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",

View File

@ -1,6 +1,6 @@
{
"name": "react-crypto",
"version": "0.2.0",
"version": "0.1.0",
"private": true,
"scripts": {
"build": "react-scripts build",
@ -32,10 +32,6 @@
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.1",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.5.2",
"@types/node": "^16.18.126",
"@types/react": "^19.2.9",
"@types/react-dom": "^19.2.3",
"axios": "^1.13.0",
"chart.js": "^4.5.0",
"chartjs-adapter-date-fns": "^3.0.0",
@ -44,12 +40,10 @@
"react-chartjs-2": "^5.3.0",
"react-dom": "^19.2.0",
"react-hot-toast": "^2.6.0",
"react-icons": "^5.5.0",
"react-router": "^7.7.0",
"react-scripts": "5.0.1",
"react-spinners": "^0.17.0",
"sass": "^1.97.0",
"typescript": "^4.9.5",
"web-vitals": "^2.1.4",
"zustand": "^5.0.0"
}

View File

@ -24,7 +24,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Crypto-Viewer</title>
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>

View File

@ -1,38 +0,0 @@
.App {
text-align: center;
}
.App-logo {
height: 40vmin;
pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
}
.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}
.App-link {
color: #61dafb;
}
@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

View File

@ -8,7 +8,6 @@ import Footer from "./components/footer";
import "./styles/main.scss";
const App = () => {
return (
<>
<Header />
@ -19,9 +18,9 @@ const App = () => {
<Route path="*" element={<NotFound />} />
</Routes>
<Footer />
</>
);
};

View File

@ -1,4 +1,3 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import App from './App';

View File

@ -1,13 +1,7 @@
import React from "react";
import { Link } from "react-router";
import { nameShorten } from "../utils/string-helper";
import { ICoinMarketData } from "../utils/interfaces";
interface ICoin {
coin: ICoinMarketData;
}
const CoinCard: React.FC<ICoin> = ({ coin }) => {
const CoinCard = ({ coin }) => {
return (
<Link to={`/coin/${coin.id}`} >
@ -20,13 +14,16 @@ const CoinCard: React.FC<ICoin> = ({ coin }) => {
<p>
Price: <span>$ {coin.current_price.toLocaleString()}</span>
</p>
<p className={coin.price_change_percentage_24h >= 0 ? 'positive' : 'negative'}>
<p className={
coin?.price_change_percentage_24h
? coin.price_change_percentage_24h >= 0 ? 'positive' : 'negative'
: ''
}>
{/* coin.price_change_percentage_24h.toFixed(2) */}
{/* {parseFloat(coin?.price_change_percentage_24h || 0).toFixed(2)} */}
{coin.price_change_percentage_24h.toFixed(2)} %
{parseFloat(coin?.price_change_percentage_24h || 0).toFixed(2)}
</p>
<p>
Market Cap: <span>{coin?.market_cap.toLocaleString()}</span>
Market Cap: <span>{parseInt(coin?.market_cap || 0).toLocaleString()}</span>
</p>
</div>
</Link>

View File

@ -1,4 +1,4 @@
import React, { useState, useEffect } from "react";
import { useState, useEffect } from "react";
import { Line } from "react-chartjs-2";
import {
Chart as ChartJS,
@ -24,33 +24,9 @@ ChartJS.register(
TimeScale
);
interface ICoinChartProps {
coinId: string;
}
const CoinChart = ({ coinId }) => {
interface IQuote {
x: number;
y: number;
}
interface IDataSet {
label: string;
data: IQuote[];
fill: boolean;
borderColor: string;
backgroundColor: string;
pointRadius: number;
tension: number;
}
interface IChartData {
datasets: IDataSet[],
}
const CoinChart: React.FC<ICoinChartProps> = ({ coinId }) => {
const [chartData, setChartData] = useState<IChartData | null>(null);
const [chartData, setChartData] = useState(null);
const error = useCoinPricesStore(state => state.error);
const coinPrices = useCoinPricesStore(state => state.coinPrices);
@ -62,11 +38,11 @@ const CoinChart: React.FC<ICoinChartProps> = ({ coinId }) => {
useEffect(() => {
if (coinPrices) {
const quotes: IQuote[] = coinPrices.map(price => {
const quotes = coinPrices.prices.map(price => {
return {
x: price.timestamp,
y: price.price,
} as IQuote;
x: price[0],
y: price[1],
}
});
setChartData({
datasets: [

View File

@ -1,11 +1,5 @@
import React from "react";
import { ICoinInfo } from "../utils/interfaces";
interface ICoinInfoProps {
coin: ICoinInfo;
}
const CoinInfo: React.FC<ICoinInfoProps> = ({ coin }) => {
const CoinInfo = ({ coin }) => {
return (
<>
@ -15,9 +9,9 @@ const CoinInfo: React.FC<ICoinInfoProps> = ({ coin }) => {
{coin && (
<>
<img src={coin?.image_large} alt={coin?.name} className="coin-details-image" />
<img src={coin?.image?.large} alt={coin?.name} className="coin-details-image" />
<p className="coin-details-description">
{coin?.description?.split(". ")[0] + "."}
{coin?.description?.en.split(". ")[0] + "."}
</p>
<div className="coin-details-info">
<h3>
@ -26,20 +20,20 @@ const CoinInfo: React.FC<ICoinInfoProps> = ({ coin }) => {
<h3>
Current Price: {" "}
<span>
${coin.market_data.current_price.toLocaleString()}
${coin.market_data.current_price.usd.toLocaleString()}
</span>
</h3>
<h4>
Market Cap:{" "}
<span>${coin.market_data.market_cap.toLocaleString()}</span>
<span>${coin.market_data.market_cap.usd.toLocaleString()}</span>
</h4>
<h4>
24h High:{" "}
<span>${coin.market_data.high_24h.toLocaleString()}</span>
<span>${coin.market_data.high_24h.usd.toLocaleString()}</span>
</h4>
<h4>
24h Low:{" "}
<span>${coin.market_data.low_24h.toLocaleString()}</span>
<span>${coin.market_data.low_24h.usd.toLocaleString()}</span>
</h4>
<h4>
24h Price Change:{" "}
@ -48,7 +42,6 @@ const CoinInfo: React.FC<ICoinInfoProps> = ({ coin }) => {
{coin.market_data.price_change_percentage_24h.toFixed(2)}%)
</span>
</h4>
{/*
<h4>
Circulating Supply:{" "}
<span>
@ -61,19 +54,18 @@ const CoinInfo: React.FC<ICoinInfoProps> = ({ coin }) => {
{coin.market_data.total_supply?.toLocaleString() || "N/A"}
</span>
</h4>
*/}
<h4>
All-Time High:{" "}
<span>
${coin.market_data.ath.toLocaleString()} on{" "}
{new Date(coin.market_data.ath_date).toLocaleDateString()}
${coin.market_data.ath.usd.toLocaleString()} on{" "}
{new Date(coin.market_data.ath_date.usd).toLocaleDateString()}
</span>
</h4>
<h4>
All-Time Low:{" "}
<span>
${coin.market_data.atl.toLocaleString()} on{" "}
{new Date(coin.market_data.atl_date).toLocaleDateString()}
${coin.market_data.atl.usd.toLocaleString()} on{" "}
{new Date(coin.market_data.atl_date.usd).toLocaleDateString()}
</span>
</h4>
<h4>

View File

@ -1,13 +1,7 @@
import React from "react";
import { messages } from "../utils/constants";
import RefreshButton from "./refresh-button";
export interface IErrorCardProps {
message: string;
}
const ErrorCard: React.FC<IErrorCardProps> = ({ message }) => {
const ErrorCard = ({ message }) => {
return (
<>

View File

@ -1,17 +1,16 @@
import React from "react";
import { useFilterStore } from "../store/controls";
import { messages } from "../utils/constants";
const FilterInput: React.FC = () => {
const FilterInput = () => {
const toggleFilter = useFilterStore(state => state.toggleFilter);
const onFilterChange = (e: React.ChangeEvent<HTMLInputElement>) => {
const onFilterChange = (e) => {
toggleFilter(e.target.value);
}
return (
<div className="filter">
<input type="text" placeholder={messages.filterPlaceholder} onChange={(e) => onFilterChange(e)}></input>
<input type="text" placeholder={messages.filterPlaceholder} onChange={(e) => onFilterChange(e)} />
</div>
);
};

View File

@ -1,7 +1,6 @@
import React from "react";
import { footerLinkUrl, footerLinkText } from "../utils/conf";
const Footer: React.FC = () => {
const Footer = () => {
return (
<footer>
<p>&copy; {new Date().getFullYear()}</p>

View File

@ -1,7 +1,6 @@
import React from "react";
import { Link } from "react-router";
const Header: React.FC = () => {
const Header = () => {
return (
<div className="nav-box">
<Link to="/">Home</Link>

View File

@ -1,15 +1,14 @@
import React from "react";
import { useLimitStore } from "../store/controls";
import { fetchCoins, getCoinsLength } from "../store/coins-market";
const LimitSelector: React.FC = () => {
const LimitSelector = () => {
const limit = useLimitStore(state => state.limit);
const toggleLimit = useLimitStore(state => state.toggleLimit);
const onSelectChange = (e: React.ChangeEvent<HTMLSelectElement>) => {
const onSelectChange = (e) => {
toggleLimit(parseInt(e.target.value));
fetchCoins(parseInt(e.target.value));
fetchCoins( parseInt( e.target.value ) );
}
return (

View File

@ -1,13 +1,11 @@
import React from "react";
import { fetchCoins, getCoinsLength } from "../store/coins-market";
import { getTimestampOfLastPersist } from "../store/coins-market";
import toast, { Toaster } from "react-hot-toast";
import { messages } from "../utils/constants";
import { MdRefresh } from "react-icons/md";
const notify = (text: string) => toast.error(text, { duration: 3000, id: "reloadRapidDisallowed", style: { textAlign: 'center' } });
const notify = (text) => toast.error(text, { duration: 3000, id: "reloadRapidDisallowed", style: { textAlign: 'center' } });
const RefreshButton: React.FC = () => {
const RefreshButton = () => {
const onButonClick = () => {
if (Date.now() > getTimestampOfLastPersist() + 3000) fetchCoins(getCoinsLength() || 10);
@ -16,12 +14,7 @@ const RefreshButton: React.FC = () => {
return (
<>
<button className="refresh-btn" onClick={(e) => onButonClick()} >
<span className="icon">
<MdRefresh />
</span>
Reload
</button>
<button className="refresh-btn" onClick={(e) => onButonClick()} > Reload</button>
<Toaster />
</>
);

View File

@ -1,12 +1,11 @@
import React from "react";
import { SortBy } from "../utils/enum";
import { useSortByStore } from "../store/controls";
const SortSelector: React.FC = () => {
const SortSelector = () => {
const sortBy = useSortByStore(state => state.sortBy);
const toggleSortBy = useSortByStore(state => state.toggleSortBy);
const onSelectChange = (e: React.ChangeEvent<HTMLSelectElement>) => {
const onSelectChange = (e) => {
toggleSortBy(e.target.value);
}

View File

@ -1,4 +1,3 @@
import React from "react";
import { BarLoader } from "react-spinners";
const override = {
@ -6,12 +5,7 @@ const override = {
margin: "0 auto 50px auto",
};
interface ISpinnerProps {
color?: string;
width?: number;
}
const Spinner: React.FC<ISpinnerProps> = ({ color = "blue", width = 200 }) => {
const Spinner = ({ color = "blue", width = 200 }) => {
return (
<div>
<BarLoader color={color} width={width} cssOverride={override} aria-label="Loading..." />

14
src/index.js Normal file
View File

@ -0,0 +1,14 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import { BrowserRouter } from "react-router";
import './index.css';
import App from './App';
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
//<React.StrictMode>
<BrowserRouter>
<App />
</BrowserRouter>
//</React.StrictMode>
);

View File

@ -1,22 +0,0 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import { BrowserRouter } from "react-router";
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
const root = ReactDOM.createRoot(
document.getElementById('root') as HTMLElement
);
root.render(
//<React.StrictMode>
<BrowserRouter>
<App />
</BrowserRouter>
//</React.StrictMode>
);
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
//reportWebVitals();

View File

@ -1,7 +1,6 @@
import React from "react";
import { messages } from "../utils/constants";
const About: React.FC = () => {
const About = () => {
return (
<div className="about">
<h1>📈 Crypto Viewer</h1>

View File

@ -1,4 +1,3 @@
import React from "react";
import { Link, useParams } from "react-router";
import CoinInfo from "../components/coin-info";
import { useCoinInfoStore, reset, fetchCoinInfos } from "../store/coin-info";
@ -6,9 +5,9 @@ import { useEffect } from "react";
import CoinChart from "../components/coin-chart";
import Spinner from "../components/spinner";
const CoinDetail: React.FC = () => {
const CoinDetail = () => {
const { id } = useParams<string>();
const { id } = useParams();
const coin = useCoinInfoStore(state => state.coinInfo);
const loading = useCoinInfoStore(state => state.loading);
@ -20,7 +19,7 @@ const CoinDetail: React.FC = () => {
useEffect(() => {
const fetch = async () => {
fetchCoinInfos(String(id));
fetchCoinInfos(id);
}
fetch();
}, [id]);

View File

@ -1,4 +1,3 @@
import React from "react";
import { useEffect, useRef } from "react";
import FilterInput from "../components/filter-input";
import LimitSelector from "../components/limit-selector";
@ -11,9 +10,8 @@ import Spinner from "../components/spinner";
import RefreshButton from "../components/refresh-button";
import ErrorCard from "../components/error-card";
import { initialCoinsCoint } from "../utils/conf";
import { ICoinMarketData } from "../utils/interfaces";
const Home: React.FC = () => {
const Home = () => {
const coins = useCoinsMarketStore(state => state.coins);
const loading = useCoinsMarketStore(state => state.loading);
@ -28,7 +26,7 @@ const Home: React.FC = () => {
}
}, []);
let filteredCoins: ICoinMarketData[] = [];
let filteredCoins = [];
if (coins) {
filteredCoins = coinsFilter(coins, filter, sortBy);

View File

@ -1,7 +1,6 @@
import React from "react";
import { Link } from "react-router";
const NotFound: React.FC = () => {
const NotFound = () => {
return (
<div className="not-found-container">
<h1 className="title">404</h1>

View File

@ -1 +0,0 @@
/// <reference types="react-scripts" />

View File

@ -1,6 +1,4 @@
import { ReportHandler } from 'web-vitals';
const reportWebVitals = (onPerfEntry?: ReportHandler) => {
const reportWebVitals = onPerfEntry => {
if (onPerfEntry && onPerfEntry instanceof Function) {
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
getCLS(onPerfEntry);

86
src/store/coin-info.js Normal file
View File

@ -0,0 +1,86 @@
import { create } from "zustand";
import axios from "axios";
import { join } from "../utils/path";
import { messages } from "../utils/constants";
import { apiBaseUrl, apiKey } from "../utils/conf";
import sleep from "../utils/sleep";
const init = {
coinId: null,
coinInfo: null,
loading: false,
error: null,
ts: 0,
}
export const useCoinInfoStore = create((set, get) => ({
...init,
clear: () => {
set(state => ({
coinId: null,
coinInfo: null,
}))
},
persistCoinInfo: (coinId, coinInfo) => {
set(state => ({
coinId: coinId,
coinInfo: coinInfo,
ts: Date.now(),
}))
},
setError: (message) => {
set(state => ({
error: message,
}))
},
fetch: async (id) => {
try {
set({ loading: true });
if (get().ts) await sleep(get().ts);
const keyParam = (apiKey()) ? `?x_cg_demo_api_key=${apiKey()}` : "";
const url = join(
apiBaseUrl(),
`coins/${id}${keyParam}`
);
const res = await axios.get(url);
get().persistCoinInfo(id, res.data);
} catch (err) {
switch (err.code) {
case 'ERR_NETWORK':
get().setError(messages.serverOverload);
break;
default:
get().setError(err.message);
}
} finally {
set({ loading: false });
}
}
}));
export const reset = () => {
useCoinInfoStore.getState().clear();
}
export const persist = (coinId, coinInfo) => {
useCoinInfoStore.getState().persistCoinPrices(coinId, coinInfo);
};
export const toggleLoading = (isLoading) => {
useCoinInfoStore.setState({ loading: isLoading })
};
export const errorLoading = (message) => {
useCoinInfoStore.setState()({ error: message });
};
export const fetchCoinInfos = (coinId) => {
useCoinInfoStore.getState().fetch(coinId);
};
export const getTimestampOfLastPersist = () => {
return useCoinInfoStore.getState().ts;
}

View File

@ -1,146 +0,0 @@
import { create } from "zustand";
import axios from "axios";
import { join } from "../utils/path";
import { messages } from "../utils/constants";
import { apiBaseUrl, apiKey } from "../utils/conf";
import sleep from "../utils/sleep";
import { ICoinInfo, ICoinInfoMarketData } from "../utils/interfaces";
const init = {
coinId: null,
coinInfo: null,
loading: false,
error: null,
ts: 0,
}
interface ICoinsInfoState {
coinId: string | null;
coinInfo: ICoinInfo | null;
loading: boolean;
error: string | null;
ts: number;
clear: () => void;
persistCoinInfo: (coinId: string, coinInfo: ICoinInfo) => void;
setError: (message: string) => void;
fetch: (id: string) => void;
}
export const useCoinInfoStore = create<ICoinsInfoState>((set, get) => ({
...init,
clear: () => {
set(state => ({
coinId: null,
coinInfo: null,
}))
},
persistCoinInfo: (coinId, coinInfo) => {
set(state => ({
coinId: coinId,
coinInfo: coinInfo,
ts: Date.now(),
}))
},
setError: (message) => {
set(state => ({
error: message,
}))
},
fetch: async (id) => {
try {
set({ loading: true });
if (get().ts) await sleep(get().ts);
const keyParam = (apiKey()) ? `?x_cg_demo_api_key=${apiKey()}` : "";
const url = join(
apiBaseUrl(),
`coins/${id}${keyParam}`
);
const res = await axios.get(url);
const { symbol, name, image, description, market_cap_rank, last_updated } = res.data;
const {
current_price,
market_cap,
high_24h,
low_24h,
price_change_24h,
price_change_percentage_24h,
circulating_supply,
total_supply,
ath_date,
atl_date,
ath,
atl
} = res.data?.market_data;
const coinInfo: ICoinInfo = {
id: res.data?.id ?? "",
symbol: symbol ?? "",
name: name ?? "",
image_thumb: image?.thumb ?? "",
image_small: image?.small ?? "",
image_large: image?.large ?? "",
description: description?.en ?? "",
market_cap_rank: market_cap_rank ?? 0,
last_updated: last_updated ?? 0,
market_data: {
current_price: current_price?.usd ?? 0,
market_cap: market_cap?.usd ?? 0,
high_24h: high_24h?.usd ?? 0,
low_24h: low_24h?.usd ?? 0,
price_change_24h: price_change_24h ?? 0,
price_change_percentage_24h: price_change_percentage_24h ?? 0,
circulating_supply: circulating_supply ?? 0,
total_supply: total_supply ?? 0,
ath_date: ath_date?.usd ?? "",
atl_date: atl_date?.usd ?? "",
ath: ath?.usd ?? 0,
atl: atl?.usd ?? 0,
}
}
get().persistCoinInfo(id, coinInfo);
} catch (err) {
if (axios.isAxiosError(err)) {
switch (err.code) {
case 'ERR_NETWORK':
get().setError(messages.serverOverload);
break;
default:
get().setError(err.message);
}
}
else {
get().setError((err as Error).message);
}
} finally {
set({ loading: false });
}
}
}));
export const reset = () => {
useCoinInfoStore.getState().clear();
}
export const persist = (coinId: string, coinInfo: ICoinInfo) => {
useCoinInfoStore.getState().persistCoinInfo(coinId, coinInfo);
};
export const toggleLoading = (isLoading: boolean) => {
useCoinInfoStore.setState({ loading: isLoading })
};
export const errorLoading = (message: string) => {
useCoinInfoStore.getState().setError(message);
};
export const fetchCoinInfos = (coinId: string) => {
useCoinInfoStore.getState().fetch(coinId);
};
export const getTimestampOfLastPersist = () => {
return useCoinInfoStore.getState().ts;
}

View File

@ -4,7 +4,6 @@ import { join } from "../utils/path";
import { messages } from "../utils/constants";
import { apiBaseUrl, apiKey } from "../utils/conf";
import sleep from "../utils/sleep";
import { ICoinMarketData } from "../utils/interfaces";
const init = {
coins: null,
@ -14,20 +13,7 @@ const init = {
ts: 0,
}
interface ICoinsMarketState {
coins: ICoinMarketData[] | null;
size: number;
loading: boolean;
error: string | null;
ts: number;
reset: () => void;
persistCoins: (coins: ICoinMarketData[]) => void;
setError: (message: string) => void;
fetch: (limit: number) => void;
}
export const useCoinsMarketStore = create<ICoinsMarketState>((set, get) => {
export const useCoinsMarketStore = create((set, get) => {
return {
...init,
reset: () => {
@ -35,6 +21,18 @@ export const useCoinsMarketStore = create<ICoinsMarketState>((set, get) => {
...init,
}))
},
addCoins: (coins) => {
set(state => ({
coins: [...state.coins, ...coins]
}))
},
removeCoin: (coinId) => {
set(state => ({
coins: state.coins.filter(coin => coin.id !== coinId)
}))
},
persistCoins: (coins) => {
set(state => ({
size: coins.length,
@ -58,23 +56,8 @@ export const useCoinsMarketStore = create<ICoinsMarketState>((set, get) => {
`coins/markets?vs_currency=usd&order=market_cap_desc&per_page=${limit}&page=1&sparkline=false${keyParam}`,
);
const res = await axios.get(url);
const coins: ICoinMarketData[] = res.data.map((item: any) => {
const obj: ICoinMarketData = {
id: item["id"],
symbol: item["symbol"],
name: item["name"],
image: item["image"],
current_price: parseFloat(item["current_price"]),
market_cap: parseInt(item["market_cap"]),
market_cap_rank: parseInt(item["market_cap_rank"]),
price_change_percentage_24h: parseFloat(item["price_change_percentage_24h"]),
}
return obj;
});
get().persistCoins(coins);
get().persistCoins(res.data);
} catch (err) {
if (axios.isAxiosError(err)) {
switch (err.code) {
case 'ERR_NETWORK':
get().setError(messages.serverOverload);
@ -82,9 +65,6 @@ export const useCoinsMarketStore = create<ICoinsMarketState>((set, get) => {
default:
get().setError(err.message);
}
} else {
get().setError((err as Error).message);
}
} finally {
set({ loading: false });
}
@ -97,19 +77,23 @@ export const reset = () => {
useCoinsMarketStore.getState().reset();
}
export const tsLastFetch = () => {
return useCoinsMarketStore.getState().ts;
}
export const getTimestampOfLastPersist = () => {
return useCoinsMarketStore.getState().ts;
}
export const persist = (coins: any[]) => {
export const persist = (coins) => {
useCoinsMarketStore.getState().persistCoins(coins);
};
export const toggleLoading = (isLoading: boolean) => {
export const toggleLoading = (isLoading) => {
useCoinsMarketStore.setState({ loading: isLoading })
};
export const errorLoading = (message: string) => {
export const errorLoading = (message) => {
useCoinsMarketStore.getState().setError(message);
};

View File

@ -1,9 +1,9 @@
import { create } from "zustand";
import axios, { AxiosError } from "axios";
import axios from "axios";
import { join } from "../utils/path";
import { messages } from "../utils/constants";
import { apiBaseUrl, apiKey } from "../utils/conf";
import { ICoinPrice } from "../utils/interfaces"
import sleep from "../utils/sleep";
const init = {
coinId: null,
@ -12,18 +12,7 @@ const init = {
error: null,
}
interface ICoinPricesState {
coinId: string | null;
coinPrices: ICoinPrice[] | null;
loading: boolean;
error: string | null;
reset: () => void;
persistCoinPrices: (coinId: string, coinPrices: ICoinPrice[]) => void;
setError: (message: string) => void;
fetch: (coinId: string, limit: number) => void;
}
export const useCoinPricesStore = create<ICoinPricesState>((set, get) => {
export const useCoinPricesStore = create((set, get) => {
return {
...init,
reset: () => {
@ -45,21 +34,12 @@ export const useCoinPricesStore = create<ICoinPricesState>((set, get) => {
fetch: async (coinId, limit) => {
try {
set({ loading: true });
if (get().ts) await sleep(get().ts);
const keyParam = (apiKey()) ? `&x_cg_demo_api_key=${apiKey()}` : "";
const url = join(apiBaseUrl(), `coins/${coinId}/market_chart?vs_currency=usd&days=${limit}${keyParam}`);
const res = await axios.get(url);
let prices: ICoinPrice[] = res.data?.["prices"].map((item: any) => {
let price: ICoinPrice = {
price: item[1],
timestamp: item[0],
}
return price;
});
get().persistCoinPrices(coinId, prices);
get().persistCoinPrices(coinId, res.data);
} catch (err) {
if (axios.isAxiosError(err)) {
switch (err.code) {
case 'ERR_NETWORK':
get().setError(messages.serverOverload);
@ -67,9 +47,6 @@ export const useCoinPricesStore = create<ICoinPricesState>((set, get) => {
default:
get().setError(err.message);
}
} else {
get().setError((err as Error).message);
}
} finally {
set({ loading: false });
}
@ -81,18 +58,18 @@ export const reset = () => {
useCoinPricesStore.getState().reset();
}
export const persist = (coinId: string, prices: ICoinPrice[]) => {
export const persist = (coinId, prices) => {
useCoinPricesStore.getState().persistCoinPrices(coinId, prices);
};
export const toggleLoading = (isLoading: boolean) => {
export const toggleLoading = (isLoading) => {
useCoinPricesStore.setState({ loading: isLoading })
};
export const errorLoading = (message: string) => {
export const errorLoading = (message) => {
useCoinPricesStore.setState({ error: message });
};
export const fetchCoinPrices = (coinId: string, limit = 10) => {
export const fetchCoinPrices = (coinId, limit = 10) => {
useCoinPricesStore.getState().fetch(coinId, limit);
};

View File

@ -1,13 +1,7 @@
import { create } from "zustand";
import { SortBy } from "../utils/enum";
interface IRefreshControlStore {
previousRefreshDatetime: number | null;
refreshDatetime: number | null;
refresh: () => void;
}
export const useRefreshStore = create<IRefreshControlStore>((set, get) => {
export const useRefreshStore = create((set, get) => {
return {
previousRefreshDatetime: null,
refreshDatetime: null,
@ -20,13 +14,7 @@ export const useRefreshStore = create<IRefreshControlStore>((set, get) => {
}
});
interface IFilterControlStore {
filter: string;
toggleFilter: (filter: string) => void;
}
export const useFilterStore = create<IFilterControlStore>((set, get) => {
export const useFilterStore = create((set, get) => {
return {
filter: "",
toggleFilter: (filter) => {
@ -38,16 +26,10 @@ export const useFilterStore = create<IFilterControlStore>((set, get) => {
});
export const clearFilter = () => {
useFilterStore.setState({ filter: "" });
useFilterStore.setState({filter: ""});
}
interface ISortByControlStore {
sortBy: string;
toggleSortBy: (sortBy: string) => void;
}
export const useSortByStore = create<ISortByControlStore>((set, get) => {
export const useSortByStore = create((set, get) => {
return {
sortBy: SortBy.MARKET_CAP_DESC,
toggleSortBy: (sortBy) => {
@ -58,12 +40,7 @@ export const useSortByStore = create<ISortByControlStore>((set, get) => {
}
});
interface ILimitControlStore {
limit: number;
toggleLimit: (limit: number) => void;
}
export const useLimitStore = create<ILimitControlStore>((set, get) => {
export const useLimitStore = create((set, get) => {
return {
limit: 10,
toggleLimit: (limit) => {

View File

@ -1,7 +1,7 @@
/* About Page */
.about {
max-width: 600px;
margin: 0rem auto;
margin: 2rem auto;
background-color: #161b22;
padding: 2rem;
border-radius: 12px;

View File

@ -1,6 +1,6 @@
.coin-details-container {
max-width: 700px;
margin: 0px auto;
margin: 40px auto;
text-align: center;
padding: 20px;
font-family: Arial, sans-serif;
@ -44,7 +44,7 @@
h3,
h4 {
margin: 4px 0;
margin: 5px 0;
color: #222;
}

View File

@ -1,3 +1,9 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: $background-color;
@ -9,12 +15,10 @@ body {
h1 {
margin-bottom: 2rem;
font-size: 2rem;
font-weight: 600;
}
h2 {
font-size: 1.2rem;
font-weight: 600;
}
a {

View File

@ -53,8 +53,7 @@
button {
&.refresh-btn {
position: relative;
padding: 0.75rem 0.5rem 0.75rem 2rem;
padding: 0.75rem 1rem;
border-radius: 8px;
border: none;
background: $controls-bg-color;
@ -65,12 +64,5 @@ button {
&:hover {
background: #2b303a;
}
.icon {
position: absolute;
left: 5px;
top: 8px;
font-size: 1.5rem;
}
}
}

View File

@ -1,30 +0,0 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html {
box-sizing: border-box;
font-size: 16px;
}
*, *:before, *:after {
box-sizing: inherit;
}
body, h1, h2, h3, h4, h5, h6, p, ol, ul {
margin: 0;
padding: 0;
font-weight: normal;
}
ol, ul {
list-style: none;
}
img {
max-width: 100%;
height: auto;
}

View File

@ -1,6 +1,5 @@
@import 'variables';
@import 'reset';
@import 'global';
@import 'common';
@import 'controls';
@import 'nav';
@import 'about';

View File

@ -1,7 +1,6 @@
import { SortBy } from "./enum";
import { ICoinMarketData } from "../utils/interfaces";
export const coinsFilter = (coins: ICoinMarketData[], filter: string, sortBy: string) => {
export const coinsFilter = (coins, filter, sortBy) => {
let filteredCoins = coins
.filter(coin => {
return (

View File

@ -1,10 +1,10 @@
const env = process.env;
export const apiBaseUrl = () => env?.REACT_APP_CRYPTO_API || "";
export const apiReloadWaitTime = () => env?.REACT_APP_API_RELOAD_WAIT_TIME ? parseInt(env.REACT_APP_API_RELOAD_WAIT_TIME) : 3000;
export const isNetworkOnline = () => env?.REACT_APP_NETWORK_ONLINE ? Boolean(env.REACT_APP_NETWORK_ONLINE) : true;
export const rateLimitInterval = () => env?.REACT_APP_NETWORK_RATE_LIMIT_INTERVAL ? parseInt(env.REACT_APP_NETWORK_RATE_LIMIT_INTERVAL) : 5000;
export const apiReloadWaitTime = () => env?.REACT_APP_API_RELOAD_WAIT_TIME || 3000;
export const isNetworkOnline = () => env?.REACT_APP_NETWORK_ONLINE || true;
export const rateLimitInterval = () => env?.REACT_APP_NETWORK_RATE_LIMIT_INTERVAL || 5000;
export const apiKey = () => env?.REACT_APP_CRYPTO_API_KEY || "";
export const footerLinkUrl = () => env?.REACT_APP_FOOTER_LINK_URL || "";
export const footerLinkText = () => env?.REACT_APP_FOOTER_LINK_TEXT || "";
export const initialCoinsCoint = () => env?.REACT_APP_INITIAL_COINS_COUNT ? parseInt(env.REACT_APP_INITIAL_COINS_COUNT) : 10;
export const initialCoinsCoint = () => env?.REACT_APP_INITIAL_COINS_COUNT || 10;

View File

@ -1,47 +0,0 @@
export interface ICoinPrice {
timestamp: number;
price: number;
}
export interface ICoinMarketData {
id: string;
symbol: string;
name: string;
image: string;
current_price: number;
market_cap: number;
market_cap_rank: number;
price_change_percentage_24h: number,
}
export interface ICoinInfoMarketData {
//currency: string;
current_price:number;
market_cap:number;
high_24h:number;
low_24h:number;
price_change_24h:number;
price_change_percentage_24h:number;
circulating_supply:number;
total_supply:number;
ath_date:string;
ath:number;
atl_date:string;
atl:number;
}
export interface ICoinInfo {
id: string;
symbol: string;
name: string;
image_thumb:string;
image_small:string;
image_large:string;
description:string;
market_cap_rank:number;
last_updated:number;
market_data: ICoinInfoMarketData;
}

View File

@ -3,17 +3,21 @@
* @param {...string} segments
* @return {string}
*/
export const join = (...segments: string[]) => {
const partss = segments.reduce((parts: any, segment: string) => {
export const join = (...segments) => {
const parts = segments.reduce((parts, segment) => {
// Remove leading slashes from non-first part
if (parts.length > 0) segment = segment.replace(/^\//, '')
if (parts.length > 0) {
segment = segment.replace(/^\//, '')
}
// Remove trailing slashes
segment = segment.replace(/\/$/, '')
return parts.concat(segment.split('/'));
return parts.concat(segment.split('/'))
}, [])
const resultParts: string[] = []
for (const part of partss) {
if (part === '.') continue;
const resultParts = []
for (const part of parts) {
if (part === '.') {
continue
}
if (part === '..') {
resultParts.pop()
continue

View File

@ -1,7 +1,7 @@
import { rateLimitInterval } from "./conf";
const sleep = (lastTimestamp: number): Promise<undefined | any> => {
let p = new Promise(resolve => resolve(undefined));
const sleep = (lastTimestamp) => {
let p = new Promise(resolve => resolve());
const currentTimestamp = Date.now();
if (currentTimestamp < lastTimestamp + rateLimitInterval()) {
const iv = currentTimestamp - lastTimestamp;

View File

@ -1,9 +1,9 @@
const shorten = (text:string, maxLength:number):string => {
const shorten = (text, maxLength) => {
return text.slice(0, maxLength - 1);
}
const nameShorten = (text:string) => {
const nameShorten = (text) => {
let parts = text.split(" ");
return (parts.length >= 2) ? `${parts[0]} ${parts[1]}` : parts[0];
}

View File

@ -1,29 +0,0 @@
{
"compilerOptions": {
"target": "es2020",
"lib": [
"dom",
"dom.iterable",
"es2020"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
//"noUnusedLocals": true,
//"noUnusedParameters": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"allowImportingTsExtensions": true,
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
},
"include": [
"src"
]
}