From 8707feac014ac0470a2f1ea217f3da2a9fe0f0e2 Mon Sep 17 00:00:00 2001 From: spacemeowx2 Date: Tue, 4 Jul 2023 19:40:22 +0800 Subject: [PATCH] fix(gui): breaking change by daisyui --- gui/package.json | 1 + gui/pnpm-lock.yaml | 77 +++++++++++++++++++++++------ gui/src/components/OpenSplatnet.tsx | 6 +-- gui/src/components/RunPanel.tsx | 6 +-- gui/src/main.css | 25 +--------- gui/src/pages/Home.tsx | 2 +- 6 files changed, 70 insertions(+), 47 deletions(-) diff --git a/gui/package.json b/gui/package.json index c9a1d71..b474c7a 100644 --- a/gui/package.json +++ b/gui/package.json @@ -28,6 +28,7 @@ "@types/node": "^20.3.3", "@types/react": "^18.0.15", "@types/react-dom": "^18.0.6", + "@typescript-eslint/parser": "^5.61.0", "@vitejs/plugin-react": "^4.0.1", "autoprefixer": "^10.4.14", "eslint": "^8.44.0", diff --git a/gui/pnpm-lock.yaml b/gui/pnpm-lock.yaml index 0331333..f9d662a 100644 --- a/gui/pnpm-lock.yaml +++ b/gui/pnpm-lock.yaml @@ -50,6 +50,9 @@ devDependencies: '@types/react-dom': specifier: ^18.0.6 version: 18.0.11 + '@typescript-eslint/parser': + specifier: ^5.61.0 + version: 5.61.0(eslint@8.44.0)(typescript@5.1.6) '@vitejs/plugin-react': specifier: ^4.0.1 version: 4.0.1(vite@4.3.9) @@ -2161,7 +2164,7 @@ packages: resolution: {integrity: sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==} dev: true - /@typescript-eslint/eslint-plugin@5.54.0(@typescript-eslint/parser@5.54.0)(eslint@8.44.0)(typescript@5.1.6): + /@typescript-eslint/eslint-plugin@5.54.0(@typescript-eslint/parser@5.61.0)(eslint@8.44.0)(typescript@5.1.6): resolution: {integrity: sha512-+hSN9BdSr629RF02d7mMtXhAJvDTyCbprNYJKrXETlul/Aml6YZwd90XioVbjejQeHbb3R8Dg0CkRgoJDxo8aw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2172,7 +2175,7 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/parser': 5.54.0(eslint@8.44.0)(typescript@5.1.6) + '@typescript-eslint/parser': 5.61.0(eslint@8.44.0)(typescript@5.1.6) '@typescript-eslint/scope-manager': 5.54.0 '@typescript-eslint/type-utils': 5.54.0(eslint@8.44.0)(typescript@5.1.6) '@typescript-eslint/utils': 5.54.0(eslint@8.44.0)(typescript@5.1.6) @@ -2202,8 +2205,8 @@ packages: - typescript dev: true - /@typescript-eslint/parser@5.54.0(eslint@8.44.0)(typescript@5.1.6): - resolution: {integrity: sha512-aAVL3Mu2qTi+h/r04WI/5PfNWvO6pdhpeMRWk9R7rEV4mwJNzoWf5CCU5vDKBsPIFQFjEq1xg7XBI2rjiMXQbQ==} + /@typescript-eslint/parser@5.61.0(eslint@8.44.0)(typescript@5.1.6): + resolution: {integrity: sha512-yGr4Sgyh8uO6fSi9hw3jAFXNBHbCtKKFMdX2IkT3ZqpKmtAq3lHS4ixB/COFuAIJpwl9/AqF7j72ZDWYKmIfvg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -2212,9 +2215,9 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 5.54.0 - '@typescript-eslint/types': 5.54.0 - '@typescript-eslint/typescript-estree': 5.54.0(typescript@5.1.6) + '@typescript-eslint/scope-manager': 5.61.0 + '@typescript-eslint/types': 5.61.0 + '@typescript-eslint/typescript-estree': 5.61.0(typescript@5.1.6) debug: 4.3.4 eslint: 8.44.0 typescript: 5.1.6 @@ -2230,6 +2233,14 @@ packages: '@typescript-eslint/visitor-keys': 5.54.0 dev: true + /@typescript-eslint/scope-manager@5.61.0: + resolution: {integrity: sha512-W8VoMjoSg7f7nqAROEmTt6LoBpn81AegP7uKhhW5KzYlehs8VV0ZW0fIDVbcZRcaP3aPSW+JZFua+ysQN+m/Nw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + '@typescript-eslint/types': 5.61.0 + '@typescript-eslint/visitor-keys': 5.61.0 + dev: true + /@typescript-eslint/type-utils@5.54.0(eslint@8.44.0)(typescript@5.1.6): resolution: {integrity: sha512-WI+WMJ8+oS+LyflqsD4nlXMsVdzTMYTxl16myXPaCXnSgc7LWwMsjxQFZCK/rVmTZ3FN71Ct78ehO9bRC7erYQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -2255,6 +2266,11 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true + /@typescript-eslint/types@5.61.0: + resolution: {integrity: sha512-ldyueo58KjngXpzloHUog/h9REmHl59G1b3a5Sng1GfBo14BkS3ZbMEb3693gnP1k//97lh7bKsp6/V/0v1veQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: true + /@typescript-eslint/typescript-estree@5.54.0(typescript@5.1.6): resolution: {integrity: sha512-X2rJG97Wj/VRo5YxJ8Qx26Zqf0RRKsVHd4sav8NElhbZzhpBI8jU54i6hfo9eheumj4oO4dcRN1B/zIVEqR/MQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -2276,6 +2292,27 @@ packages: - supports-color dev: true + /@typescript-eslint/typescript-estree@5.61.0(typescript@5.1.6): + resolution: {integrity: sha512-Fud90PxONnnLZ36oR5ClJBLTLfU4pIWBmnvGwTbEa2cXIqj70AEDEmOmpkFComjBZ/037ueKrOdHuYmSFVD7Rw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 5.61.0 + '@typescript-eslint/visitor-keys': 5.61.0 + debug: 4.3.4 + globby: 11.1.0 + is-glob: 4.0.3 + semver: 7.3.8 + tsutils: 3.21.0(typescript@5.1.6) + typescript: 5.1.6 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/utils@5.54.0(eslint@8.44.0)(typescript@5.1.6): resolution: {integrity: sha512-cuwm8D/Z/7AuyAeJ+T0r4WZmlnlxQ8wt7C7fLpFlKMR+dY6QO79Cq1WpJhvZbMA4ZeZGHiRWnht7ZJ8qkdAunw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -2304,6 +2341,14 @@ packages: eslint-visitor-keys: 3.3.0 dev: true + /@typescript-eslint/visitor-keys@5.61.0: + resolution: {integrity: sha512-50XQ5VdbWrX06mQXhy93WywSFZZGsv3EOjq+lqp6WC2t+j3mb6A9xYVdrRxafvK88vg9k9u+CT4l6D8PEatjKg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + '@typescript-eslint/types': 5.61.0 + eslint-visitor-keys: 3.4.1 + dev: true + /@vitejs/plugin-react@4.0.1(vite@4.3.9): resolution: {integrity: sha512-g25lL98essfeSj43HJ0o4DMp0325XK0ITkxpgChzJU/CyemgyChtlxfnRbjfwxDGCTRxTiXtQAsdebQXKMRSOA==} engines: {node: ^14.18.0 || >=16.0.0} @@ -2985,13 +3030,13 @@ packages: '@babel/core': 7.21.0 '@babel/eslint-parser': 7.19.1(@babel/core@7.21.0)(eslint@8.44.0) '@rushstack/eslint-patch': 1.2.0 - '@typescript-eslint/eslint-plugin': 5.54.0(@typescript-eslint/parser@5.54.0)(eslint@8.44.0)(typescript@5.1.6) - '@typescript-eslint/parser': 5.54.0(eslint@8.44.0)(typescript@5.1.6) + '@typescript-eslint/eslint-plugin': 5.54.0(@typescript-eslint/parser@5.61.0)(eslint@8.44.0)(typescript@5.1.6) + '@typescript-eslint/parser': 5.61.0(eslint@8.44.0)(typescript@5.1.6) babel-preset-react-app: 10.0.1 confusing-browser-globals: 1.0.11 eslint: 8.44.0 eslint-plugin-flowtype: 8.0.3(eslint@8.44.0) - eslint-plugin-import: 2.27.5(@typescript-eslint/parser@5.54.0)(eslint@8.44.0) + eslint-plugin-import: 2.27.5(@typescript-eslint/parser@5.61.0)(eslint@8.44.0) eslint-plugin-jest: 25.7.0(@typescript-eslint/eslint-plugin@5.54.0)(eslint@8.44.0)(typescript@5.1.6) eslint-plugin-jsx-a11y: 6.7.1(eslint@8.44.0) eslint-plugin-react: 7.32.2(eslint@8.44.0) @@ -3017,7 +3062,7 @@ packages: - supports-color dev: true - /eslint-module-utils@2.7.4(@typescript-eslint/parser@5.54.0)(eslint-import-resolver-node@0.3.7)(eslint@8.44.0): + /eslint-module-utils@2.7.4(@typescript-eslint/parser@5.61.0)(eslint-import-resolver-node@0.3.7)(eslint@8.44.0): resolution: {integrity: sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==} engines: {node: '>=4'} peerDependencies: @@ -3038,7 +3083,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 5.54.0(eslint@8.44.0)(typescript@5.1.6) + '@typescript-eslint/parser': 5.61.0(eslint@8.44.0)(typescript@5.1.6) debug: 3.2.7 eslint: 8.44.0 eslint-import-resolver-node: 0.3.7 @@ -3064,7 +3109,7 @@ packages: string-natural-compare: 3.0.1 dev: true - /eslint-plugin-import@2.27.5(@typescript-eslint/parser@5.54.0)(eslint@8.44.0): + /eslint-plugin-import@2.27.5(@typescript-eslint/parser@5.61.0)(eslint@8.44.0): resolution: {integrity: sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==} engines: {node: '>=4'} peerDependencies: @@ -3074,7 +3119,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 5.54.0(eslint@8.44.0)(typescript@5.1.6) + '@typescript-eslint/parser': 5.61.0(eslint@8.44.0)(typescript@5.1.6) array-includes: 3.1.6 array.prototype.flat: 1.3.1 array.prototype.flatmap: 1.3.1 @@ -3082,7 +3127,7 @@ packages: doctrine: 2.1.0 eslint: 8.44.0 eslint-import-resolver-node: 0.3.7 - eslint-module-utils: 2.7.4(@typescript-eslint/parser@5.54.0)(eslint-import-resolver-node@0.3.7)(eslint@8.44.0) + eslint-module-utils: 2.7.4(@typescript-eslint/parser@5.61.0)(eslint-import-resolver-node@0.3.7)(eslint@8.44.0) has: 1.0.3 is-core-module: 2.11.0 is-glob: 4.0.3 @@ -3110,7 +3155,7 @@ packages: jest: optional: true dependencies: - '@typescript-eslint/eslint-plugin': 5.54.0(@typescript-eslint/parser@5.54.0)(eslint@8.44.0)(typescript@5.1.6) + '@typescript-eslint/eslint-plugin': 5.54.0(@typescript-eslint/parser@5.61.0)(eslint@8.44.0)(typescript@5.1.6) '@typescript-eslint/experimental-utils': 5.54.0(eslint@8.44.0)(typescript@5.1.6) eslint: 8.44.0 transitivePeerDependencies: diff --git a/gui/src/components/OpenSplatnet.tsx b/gui/src/components/OpenSplatnet.tsx index 5155e0e..1fc5571 100644 --- a/gui/src/components/OpenSplatnet.tsx +++ b/gui/src/components/OpenSplatnet.tsx @@ -51,10 +51,10 @@ export const OpenSplatnet: React.FC = ({ children }) => { } + const btnLoading = loading || doing; return <> - + })} onClick={onClick} disabled={btnLoading}>{btnLoading ? : children} } diff --git a/gui/src/components/RunPanel.tsx b/gui/src/components/RunPanel.tsx index df37c49..8fd0b09 100644 --- a/gui/src/components/RunPanel.tsx +++ b/gui/src/components/RunPanel.tsx @@ -61,11 +61,11 @@ export const RunPanel: React.FC = () => { {t('导出打工数据')} + disabled={loading} + >{loading ? : t('导出')} } diff --git a/gui/src/main.css b/gui/src/main.css index cd96134..b654023 100644 --- a/gui/src/main.css +++ b/gui/src/main.css @@ -2,40 +2,17 @@ @tailwind components; @tailwind utilities; -:root { - font-family: Inter, Avenir, Helvetica, Arial, sans-serif; - font-size: 16px; - line-height: 24px; - font-weight: 400; - - color: #0f0f0f; - background-color: #f6f6f6; - - font-synthesis: none; - text-rendering: optimizeLegibility; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - -webkit-text-size-adjust: 100%; - -} - body { width: 100vw; height: 100vh; } #root { + width: 100vw; height: 100vh; overflow: hidden } -@media (prefers-color-scheme: dark) { - :root { - color: #f6f6f6; - background-color: #2f2f2f; - } -} - /* custom classes */ .flex-auto-all > * { diff --git a/gui/src/pages/Home.tsx b/gui/src/pages/Home.tsx index 922c107..ac7d38d 100644 --- a/gui/src/pages/Home.tsx +++ b/gui/src/pages/Home.tsx @@ -16,7 +16,7 @@ export const Home: React.FC = () => { {t('设置')}
{t('打开鱿鱼圈3')} - {t('前往 stat.ink')} + {t('前往 stat.ink')}