From 48e8f9427a6dd0edde68488d6d8eb62127348faf Mon Sep 17 00:00:00 2001 From: Jamie Hewitt Date: Thu, 11 May 2023 19:52:47 +0300 Subject: [PATCH] Creating menu for app --- package-lock.json | 297 +++++++++++++----------- package.json | 2 +- src/components/{chart.tsx => Chart.tsx} | 0 src/components/Menu.module.css | 150 ++++++++++++ src/components/Menu.tsx | 38 +++ src/config/coreStats.json | 27 +++ src/pages/_app.tsx | 8 +- src/pages/stats.tsx | 9 +- src/styles/Home.module.css | 8 + src/utils/getStats.ts | 17 -- 10 files changed, 397 insertions(+), 159 deletions(-) rename src/components/{chart.tsx => Chart.tsx} (100%) create mode 100644 src/components/Menu.module.css create mode 100644 src/components/Menu.tsx create mode 100644 src/config/coreStats.json delete mode 100644 src/utils/getStats.ts diff --git a/package-lock.json b/package-lock.json index 24c2819..a45d38a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "axios": "^1.1.3", "chart.js": "^4.3.0", "dotenv": "^16.0.3", - "next": "12.3.1", + "next": "13.0.5", "react": "18.2.0", "react-chartjs-2": "^5.2.0", "react-dom": "18.2.0", @@ -2611,8 +2611,9 @@ "integrity": "sha512-fuscdXJ9G1qb7W8VdHi+IwRqij3lBkosAm4ydQtEmbY58OzHXqQhvlxqEkoz0yssNVn38bcpRWgA9PP+OGoisw==" }, "node_modules/@next/env": { - "version": "12.3.1", - "license": "MIT" + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@next/env/-/env-13.0.5.tgz", + "integrity": "sha512-F3KLtiDrUslAZhTYTh8Zk5ZaavbYwLUn3NYPBnOjAXU8hWm0QVGVzKIOuURQ098ofRU4e9oglf3Sj9pFx5nI5w==" }, "node_modules/@next/eslint-plugin-next": { "version": "12.3.1", @@ -2642,9 +2643,9 @@ } }, "node_modules/@next/swc-android-arm-eabi": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-12.3.1.tgz", - "integrity": "sha512-i+BvKA8tB//srVPPQxIQN5lvfROcfv4OB23/L1nXznP+N/TyKL8lql3l7oo2LNhnH66zWhfoemg3Q4VJZSruzQ==", + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-13.0.5.tgz", + "integrity": "sha512-YO691dxHlviy6H0eghgwqn+5kU9J3iQnKERHTDSppqjjGDBl6ab4wz9XfI5AhljjkaTg3TknHoIEWFDoZ4Ve8g==", "cpu": [ "arm" ], @@ -2657,9 +2658,9 @@ } }, "node_modules/@next/swc-android-arm64": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-android-arm64/-/swc-android-arm64-12.3.1.tgz", - "integrity": "sha512-CmgU2ZNyBP0rkugOOqLnjl3+eRpXBzB/I2sjwcGZ7/Z6RcUJXK5Evz+N0ucOxqE4cZ3gkTeXtSzRrMK2mGYV8Q==", + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@next/swc-android-arm64/-/swc-android-arm64-13.0.5.tgz", + "integrity": "sha512-ugbwffkUmp8cd2afehDC8LtQeFUxElRUBBngfB5UYSWBx18HW4OgzkPFIY8jUBH16zifvGZWXbICXJWDHrOLtw==", "cpu": [ "arm64" ], @@ -2672,9 +2673,9 @@ } }, "node_modules/@next/swc-darwin-arm64": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-12.3.1.tgz", - "integrity": "sha512-hT/EBGNcu0ITiuWDYU9ur57Oa4LybD5DOQp4f22T6zLfpoBMfBibPtR8XktXmOyFHrL/6FC2p9ojdLZhWhvBHg==", + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.0.5.tgz", + "integrity": "sha512-mshlh8QOtOalfZbc17uNAftWgqHTKnrv6QUwBe+mpGz04eqsSUzVz1JGZEdIkmuDxOz00cK2NPoc+VHDXh99IQ==", "cpu": [ "arm64" ], @@ -2687,9 +2688,9 @@ } }, "node_modules/@next/swc-darwin-x64": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-12.3.1.tgz", - "integrity": "sha512-9S6EVueCVCyGf2vuiLiGEHZCJcPAxglyckTZcEwLdJwozLqN0gtS0Eq0bQlGS3dH49Py/rQYpZ3KVWZ9BUf/WA==", + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-13.0.5.tgz", + "integrity": "sha512-SfigOKW4Z2UB3ruUPyvrlDIkcJq1hiw1wvYApWugD+tQsAkYZKEoz+/8emCmeYZ6Gwgi1WHV+z52Oj8u7bEHPg==", "cpu": [ "x64" ], @@ -2702,9 +2703,9 @@ } }, "node_modules/@next/swc-freebsd-x64": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-freebsd-x64/-/swc-freebsd-x64-12.3.1.tgz", - "integrity": "sha512-qcuUQkaBZWqzM0F1N4AkAh88lLzzpfE6ImOcI1P6YeyJSsBmpBIV8o70zV+Wxpc26yV9vpzb+e5gCyxNjKJg5Q==", + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@next/swc-freebsd-x64/-/swc-freebsd-x64-13.0.5.tgz", + "integrity": "sha512-0NJg8HZr4yG8ynmMGFXQf+Mahvq4ZgBmUwSlLXXymgxEQgH17erH/LoR69uITtW+KTsALgk9axEt5AAabM4ucg==", "cpu": [ "x64" ], @@ -2717,9 +2718,9 @@ } }, "node_modules/@next/swc-linux-arm-gnueabihf": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-12.3.1.tgz", - "integrity": "sha512-diL9MSYrEI5nY2wc/h/DBewEDUzr/DqBjIgHJ3RUNtETAOB3spMNHvJk2XKUDjnQuluLmFMloet9tpEqU2TT9w==", + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-13.0.5.tgz", + "integrity": "sha512-Cye+h3oDT3NDWjACMlRaolL8fokpKie34FlPj9nfoW7bYKmoMBY1d4IO/GgBF+5xEl7HkH0Ny/qex63vQ0pN+A==", "cpu": [ "arm" ], @@ -2732,9 +2733,9 @@ } }, "node_modules/@next/swc-linux-arm64-gnu": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-12.3.1.tgz", - "integrity": "sha512-o/xB2nztoaC7jnXU3Q36vGgOolJpsGG8ETNjxM1VAPxRwM7FyGCPHOMk1XavG88QZSQf+1r+POBW0tLxQOJ9DQ==", + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.0.5.tgz", + "integrity": "sha512-5BfDS/VoRDR5QUGG9oedOCEZGmV2zxUVFYLUJVPMSMeIgqkjxWQBiG2BUHZI6/LGk9yvHmjx7BTvtBCLtRg6IQ==", "cpu": [ "arm64" ], @@ -2747,9 +2748,9 @@ } }, "node_modules/@next/swc-linux-arm64-musl": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-12.3.1.tgz", - "integrity": "sha512-2WEasRxJzgAmP43glFNhADpe8zB7kJofhEAVNbDJZANp+H4+wq+/cW1CdDi8DqjkShPEA6/ejJw+xnEyDID2jg==", + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.0.5.tgz", + "integrity": "sha512-xenvqlXz+KxVKAB1YR723gnVNszpsCvKZkiFFaAYqDGJ502YuqU2fwLsaSm/ASRizNcBYeo9HPLTyc3r/9cdMQ==", "cpu": [ "arm64" ], @@ -2762,11 +2763,12 @@ } }, "node_modules/@next/swc-linux-x64-gnu": { - "version": "12.3.1", + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.0.5.tgz", + "integrity": "sha512-9Ahi1bbdXwhrWQmOyoTod23/hhK05da/FzodiNqd6drrMl1y7+RujoEcU8Dtw3H1mGWB+yuTlWo8B4Iba8hqiQ==", "cpu": [ "x64" ], - "license": "MIT", "optional": true, "os": [ "linux" @@ -2776,11 +2778,12 @@ } }, "node_modules/@next/swc-linux-x64-musl": { - "version": "12.3.1", + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.0.5.tgz", + "integrity": "sha512-V+1mnh49qmS9fOZxVRbzjhBEz9IUGJ7AQ80JPWAYQM5LI4TxfdiF4APLPvJ52rOmNeTqnVz1bbKtVOso+7EZ4w==", "cpu": [ "x64" ], - "license": "MIT", "optional": true, "os": [ "linux" @@ -2790,9 +2793,9 @@ } }, "node_modules/@next/swc-win32-arm64-msvc": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-12.3.1.tgz", - "integrity": "sha512-hswVFYQYIeGHE2JYaBVtvqmBQ1CppplQbZJS/JgrVI3x2CurNhEkmds/yqvDONfwfbttTtH4+q9Dzf/WVl3Opw==", + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.0.5.tgz", + "integrity": "sha512-wRE9rkp7I+/3Jf2T9PFIJOKq3adMWYEFkPOA7XAkUfYbQHlDJm/U5cVCWUsKByyQq5RThwufI91sgd19MfxRxg==", "cpu": [ "arm64" ], @@ -2805,9 +2808,9 @@ } }, "node_modules/@next/swc-win32-ia32-msvc": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-12.3.1.tgz", - "integrity": "sha512-Kny5JBehkTbKPmqulr5i+iKntO5YMP+bVM8Hf8UAmjSMVo3wehyLVc9IZkNmcbxi+vwETnQvJaT5ynYBkJ9dWA==", + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.0.5.tgz", + "integrity": "sha512-Q1XQSLEhFuFhkKFdJIGt7cYQ4T3u6P5wrtUNreg5M+7P+fjSiC8+X+Vjcw+oebaacsdl0pWZlK+oACGafush1w==", "cpu": [ "ia32" ], @@ -2820,9 +2823,9 @@ } }, "node_modules/@next/swc-win32-x64-msvc": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-12.3.1.tgz", - "integrity": "sha512-W1ijvzzg+kPEX6LAc+50EYYSEo0FVu7dmTE+t+DM4iOLqgGHoW9uYSz9wCVdkXOEEMP9xhXfGpcSxsfDucyPkA==", + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.0.5.tgz", + "integrity": "sha512-t5gRblrwwiNZP6cT7NkxlgxrFgHWtv9ei5vUraCLgBqzvIsa7X+PnarZUeQCXqz6Jg9JSGGT9j8lvzD97UqeJQ==", "cpu": [ "x64" ], @@ -3126,8 +3129,9 @@ } }, "node_modules/@swc/helpers": { - "version": "0.4.11", - "license": "MIT", + "version": "0.4.14", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.4.14.tgz", + "integrity": "sha512-4C7nX/dvpzB7za4Ql9K81xK3HPxCpHMgwTZVyf+9JQ6VUbn9jjZVN7/Nkdz/Ugzs2CSjqnL/UPXroiVBVHUWUw==", "dependencies": { "tslib": "^2.4.0" } @@ -3694,6 +3698,11 @@ "pnpm": ">=7" } }, + "node_modules/client-only": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", + "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==" + }, "node_modules/color-convert": { "version": "2.0.1", "dev": true, @@ -5530,42 +5539,42 @@ "license": "MIT" }, "node_modules/next": { - "version": "12.3.1", - "license": "MIT", + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/next/-/next-13.0.5.tgz", + "integrity": "sha512-awpc3DkphyKydwCotcBnuKwh6hMqkT5xdiBK4OatJtOZurDPBYLP62jtM2be/4OunpmwIbsS0Eyv+ZGU97ciEg==", "dependencies": { - "@next/env": "12.3.1", - "@swc/helpers": "0.4.11", + "@next/env": "13.0.5", + "@swc/helpers": "0.4.14", "caniuse-lite": "^1.0.30001406", "postcss": "8.4.14", - "styled-jsx": "5.0.7", - "use-sync-external-store": "1.2.0" + "styled-jsx": "5.1.0" }, "bin": { "next": "dist/bin/next" }, "engines": { - "node": ">=12.22.0" + "node": ">=14.6.0" }, "optionalDependencies": { - "@next/swc-android-arm-eabi": "12.3.1", - "@next/swc-android-arm64": "12.3.1", - "@next/swc-darwin-arm64": "12.3.1", - "@next/swc-darwin-x64": "12.3.1", - "@next/swc-freebsd-x64": "12.3.1", - "@next/swc-linux-arm-gnueabihf": "12.3.1", - "@next/swc-linux-arm64-gnu": "12.3.1", - "@next/swc-linux-arm64-musl": "12.3.1", - "@next/swc-linux-x64-gnu": "12.3.1", - "@next/swc-linux-x64-musl": "12.3.1", - "@next/swc-win32-arm64-msvc": "12.3.1", - "@next/swc-win32-ia32-msvc": "12.3.1", - "@next/swc-win32-x64-msvc": "12.3.1" + "@next/swc-android-arm-eabi": "13.0.5", + "@next/swc-android-arm64": "13.0.5", + "@next/swc-darwin-arm64": "13.0.5", + "@next/swc-darwin-x64": "13.0.5", + "@next/swc-freebsd-x64": "13.0.5", + "@next/swc-linux-arm-gnueabihf": "13.0.5", + "@next/swc-linux-arm64-gnu": "13.0.5", + "@next/swc-linux-arm64-musl": "13.0.5", + "@next/swc-linux-x64-gnu": "13.0.5", + "@next/swc-linux-x64-musl": "13.0.5", + "@next/swc-win32-arm64-msvc": "13.0.5", + "@next/swc-win32-ia32-msvc": "13.0.5", + "@next/swc-win32-x64-msvc": "13.0.5" }, "peerDependencies": { "fibers": ">= 3.1.0", "node-sass": "^6.0.0 || ^7.0.0", - "react": "^17.0.2 || ^18.0.0-0", - "react-dom": "^17.0.2 || ^18.0.0-0", + "react": "^18.2.0", + "react-dom": "^18.2.0", "sass": "^1.3.0" }, "peerDependenciesMeta": { @@ -6422,8 +6431,12 @@ } }, "node_modules/styled-jsx": { - "version": "5.0.7", - "license": "MIT", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.0.tgz", + "integrity": "sha512-/iHaRJt9U7T+5tp6TRelLnqBqiaIT0HsO0+vgyj8hK2KUk7aejFqRrumqPUlAqDwAj8IbS/1hk3IhBAAK/FCUQ==", + "dependencies": { + "client-only": "0.0.1" + }, "engines": { "node": ">= 12.0.0" }, @@ -6537,8 +6550,9 @@ } }, "node_modules/tslib": { - "version": "2.4.0", - "license": "0BSD" + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", + "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" }, "node_modules/tsutils": { "version": "3.21.0", @@ -6682,13 +6696,6 @@ "punycode": "^2.1.0" } }, - "node_modules/use-sync-external-store": { - "version": "1.2.0", - "license": "MIT", - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0" - } - }, "node_modules/utf-8-validate": { "version": "5.0.10", "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz", @@ -8465,7 +8472,9 @@ "integrity": "sha512-fuscdXJ9G1qb7W8VdHi+IwRqij3lBkosAm4ydQtEmbY58OzHXqQhvlxqEkoz0yssNVn38bcpRWgA9PP+OGoisw==" }, "@next/env": { - "version": "12.3.1" + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@next/env/-/env-13.0.5.tgz", + "integrity": "sha512-F3KLtiDrUslAZhTYTh8Zk5ZaavbYwLUn3NYPBnOjAXU8hWm0QVGVzKIOuURQ098ofRU4e9oglf3Sj9pFx5nI5w==" }, "@next/eslint-plugin-next": { "version": "12.3.1", @@ -8489,77 +8498,81 @@ } }, "@next/swc-android-arm-eabi": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-12.3.1.tgz", - "integrity": "sha512-i+BvKA8tB//srVPPQxIQN5lvfROcfv4OB23/L1nXznP+N/TyKL8lql3l7oo2LNhnH66zWhfoemg3Q4VJZSruzQ==", + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-13.0.5.tgz", + "integrity": "sha512-YO691dxHlviy6H0eghgwqn+5kU9J3iQnKERHTDSppqjjGDBl6ab4wz9XfI5AhljjkaTg3TknHoIEWFDoZ4Ve8g==", "optional": true }, "@next/swc-android-arm64": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-android-arm64/-/swc-android-arm64-12.3.1.tgz", - "integrity": "sha512-CmgU2ZNyBP0rkugOOqLnjl3+eRpXBzB/I2sjwcGZ7/Z6RcUJXK5Evz+N0ucOxqE4cZ3gkTeXtSzRrMK2mGYV8Q==", + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@next/swc-android-arm64/-/swc-android-arm64-13.0.5.tgz", + "integrity": "sha512-ugbwffkUmp8cd2afehDC8LtQeFUxElRUBBngfB5UYSWBx18HW4OgzkPFIY8jUBH16zifvGZWXbICXJWDHrOLtw==", "optional": true }, "@next/swc-darwin-arm64": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-12.3.1.tgz", - "integrity": "sha512-hT/EBGNcu0ITiuWDYU9ur57Oa4LybD5DOQp4f22T6zLfpoBMfBibPtR8XktXmOyFHrL/6FC2p9ojdLZhWhvBHg==", + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.0.5.tgz", + "integrity": "sha512-mshlh8QOtOalfZbc17uNAftWgqHTKnrv6QUwBe+mpGz04eqsSUzVz1JGZEdIkmuDxOz00cK2NPoc+VHDXh99IQ==", "optional": true }, "@next/swc-darwin-x64": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-12.3.1.tgz", - "integrity": "sha512-9S6EVueCVCyGf2vuiLiGEHZCJcPAxglyckTZcEwLdJwozLqN0gtS0Eq0bQlGS3dH49Py/rQYpZ3KVWZ9BUf/WA==", + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-13.0.5.tgz", + "integrity": "sha512-SfigOKW4Z2UB3ruUPyvrlDIkcJq1hiw1wvYApWugD+tQsAkYZKEoz+/8emCmeYZ6Gwgi1WHV+z52Oj8u7bEHPg==", "optional": true }, "@next/swc-freebsd-x64": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-freebsd-x64/-/swc-freebsd-x64-12.3.1.tgz", - "integrity": "sha512-qcuUQkaBZWqzM0F1N4AkAh88lLzzpfE6ImOcI1P6YeyJSsBmpBIV8o70zV+Wxpc26yV9vpzb+e5gCyxNjKJg5Q==", + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@next/swc-freebsd-x64/-/swc-freebsd-x64-13.0.5.tgz", + "integrity": "sha512-0NJg8HZr4yG8ynmMGFXQf+Mahvq4ZgBmUwSlLXXymgxEQgH17erH/LoR69uITtW+KTsALgk9axEt5AAabM4ucg==", "optional": true }, "@next/swc-linux-arm-gnueabihf": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-12.3.1.tgz", - "integrity": "sha512-diL9MSYrEI5nY2wc/h/DBewEDUzr/DqBjIgHJ3RUNtETAOB3spMNHvJk2XKUDjnQuluLmFMloet9tpEqU2TT9w==", + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-13.0.5.tgz", + "integrity": "sha512-Cye+h3oDT3NDWjACMlRaolL8fokpKie34FlPj9nfoW7bYKmoMBY1d4IO/GgBF+5xEl7HkH0Ny/qex63vQ0pN+A==", "optional": true }, "@next/swc-linux-arm64-gnu": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-12.3.1.tgz", - "integrity": "sha512-o/xB2nztoaC7jnXU3Q36vGgOolJpsGG8ETNjxM1VAPxRwM7FyGCPHOMk1XavG88QZSQf+1r+POBW0tLxQOJ9DQ==", + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.0.5.tgz", + "integrity": "sha512-5BfDS/VoRDR5QUGG9oedOCEZGmV2zxUVFYLUJVPMSMeIgqkjxWQBiG2BUHZI6/LGk9yvHmjx7BTvtBCLtRg6IQ==", "optional": true }, "@next/swc-linux-arm64-musl": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-12.3.1.tgz", - "integrity": "sha512-2WEasRxJzgAmP43glFNhADpe8zB7kJofhEAVNbDJZANp+H4+wq+/cW1CdDi8DqjkShPEA6/ejJw+xnEyDID2jg==", + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.0.5.tgz", + "integrity": "sha512-xenvqlXz+KxVKAB1YR723gnVNszpsCvKZkiFFaAYqDGJ502YuqU2fwLsaSm/ASRizNcBYeo9HPLTyc3r/9cdMQ==", "optional": true }, "@next/swc-linux-x64-gnu": { - "version": "12.3.1", + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.0.5.tgz", + "integrity": "sha512-9Ahi1bbdXwhrWQmOyoTod23/hhK05da/FzodiNqd6drrMl1y7+RujoEcU8Dtw3H1mGWB+yuTlWo8B4Iba8hqiQ==", "optional": true }, "@next/swc-linux-x64-musl": { - "version": "12.3.1", + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.0.5.tgz", + "integrity": "sha512-V+1mnh49qmS9fOZxVRbzjhBEz9IUGJ7AQ80JPWAYQM5LI4TxfdiF4APLPvJ52rOmNeTqnVz1bbKtVOso+7EZ4w==", "optional": true }, "@next/swc-win32-arm64-msvc": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-12.3.1.tgz", - "integrity": "sha512-hswVFYQYIeGHE2JYaBVtvqmBQ1CppplQbZJS/JgrVI3x2CurNhEkmds/yqvDONfwfbttTtH4+q9Dzf/WVl3Opw==", + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.0.5.tgz", + "integrity": "sha512-wRE9rkp7I+/3Jf2T9PFIJOKq3adMWYEFkPOA7XAkUfYbQHlDJm/U5cVCWUsKByyQq5RThwufI91sgd19MfxRxg==", "optional": true }, "@next/swc-win32-ia32-msvc": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-12.3.1.tgz", - "integrity": "sha512-Kny5JBehkTbKPmqulr5i+iKntO5YMP+bVM8Hf8UAmjSMVo3wehyLVc9IZkNmcbxi+vwETnQvJaT5ynYBkJ9dWA==", + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.0.5.tgz", + "integrity": "sha512-Q1XQSLEhFuFhkKFdJIGt7cYQ4T3u6P5wrtUNreg5M+7P+fjSiC8+X+Vjcw+oebaacsdl0pWZlK+oACGafush1w==", "optional": true }, "@next/swc-win32-x64-msvc": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-12.3.1.tgz", - "integrity": "sha512-W1ijvzzg+kPEX6LAc+50EYYSEo0FVu7dmTE+t+DM4iOLqgGHoW9uYSz9wCVdkXOEEMP9xhXfGpcSxsfDucyPkA==", + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.0.5.tgz", + "integrity": "sha512-t5gRblrwwiNZP6cT7NkxlgxrFgHWtv9ei5vUraCLgBqzvIsa7X+PnarZUeQCXqz6Jg9JSGGT9j8lvzD97UqeJQ==", "optional": true }, "@nodelib/fs.scandir": { @@ -8721,7 +8734,9 @@ } }, "@swc/helpers": { - "version": "0.4.11", + "version": "0.4.14", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.4.14.tgz", + "integrity": "sha512-4C7nX/dvpzB7za4Ql9K81xK3HPxCpHMgwTZVyf+9JQ6VUbn9jjZVN7/Nkdz/Ugzs2CSjqnL/UPXroiVBVHUWUw==", "requires": { "tslib": "^2.4.0" } @@ -9090,6 +9105,11 @@ "@kurkle/color": "^0.3.0" } }, + "client-only": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", + "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==" + }, "color-convert": { "version": "2.0.1", "dev": true, @@ -10329,27 +10349,28 @@ "dev": true }, "next": { - "version": "12.3.1", + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/next/-/next-13.0.5.tgz", + "integrity": "sha512-awpc3DkphyKydwCotcBnuKwh6hMqkT5xdiBK4OatJtOZurDPBYLP62jtM2be/4OunpmwIbsS0Eyv+ZGU97ciEg==", "requires": { - "@next/env": "12.3.1", - "@next/swc-android-arm-eabi": "12.3.1", - "@next/swc-android-arm64": "12.3.1", - "@next/swc-darwin-arm64": "12.3.1", - "@next/swc-darwin-x64": "12.3.1", - "@next/swc-freebsd-x64": "12.3.1", - "@next/swc-linux-arm-gnueabihf": "12.3.1", - "@next/swc-linux-arm64-gnu": "12.3.1", - "@next/swc-linux-arm64-musl": "12.3.1", - "@next/swc-linux-x64-gnu": "12.3.1", - "@next/swc-linux-x64-musl": "12.3.1", - "@next/swc-win32-arm64-msvc": "12.3.1", - "@next/swc-win32-ia32-msvc": "12.3.1", - "@next/swc-win32-x64-msvc": "12.3.1", - "@swc/helpers": "0.4.11", + "@next/env": "13.0.5", + "@next/swc-android-arm-eabi": "13.0.5", + "@next/swc-android-arm64": "13.0.5", + "@next/swc-darwin-arm64": "13.0.5", + "@next/swc-darwin-x64": "13.0.5", + "@next/swc-freebsd-x64": "13.0.5", + "@next/swc-linux-arm-gnueabihf": "13.0.5", + "@next/swc-linux-arm64-gnu": "13.0.5", + "@next/swc-linux-arm64-musl": "13.0.5", + "@next/swc-linux-x64-gnu": "13.0.5", + "@next/swc-linux-x64-musl": "13.0.5", + "@next/swc-win32-arm64-msvc": "13.0.5", + "@next/swc-win32-ia32-msvc": "13.0.5", + "@next/swc-win32-x64-msvc": "13.0.5", + "@swc/helpers": "0.4.14", "caniuse-lite": "^1.0.30001406", "postcss": "8.4.14", - "styled-jsx": "5.0.7", - "use-sync-external-store": "1.2.0" + "styled-jsx": "5.1.0" } }, "node-gyp-build": { @@ -10875,8 +10896,12 @@ "dev": true }, "styled-jsx": { - "version": "5.0.7", - "requires": {} + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.0.tgz", + "integrity": "sha512-/iHaRJt9U7T+5tp6TRelLnqBqiaIT0HsO0+vgyj8hK2KUk7aejFqRrumqPUlAqDwAj8IbS/1hk3IhBAAK/FCUQ==", + "requires": { + "client-only": "0.0.1" + } }, "supports-color": { "version": "7.2.0", @@ -10944,7 +10969,9 @@ } }, "tslib": { - "version": "2.4.0" + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", + "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" }, "tsutils": { "version": "3.21.0", @@ -11028,10 +11055,6 @@ "punycode": "^2.1.0" } }, - "use-sync-external-store": { - "version": "1.2.0", - "requires": {} - }, "utf-8-validate": { "version": "5.0.10", "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz", diff --git a/package.json b/package.json index 75df87f..6d546f8 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "axios": "^1.1.3", "chart.js": "^4.3.0", "dotenv": "^16.0.3", - "next": "12.3.1", + "next": "13.0.5", "react": "18.2.0", "react-chartjs-2": "^5.2.0", "react-dom": "18.2.0", diff --git a/src/components/chart.tsx b/src/components/Chart.tsx similarity index 100% rename from src/components/chart.tsx rename to src/components/Chart.tsx diff --git a/src/components/Menu.module.css b/src/components/Menu.module.css new file mode 100644 index 0000000..87bf372 --- /dev/null +++ b/src/components/Menu.module.css @@ -0,0 +1,150 @@ +.menu { + width: 100%; + padding: calc(var(--spacer) / 2) calc(var(--spacer) / 3); +} +.link1 { + font-size: 100px; +} + +.navigation { + order: 3; + margin-top: calc(var(--spacer) / 2); + text-align: right; + border-top: 1px solid var(--border-color); + border-bottom: 1px solid var(--border-color); + margin-left: -1rem; + margin-right: -1rem; + width: calc(100% + 2rem); +} + +.actions { + order: 2; + display: flex; + margin-left: auto; +} + +.title { + display: none; +} + +.navigation { + white-space: nowrap; + overflow-y: hidden; + overflow-x: auto; + -webkit-overflow-scrolling: touch; + -ms-overflow-style: none; +} + +.navigation::-webkit-scrollbar, +.navigation::-moz-scrollbar { + display: none; +} + +.navigation li { + display: inline-block; + vertical-align: middle; + margin-right: calc(var(--spacer) / 3); + margin-left: calc(var(--spacer) / 3); +} + +.link { + display: block; + padding: calc(var(--spacer) / 4) calc(var(--spacer) / 2); + text-transform: uppercase; + color: var(--color-secondary); + font-weight: var(--font-weight-bold); + font-size: var(--font-size-base); + position: relative; + z-index: 1; +} + +.actions, +.link:hover, +.link:focus, +.link:active { + color: var(--font-color-text); +} + +.link[aria-current], +.link[aria-current]:hover, +.link[aria-current]:focus { + color: var(--font-color-heading); +} + +.link:last-child { + padding-right: 0; +} + +.link[aria-disabled] { + pointer-events: none; +} + +.actions button { + text-transform: none; +} + +[aria-expanded='true'] .caret { + transform: rotate(180deg); +} + +.badge .caret { + fill: var(--brand-white); + opacity: 0.7; + width: var(--font-size-mini); + height: var(--font-size-mini); + margin-left: calc(var(--spacer) / 12); +} + +@media screen and (min-width: 42rem) { + .caret, + svg.caret { + display: inline-block; + } + + .navigation { + margin-left: calc(var(--spacer) / 2); + } +} + +@media screen and (min-width: 42rem) { + .menu { + padding: calc(var(--spacer) / 2); + } + + .navigation { + order: 2; + width: auto; + margin: 0; + text-align: right; + border: none; + } + + .actions { + order: 3; + margin-left: auto; + } +} +@media screen and (min-width: 55rem) { + .menu { + padding: var(--spacer); + } + + .title { + margin: 0; + display: block; + color: var(--color-secondary); + font-size: var(--font-size-h4); + margin-right: calc(var(--spacer) / 6); + } +} + +.versions { + padding: calc(var(--spacer) / 4); +} + +.versions .link { + display: inline-block; + margin: 0 calc(var(--spacer) / 4); + padding: 0; + font-size: var(--font-size-small); +} diff --git a/src/components/Menu.tsx b/src/components/Menu.tsx new file mode 100644 index 0000000..7e462cc --- /dev/null +++ b/src/components/Menu.tsx @@ -0,0 +1,38 @@ +import React from 'react' +import { useRouter } from 'next/router' +import Link from 'next/link' +import styles from './Menu.module.css' + +function MenuLink({ name, path }: { name: string; path: string }) { + const router = useRouter() + + const classes = + router?.pathname === path ? `${styles.link} ${styles.active}` : styles.link + console.log(name, path) + console.log('classes', classes) + console.log('router', router.pathname) + + return ( + + {name} + + ) +} + +export default function Menu() { + return ( + + ) +} diff --git a/src/config/coreStats.json b/src/config/coreStats.json new file mode 100644 index 0000000..300f475 --- /dev/null +++ b/src/config/coreStats.json @@ -0,0 +1,27 @@ +[ + { "title": "NFTs Published", "path": "/stats/core/publishedNFT" }, + { "title": "Unique Consumers", "path": "/stats/core/uniqueConsumers" }, + { + "title": "Weekly Unique Publish Markets", + "path": "/stats/core/weeklyUniquePublishMarkets" + }, + { + "title": "Montly Unique Publish Markets", + "path": "/stats/core/montlyUniquePublishMarkets" + }, + { + "title": "Yearly Unique Publish Markets", + "path": "/stats/core/yearlyUniquePublishMarkets" + }, + { + "title": "Total Unique Publish Markets", + "path": "/stats/core/totalUniquePublishMarkets" + }, + { + "title": "Unique Consume Markets", + "path": "/stats/core/uniqueConsumeMarkets" + }, + { "title": "Free Consumes", "path": "/stats/core/freeConsumes" }, + { "title": "Paid Consumes", "path": "/stats/core/paidConsumes" }, + { "title": "Ocean Consumes", "path": "/stats/core/oceanConsumes" } +] diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 61dcb01..6638059 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -1,9 +1,15 @@ import '@oceanprotocol/typographies/css/ocean-typo.css' import '../styles/globals.css' import type { AppProps } from 'next/app' +import Menu from '../components/Menu' function MyApp({ Component, pageProps }: AppProps) { - return + return ( + <> + + + + ) } export default MyApp diff --git a/src/pages/stats.tsx b/src/pages/stats.tsx index 38edf95..993b1be 100644 --- a/src/pages/stats.tsx +++ b/src/pages/stats.tsx @@ -2,7 +2,8 @@ import React from 'react' import Head from 'next/head' import styles from '../styles/Home.module.css' import LogoAsset from '../images/logo.svg' -import Chart from '../components/chart' +import Chart from '../components/Chart' +import stats from '../config/coreStats.json' export default function Stats() { return ( @@ -22,8 +23,10 @@ export default function Stats() {

Stats for usage of Ocean Protocol.

{' '}
-
- +
+ {stats.map((chart) => ( + + ))}
diff --git a/src/styles/Home.module.css b/src/styles/Home.module.css index e5d5b10..0c3a528 100644 --- a/src/styles/Home.module.css +++ b/src/styles/Home.module.css @@ -1,5 +1,6 @@ .app { padding: var(--spacer); + padding-top: 0px; margin: 0 auto; background: url('../../node_modules/@oceanprotocol/art/waves/waves.svg') no-repeat center 13.5rem; @@ -9,6 +10,7 @@ @media screen and (min-width: 50rem) { .app { padding: calc(var(--spacer) * 2); + padding-top: 0px; } } @@ -45,6 +47,12 @@ gap: var(--spacer); } +.chartGrid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(40rem, 1fr)); + gap: var(--spacer); +} + .networkName { margin-top: calc(var(--spacer) * 3); margin-bottom: var(--spacer); diff --git a/src/utils/getStats.ts b/src/utils/getStats.ts deleted file mode 100644 index c600f6b..0000000 --- a/src/utils/getStats.ts +++ /dev/null @@ -1,17 +0,0 @@ -import axios, { AxiosResponse } from 'axios' - -export async function getStats(url: string): Promise { - try { - console.log('Fetching data from', url) - const response: AxiosResponse = await axios.get(url) - console.log('Got response', response) - if (!response?.data || response.status !== 200) - throw Error('ERROR: no data recieved') - - // transform data into object with network names as keys - console.log('Got new data', response.data) - return response - } catch (error) { - console.error(error.message) - } -}