Compare commits
3 Commits
a366ce8163
...
ec58d590fc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec58d590fc | ||
| d1b65231a6 | |||
| 5b397e2265 |
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Game List</title>
|
<title>Game List</title>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@ -29,11 +29,11 @@
|
|||||||
"ts-proto": "^2.8.3",
|
"ts-proto": "^2.8.3",
|
||||||
"typescript": "~5.9.3",
|
"typescript": "~5.9.3",
|
||||||
"typescript-eslint": "^8.48.1",
|
"typescript-eslint": "^8.48.1",
|
||||||
"vite": "npm:rolldown-vite@7.2.5"
|
"vite": "npm:rolldown-vite@7.3.0"
|
||||||
},
|
},
|
||||||
"pnpm": {
|
"pnpm": {
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"vite": "npm:rolldown-vite@7.2.5"
|
"vite": "npm:rolldown-vite@7.3.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
167
frontend/pnpm-lock.yaml
generated
167
frontend/pnpm-lock.yaml
generated
@ -5,7 +5,7 @@ settings:
|
|||||||
excludeLinksFromLockfile: false
|
excludeLinksFromLockfile: false
|
||||||
|
|
||||||
overrides:
|
overrides:
|
||||||
vite: npm:rolldown-vite@7.2.5
|
vite: npm:rolldown-vite@7.3.0
|
||||||
|
|
||||||
importers:
|
importers:
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ importers:
|
|||||||
version: 19.2.3(@types/react@19.2.7)
|
version: 19.2.3(@types/react@19.2.7)
|
||||||
'@vitejs/plugin-react':
|
'@vitejs/plugin-react':
|
||||||
specifier: ^5.1.2
|
specifier: ^5.1.2
|
||||||
version: 5.1.2(rolldown-vite@7.2.5(@types/node@24.10.1))
|
version: 5.1.2(rolldown-vite@7.3.0(@types/node@24.10.1))
|
||||||
eslint:
|
eslint:
|
||||||
specifier: ^9.39.1
|
specifier: ^9.39.1
|
||||||
version: 9.39.1
|
version: 9.39.1
|
||||||
@ -61,8 +61,8 @@ importers:
|
|||||||
specifier: ^8.48.1
|
specifier: ^8.48.1
|
||||||
version: 8.48.1(eslint@9.39.1)(typescript@5.9.3)
|
version: 8.48.1(eslint@9.39.1)(typescript@5.9.3)
|
||||||
vite:
|
vite:
|
||||||
specifier: npm:rolldown-vite@7.2.5
|
specifier: npm:rolldown-vite@7.3.0
|
||||||
version: rolldown-vite@7.2.5(@types/node@24.10.1)
|
version: rolldown-vite@7.3.0(@types/node@24.10.1)
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
|
|
||||||
@ -234,99 +234,90 @@ packages:
|
|||||||
'@napi-rs/wasm-runtime@1.1.0':
|
'@napi-rs/wasm-runtime@1.1.0':
|
||||||
resolution: {integrity: sha512-Fq6DJW+Bb5jaWE69/qOE0D1TUN9+6uWhCeZpdnSBk14pjLcCWR7Q8n49PTSPHazM37JqrsdpEthXy2xn6jWWiA==}
|
resolution: {integrity: sha512-Fq6DJW+Bb5jaWE69/qOE0D1TUN9+6uWhCeZpdnSBk14pjLcCWR7Q8n49PTSPHazM37JqrsdpEthXy2xn6jWWiA==}
|
||||||
|
|
||||||
'@oxc-project/runtime@0.97.0':
|
'@oxc-project/runtime@0.101.0':
|
||||||
resolution: {integrity: sha512-yH0zw7z+jEws4dZ4IUKoix5Lh3yhqIJWF9Dc8PWvhpo7U7O+lJrv7ZZL4BeRO0la8LBQFwcCewtLBnVV7hPe/w==}
|
resolution: {integrity: sha512-t3qpfVZIqSiLQ5Kqt/MC4Ge/WCOGrrcagAdzTcDaggupjiGxUx4nJF2v6wUCXWSzWHn5Ns7XLv13fCJEwCOERQ==}
|
||||||
engines: {node: ^20.19.0 || >=22.12.0}
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
|
||||||
'@oxc-project/types@0.97.0':
|
'@oxc-project/types@0.101.0':
|
||||||
resolution: {integrity: sha512-lxmZK4xFrdvU0yZiDwgVQTCvh2gHWBJCBk5ALsrtsBWhs0uDIi+FTOnXRQeQfs304imdvTdaakT/lqwQ8hkOXQ==}
|
resolution: {integrity: sha512-nuFhqlUzJX+gVIPPfuE6xurd4lST3mdcWOhyK/rZO0B9XWMKm79SuszIQEnSMmmDhq1DC8WWVYGVd+6F93o1gQ==}
|
||||||
|
|
||||||
'@rolldown/binding-android-arm64@1.0.0-beta.50':
|
'@rolldown/binding-android-arm64@1.0.0-beta.53':
|
||||||
resolution: {integrity: sha512-XlEkrOIHLyGT3avOgzfTFSjG+f+dZMw+/qd+Y3HLN86wlndrB/gSimrJCk4gOhr1XtRtEKfszpadI3Md4Z4/Ag==}
|
resolution: {integrity: sha512-Ok9V8o7o6YfSdTTYA/uHH30r3YtOxLD6G3wih/U9DO0ucBBFq8WPt/DslU53OgfteLRHITZny9N/qCUxMf9kjQ==}
|
||||||
engines: {node: ^20.19.0 || >=22.12.0}
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [android]
|
os: [android]
|
||||||
|
|
||||||
'@rolldown/binding-darwin-arm64@1.0.0-beta.50':
|
'@rolldown/binding-darwin-arm64@1.0.0-beta.53':
|
||||||
resolution: {integrity: sha512-+JRqKJhoFlt5r9q+DecAGPLZ5PxeLva+wCMtAuoFMWPoZzgcYrr599KQ+Ix0jwll4B4HGP43avu9My8KtSOR+w==}
|
resolution: {integrity: sha512-yIsKqMz0CtRnVa6x3Pa+mzTihr4Ty+Z6HfPbZ7RVbk1Uxnco4+CUn7Qbm/5SBol1JD/7nvY8rphAgyAi7Lj6Vg==}
|
||||||
engines: {node: ^20.19.0 || >=22.12.0}
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [darwin]
|
os: [darwin]
|
||||||
|
|
||||||
'@rolldown/binding-darwin-x64@1.0.0-beta.50':
|
'@rolldown/binding-darwin-x64@1.0.0-beta.53':
|
||||||
resolution: {integrity: sha512-fFXDjXnuX7/gQZQm/1FoivVtRcyAzdjSik7Eo+9iwPQ9EgtA5/nB2+jmbzaKtMGG3q+BnZbdKHCtOacmNrkIDA==}
|
resolution: {integrity: sha512-GTXe+mxsCGUnJOFMhfGWmefP7Q9TpYUseHvhAhr21nCTgdS8jPsvirb0tJwM3lN0/u/cg7bpFNa16fQrjKrCjQ==}
|
||||||
engines: {node: ^20.19.0 || >=22.12.0}
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [darwin]
|
os: [darwin]
|
||||||
|
|
||||||
'@rolldown/binding-freebsd-x64@1.0.0-beta.50':
|
'@rolldown/binding-freebsd-x64@1.0.0-beta.53':
|
||||||
resolution: {integrity: sha512-F1b6vARy49tjmT/hbloplzgJS7GIvwWZqt+tAHEstCh0JIh9sa8FAMVqEmYxDviqKBaAI8iVvUREm/Kh/PD26Q==}
|
resolution: {integrity: sha512-9Tmp7bBvKqyDkMcL4e089pH3RsjD3SUungjmqWtyhNOxoQMh0fSmINTyYV8KXtE+JkxYMPWvnEt+/mfpVCkk8w==}
|
||||||
engines: {node: ^20.19.0 || >=22.12.0}
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [freebsd]
|
os: [freebsd]
|
||||||
|
|
||||||
'@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.50':
|
'@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.53':
|
||||||
resolution: {integrity: sha512-U6cR76N8T8M6lHj7EZrQ3xunLPxSvYYxA8vJsBKZiFZkT8YV4kjgCO3KwMJL0NOjQCPGKyiXO07U+KmJzdPGRw==}
|
resolution: {integrity: sha512-a1y5fiB0iovuzdbjUxa7+Zcvgv+mTmlGGC4XydVIsyl48eoxgaYkA3l9079hyTyhECsPq+mbr0gVQsFU11OJAQ==}
|
||||||
engines: {node: ^20.19.0 || >=22.12.0}
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
cpu: [arm]
|
cpu: [arm]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@rolldown/binding-linux-arm64-gnu@1.0.0-beta.50':
|
'@rolldown/binding-linux-arm64-gnu@1.0.0-beta.53':
|
||||||
resolution: {integrity: sha512-ONgyjofCrrE3bnh5GZb8EINSFyR/hmwTzZ7oVuyUB170lboza1VMCnb8jgE6MsyyRgHYmN8Lb59i3NKGrxrYjw==}
|
resolution: {integrity: sha512-bpIGX+ov9PhJYV+wHNXl9rzq4F0QvILiURn0y0oepbQx+7stmQsKA0DhPGwmhfvF856wq+gbM8L92SAa/CBcLg==}
|
||||||
engines: {node: ^20.19.0 || >=22.12.0}
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@rolldown/binding-linux-arm64-musl@1.0.0-beta.50':
|
'@rolldown/binding-linux-arm64-musl@1.0.0-beta.53':
|
||||||
resolution: {integrity: sha512-L0zRdH2oDPkmB+wvuTl+dJbXCsx62SkqcEqdM+79LOcB+PxbAxxjzHU14BuZIQdXcAVDzfpMfaHWzZuwhhBTcw==}
|
resolution: {integrity: sha512-bGe5EBB8FVjHBR1mOLOPEFg1Lp3//7geqWkU5NIhxe+yH0W8FVrQ6WRYOap4SUTKdklD/dC4qPLREkMMQ855FA==}
|
||||||
engines: {node: ^20.19.0 || >=22.12.0}
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@rolldown/binding-linux-x64-gnu@1.0.0-beta.50':
|
'@rolldown/binding-linux-x64-gnu@1.0.0-beta.53':
|
||||||
resolution: {integrity: sha512-gyoI8o/TGpQd3OzkJnh1M2kxy1Bisg8qJ5Gci0sXm9yLFzEXIFdtc4EAzepxGvrT2ri99ar5rdsmNG0zP0SbIg==}
|
resolution: {integrity: sha512-qL+63WKVQs1CMvFedlPt0U9PiEKJOAL/bsHMKUDS6Vp2Q+YAv/QLPu8rcvkfIMvQ0FPU2WL0aX4eWwF6e/GAnA==}
|
||||||
engines: {node: ^20.19.0 || >=22.12.0}
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@rolldown/binding-linux-x64-musl@1.0.0-beta.50':
|
'@rolldown/binding-linux-x64-musl@1.0.0-beta.53':
|
||||||
resolution: {integrity: sha512-zti8A7M+xFDpKlghpcCAzyOi+e5nfUl3QhU023ce5NCgUxRG5zGP2GR9LTydQ1rnIPwZUVBWd4o7NjZDaQxaXA==}
|
resolution: {integrity: sha512-VGl9JIGjoJh3H8Mb+7xnVqODajBmrdOOb9lxWXdcmxyI+zjB2sux69br0hZJDTyLJfvBoYm439zPACYbCjGRmw==}
|
||||||
engines: {node: ^20.19.0 || >=22.12.0}
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@rolldown/binding-openharmony-arm64@1.0.0-beta.50':
|
'@rolldown/binding-openharmony-arm64@1.0.0-beta.53':
|
||||||
resolution: {integrity: sha512-eZUssog7qljrrRU9Mi0eqYEPm3Ch0UwB+qlWPMKSUXHNqhm3TvDZarJQdTevGEfu3EHAXJvBIe0YFYr0TPVaMA==}
|
resolution: {integrity: sha512-B4iIserJXuSnNzA5xBLFUIjTfhNy7d9sq4FUMQY3GhQWGVhS2RWWzzDnkSU6MUt7/aHUrep0CdQfXUJI9D3W7A==}
|
||||||
engines: {node: ^20.19.0 || >=22.12.0}
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [openharmony]
|
os: [openharmony]
|
||||||
|
|
||||||
'@rolldown/binding-wasm32-wasi@1.0.0-beta.50':
|
'@rolldown/binding-wasm32-wasi@1.0.0-beta.53':
|
||||||
resolution: {integrity: sha512-nmCN0nIdeUnmgeDXiQ+2HU6FT162o+rxnF7WMkBm4M5Ds8qTU7Dzv2Wrf22bo4ftnlrb2hKK6FSwAJSAe2FWLg==}
|
resolution: {integrity: sha512-BUjAEgpABEJXilGq/BPh7jeU3WAJ5o15c1ZEgHaDWSz3LB881LQZnbNJHmUiM4d1JQWMYYyR1Y490IBHi2FPJg==}
|
||||||
engines: {node: '>=14.0.0'}
|
engines: {node: '>=14.0.0'}
|
||||||
cpu: [wasm32]
|
cpu: [wasm32]
|
||||||
|
|
||||||
'@rolldown/binding-win32-arm64-msvc@1.0.0-beta.50':
|
'@rolldown/binding-win32-arm64-msvc@1.0.0-beta.53':
|
||||||
resolution: {integrity: sha512-7kcNLi7Ua59JTTLvbe1dYb028QEPaJPJQHqkmSZ5q3tJueUeb6yjRtx8mw4uIqgWZcnQHAR3PrLN4XRJxvgIkA==}
|
resolution: {integrity: sha512-s27uU7tpCWSjHBnxyVXHt3rMrQdJq5MHNv3BzsewCIroIw3DJFjMH1dzCPPMUFxnh1r52Nf9IJ/eWp6LDoyGcw==}
|
||||||
engines: {node: ^20.19.0 || >=22.12.0}
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [win32]
|
os: [win32]
|
||||||
|
|
||||||
'@rolldown/binding-win32-ia32-msvc@1.0.0-beta.50':
|
'@rolldown/binding-win32-x64-msvc@1.0.0-beta.53':
|
||||||
resolution: {integrity: sha512-lL70VTNvSCdSZkDPPVMwWn/M2yQiYvSoXw9hTLgdIWdUfC3g72UaruezusR6ceRuwHCY1Ayu2LtKqXkBO5LIwg==}
|
resolution: {integrity: sha512-cjWL/USPJ1g0en2htb4ssMjIycc36RvdQAx1WlXnS6DpULswiUTVXPDesTifSKYSyvx24E0YqQkEm0K/M2Z/AA==}
|
||||||
engines: {node: ^20.19.0 || >=22.12.0}
|
|
||||||
cpu: [ia32]
|
|
||||||
os: [win32]
|
|
||||||
|
|
||||||
'@rolldown/binding-win32-x64-msvc@1.0.0-beta.50':
|
|
||||||
resolution: {integrity: sha512-4qU4x5DXWB4JPjyTne/wBNPqkbQU8J45bl21geERBKtEittleonioACBL1R0PsBu0Aq21SwMK5a9zdBkWSlQtQ==}
|
|
||||||
engines: {node: ^20.19.0 || >=22.12.0}
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [win32]
|
os: [win32]
|
||||||
|
|
||||||
'@rolldown/pluginutils@1.0.0-beta.50':
|
|
||||||
resolution: {integrity: sha512-5e76wQiQVeL1ICOZVUg4LSOVYg9jyhGCin+icYozhsUzM+fHE7kddi1bdiE0jwVqTfkjba3jUFbEkoC9WkdvyA==}
|
|
||||||
|
|
||||||
'@rolldown/pluginutils@1.0.0-beta.53':
|
'@rolldown/pluginutils@1.0.0-beta.53':
|
||||||
resolution: {integrity: sha512-vENRlFU4YbrwVqNDZ7fLvy+JR1CRkyr01jhSiDpE1u6py3OMzQfztQU2jxykW3ALNxO4kSlqIDeYyD0Y9RcQeQ==}
|
resolution: {integrity: sha512-vENRlFU4YbrwVqNDZ7fLvy+JR1CRkyr01jhSiDpE1u6py3OMzQfztQU2jxykW3ALNxO4kSlqIDeYyD0Y9RcQeQ==}
|
||||||
|
|
||||||
@ -425,7 +416,7 @@ packages:
|
|||||||
resolution: {integrity: sha512-EcA07pHJouywpzsoTUqNh5NwGayl2PPVEJKUSinGGSxFGYn+shYbqMGBg6FXDqgXum9Ou/ecb+411ssw8HImJQ==}
|
resolution: {integrity: sha512-EcA07pHJouywpzsoTUqNh5NwGayl2PPVEJKUSinGGSxFGYn+shYbqMGBg6FXDqgXum9Ou/ecb+411ssw8HImJQ==}
|
||||||
engines: {node: ^20.19.0 || >=22.12.0}
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
vite: ^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0
|
vite: npm:rolldown-vite@7.3.0
|
||||||
|
|
||||||
acorn-jsx@5.3.2:
|
acorn-jsx@5.3.2:
|
||||||
resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==}
|
resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==}
|
||||||
@ -897,13 +888,13 @@ packages:
|
|||||||
resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==}
|
resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==}
|
||||||
engines: {node: '>=4'}
|
engines: {node: '>=4'}
|
||||||
|
|
||||||
rolldown-vite@7.2.5:
|
rolldown-vite@7.3.0:
|
||||||
resolution: {integrity: sha512-u09tdk/huMiN8xwoiBbig197jKdCamQTtOruSalOzbqGje3jdHiV0njQlAW0YvzoahkirFePNQ4RYlfnRQpXZA==}
|
resolution: {integrity: sha512-5hI5NCJwKBGtzWtdKB3c2fOEpI77Iaa0z4mSzZPU1cJ/OqrGbFafm90edVCd7T9Snz+Sh09TMAv4EQqyVLzuEg==}
|
||||||
engines: {node: ^20.19.0 || >=22.12.0}
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
'@types/node': ^20.19.0 || >=22.12.0
|
'@types/node': ^20.19.0 || >=22.12.0
|
||||||
esbuild: ^0.25.0
|
esbuild: ^0.27.0
|
||||||
jiti: '>=1.21.0'
|
jiti: '>=1.21.0'
|
||||||
less: ^4.0.0
|
less: ^4.0.0
|
||||||
sass: ^1.70.0
|
sass: ^1.70.0
|
||||||
@ -937,8 +928,8 @@ packages:
|
|||||||
yaml:
|
yaml:
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
rolldown@1.0.0-beta.50:
|
rolldown@1.0.0-beta.53:
|
||||||
resolution: {integrity: sha512-JFULvCNl/anKn99eKjOSEubi0lLmNqQDAjyEMME2T4CwezUDL0i6t1O9xZsu2OMehPnV2caNefWpGF+8TnzB6A==}
|
resolution: {integrity: sha512-Qd9c2p0XKZdgT5AYd+KgAMggJ8ZmCs3JnS9PTMWkyUfteKlfmKtxJbWTHkVakxwXs1Ub7jrRYVeFeF7N0sQxyw==}
|
||||||
engines: {node: ^20.19.0 || >=22.12.0}
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
@ -1268,56 +1259,51 @@ snapshots:
|
|||||||
'@tybys/wasm-util': 0.10.1
|
'@tybys/wasm-util': 0.10.1
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@oxc-project/runtime@0.97.0': {}
|
'@oxc-project/runtime@0.101.0': {}
|
||||||
|
|
||||||
'@oxc-project/types@0.97.0': {}
|
'@oxc-project/types@0.101.0': {}
|
||||||
|
|
||||||
'@rolldown/binding-android-arm64@1.0.0-beta.50':
|
'@rolldown/binding-android-arm64@1.0.0-beta.53':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rolldown/binding-darwin-arm64@1.0.0-beta.50':
|
'@rolldown/binding-darwin-arm64@1.0.0-beta.53':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rolldown/binding-darwin-x64@1.0.0-beta.50':
|
'@rolldown/binding-darwin-x64@1.0.0-beta.53':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rolldown/binding-freebsd-x64@1.0.0-beta.50':
|
'@rolldown/binding-freebsd-x64@1.0.0-beta.53':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.50':
|
'@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.53':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rolldown/binding-linux-arm64-gnu@1.0.0-beta.50':
|
'@rolldown/binding-linux-arm64-gnu@1.0.0-beta.53':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rolldown/binding-linux-arm64-musl@1.0.0-beta.50':
|
'@rolldown/binding-linux-arm64-musl@1.0.0-beta.53':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rolldown/binding-linux-x64-gnu@1.0.0-beta.50':
|
'@rolldown/binding-linux-x64-gnu@1.0.0-beta.53':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rolldown/binding-linux-x64-musl@1.0.0-beta.50':
|
'@rolldown/binding-linux-x64-musl@1.0.0-beta.53':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rolldown/binding-openharmony-arm64@1.0.0-beta.50':
|
'@rolldown/binding-openharmony-arm64@1.0.0-beta.53':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rolldown/binding-wasm32-wasi@1.0.0-beta.50':
|
'@rolldown/binding-wasm32-wasi@1.0.0-beta.53':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@napi-rs/wasm-runtime': 1.1.0
|
'@napi-rs/wasm-runtime': 1.1.0
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rolldown/binding-win32-arm64-msvc@1.0.0-beta.50':
|
'@rolldown/binding-win32-arm64-msvc@1.0.0-beta.53':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rolldown/binding-win32-ia32-msvc@1.0.0-beta.50':
|
'@rolldown/binding-win32-x64-msvc@1.0.0-beta.53':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@rolldown/binding-win32-x64-msvc@1.0.0-beta.50':
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
'@rolldown/pluginutils@1.0.0-beta.50': {}
|
|
||||||
|
|
||||||
'@rolldown/pluginutils@1.0.0-beta.53': {}
|
'@rolldown/pluginutils@1.0.0-beta.53': {}
|
||||||
|
|
||||||
'@tybys/wasm-util@0.10.1':
|
'@tybys/wasm-util@0.10.1':
|
||||||
@ -1454,7 +1440,7 @@ snapshots:
|
|||||||
'@typescript-eslint/types': 8.48.1
|
'@typescript-eslint/types': 8.48.1
|
||||||
eslint-visitor-keys: 4.2.1
|
eslint-visitor-keys: 4.2.1
|
||||||
|
|
||||||
'@vitejs/plugin-react@5.1.2(rolldown-vite@7.2.5(@types/node@24.10.1))':
|
'@vitejs/plugin-react@5.1.2(rolldown-vite@7.3.0(@types/node@24.10.1))':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@babel/core': 7.28.5
|
'@babel/core': 7.28.5
|
||||||
'@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/core@7.28.5)
|
'@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/core@7.28.5)
|
||||||
@ -1462,7 +1448,7 @@ snapshots:
|
|||||||
'@rolldown/pluginutils': 1.0.0-beta.53
|
'@rolldown/pluginutils': 1.0.0-beta.53
|
||||||
'@types/babel__core': 7.20.5
|
'@types/babel__core': 7.20.5
|
||||||
react-refresh: 0.18.0
|
react-refresh: 0.18.0
|
||||||
vite: rolldown-vite@7.2.5(@types/node@24.10.1)
|
vite: rolldown-vite@7.3.0(@types/node@24.10.1)
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
@ -1870,38 +1856,37 @@ snapshots:
|
|||||||
|
|
||||||
resolve-from@4.0.0: {}
|
resolve-from@4.0.0: {}
|
||||||
|
|
||||||
rolldown-vite@7.2.5(@types/node@24.10.1):
|
rolldown-vite@7.3.0(@types/node@24.10.1):
|
||||||
dependencies:
|
dependencies:
|
||||||
'@oxc-project/runtime': 0.97.0
|
'@oxc-project/runtime': 0.101.0
|
||||||
fdir: 6.5.0(picomatch@4.0.3)
|
fdir: 6.5.0(picomatch@4.0.3)
|
||||||
lightningcss: 1.30.2
|
lightningcss: 1.30.2
|
||||||
picomatch: 4.0.3
|
picomatch: 4.0.3
|
||||||
postcss: 8.5.6
|
postcss: 8.5.6
|
||||||
rolldown: 1.0.0-beta.50
|
rolldown: 1.0.0-beta.53
|
||||||
tinyglobby: 0.2.15
|
tinyglobby: 0.2.15
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
'@types/node': 24.10.1
|
'@types/node': 24.10.1
|
||||||
fsevents: 2.3.3
|
fsevents: 2.3.3
|
||||||
|
|
||||||
rolldown@1.0.0-beta.50:
|
rolldown@1.0.0-beta.53:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@oxc-project/types': 0.97.0
|
'@oxc-project/types': 0.101.0
|
||||||
'@rolldown/pluginutils': 1.0.0-beta.50
|
'@rolldown/pluginutils': 1.0.0-beta.53
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
'@rolldown/binding-android-arm64': 1.0.0-beta.50
|
'@rolldown/binding-android-arm64': 1.0.0-beta.53
|
||||||
'@rolldown/binding-darwin-arm64': 1.0.0-beta.50
|
'@rolldown/binding-darwin-arm64': 1.0.0-beta.53
|
||||||
'@rolldown/binding-darwin-x64': 1.0.0-beta.50
|
'@rolldown/binding-darwin-x64': 1.0.0-beta.53
|
||||||
'@rolldown/binding-freebsd-x64': 1.0.0-beta.50
|
'@rolldown/binding-freebsd-x64': 1.0.0-beta.53
|
||||||
'@rolldown/binding-linux-arm-gnueabihf': 1.0.0-beta.50
|
'@rolldown/binding-linux-arm-gnueabihf': 1.0.0-beta.53
|
||||||
'@rolldown/binding-linux-arm64-gnu': 1.0.0-beta.50
|
'@rolldown/binding-linux-arm64-gnu': 1.0.0-beta.53
|
||||||
'@rolldown/binding-linux-arm64-musl': 1.0.0-beta.50
|
'@rolldown/binding-linux-arm64-musl': 1.0.0-beta.53
|
||||||
'@rolldown/binding-linux-x64-gnu': 1.0.0-beta.50
|
'@rolldown/binding-linux-x64-gnu': 1.0.0-beta.53
|
||||||
'@rolldown/binding-linux-x64-musl': 1.0.0-beta.50
|
'@rolldown/binding-linux-x64-musl': 1.0.0-beta.53
|
||||||
'@rolldown/binding-openharmony-arm64': 1.0.0-beta.50
|
'@rolldown/binding-openharmony-arm64': 1.0.0-beta.53
|
||||||
'@rolldown/binding-wasm32-wasi': 1.0.0-beta.50
|
'@rolldown/binding-wasm32-wasi': 1.0.0-beta.53
|
||||||
'@rolldown/binding-win32-arm64-msvc': 1.0.0-beta.50
|
'@rolldown/binding-win32-arm64-msvc': 1.0.0-beta.53
|
||||||
'@rolldown/binding-win32-ia32-msvc': 1.0.0-beta.50
|
'@rolldown/binding-win32-x64-msvc': 1.0.0-beta.53
|
||||||
'@rolldown/binding-win32-x64-msvc': 1.0.0-beta.50
|
|
||||||
|
|
||||||
scheduler@0.27.0: {}
|
scheduler@0.27.0: {}
|
||||||
|
|
||||||
|
|||||||
@ -24,7 +24,13 @@ function App() {
|
|||||||
const [token, setToken] = useState<string>(
|
const [token, setToken] = useState<string>(
|
||||||
localStorage.getItem("token") || ""
|
localStorage.getItem("token") || ""
|
||||||
);
|
);
|
||||||
const [theme, setTheme] = useState<string>("default");
|
const [theme, _setTheme] = useState<string>(
|
||||||
|
localStorage.getItem("theme") || "default"
|
||||||
|
);
|
||||||
|
const setTheme = (theme: string) => {
|
||||||
|
_setTheme(theme);
|
||||||
|
localStorage.setItem("theme", theme);
|
||||||
|
};
|
||||||
const [toasts, setToasts] = useState<ToastMessage[]>([]);
|
const [toasts, setToasts] = useState<ToastMessage[]>([]);
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
|
||||||
|
|||||||
@ -1,25 +1,19 @@
|
|||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect } from "react";
|
||||||
import {
|
import { Person, PersonList as PersonListProto } from "../items";
|
||||||
Person,
|
|
||||||
PersonList as PersonListProto,
|
|
||||||
Game as GameProto,
|
|
||||||
GetGameInfoRequest,
|
|
||||||
GameInfoResponse,
|
|
||||||
} from "../items";
|
|
||||||
import { apiFetch } from "./api";
|
import { apiFetch } from "./api";
|
||||||
import { Link } from "react-router-dom";
|
import "./GameFilter.css";
|
||||||
import { GameImage } from "./GameImage";
|
import { useGameFilter } from "./hooks/useGameFilter";
|
||||||
import "./GameFilter.css"
|
import { PersonSelector } from "./components/PersonSelector";
|
||||||
|
import { FilteredGamesList } from "./components/FilteredGamesList";
|
||||||
|
|
||||||
export function GameFilter() {
|
export function GameFilter() {
|
||||||
const [people, setPeople] = useState<Person[]>([]);
|
const [people, setPeople] = useState<Person[]>([]);
|
||||||
const [selectedPeople, setSelectedPeople] = useState<Set<string>>(new Set());
|
const [selectedPeople, setSelectedPeople] = useState<Set<string>>(new Set());
|
||||||
const [filteredGames, setFilteredGames] = useState<string[]>([]);
|
|
||||||
const [gameToPositive, setGameToPositive] = useState<
|
const { filteredGames, gameToPositive } = useGameFilter(
|
||||||
Map<string, Set<string>>
|
people,
|
||||||
>(new Map());
|
selectedPeople
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
);
|
||||||
const [metaData, _setMetaData] = useState<{ [key: string]: GameProto }>({});
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
apiFetch("/api")
|
apiFetch("/api")
|
||||||
@ -31,83 +25,6 @@ export function GameFilter() {
|
|||||||
.catch((err) => console.error("Failed to fetch people:", err));
|
.catch((err) => console.error("Failed to fetch people:", err));
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (selectedPeople.size === 0) {
|
|
||||||
// eslint-disable-next-line react-hooks/set-state-in-effect
|
|
||||||
setFilteredGames([]);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get all games where ALL selected people have "Would Play"
|
|
||||||
const selectedPersons = people.filter((p) => selectedPeople.has(p.name));
|
|
||||||
|
|
||||||
if (selectedPersons.length === 0) {
|
|
||||||
setFilteredGames([]);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create a map of game -> set of people who would not play it
|
|
||||||
const gameToNegative = new Map<string, Set<string>>();
|
|
||||||
const gameToPositiveOpinion = new Map<string, Set<string>>();
|
|
||||||
|
|
||||||
selectedPersons.forEach((person) => {
|
|
||||||
person.opinion.forEach((op) => {
|
|
||||||
if (!gameToNegative.has(op.title)) {
|
|
||||||
gameToNegative.set(op.title, new Set());
|
|
||||||
}
|
|
||||||
if (!gameToPositiveOpinion.has(op.title)) {
|
|
||||||
gameToPositiveOpinion.set(op.title, new Set());
|
|
||||||
}
|
|
||||||
if (!op.wouldPlay) {
|
|
||||||
gameToNegative.get(op.title)!.add(person.name);
|
|
||||||
}
|
|
||||||
if (op.wouldPlay) {
|
|
||||||
gameToPositiveOpinion.get(op.title)!.add(person.name);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
setGameToPositive(gameToPositiveOpinion);
|
|
||||||
|
|
||||||
// Filter games where ALL selected people would play
|
|
||||||
const game_titles = Array.from(gameToNegative.entries())
|
|
||||||
.filter(([, players]) => players.size === 0)
|
|
||||||
.map(([game]) => game);
|
|
||||||
|
|
||||||
let games = game_titles.filter((title) => metaData[title]).map((title) => metaData[title]);
|
|
||||||
const gamesToFetch = GetGameInfoRequest.encode(
|
|
||||||
GetGameInfoRequest.create({
|
|
||||||
games: game_titles.filter((title) => !metaData[title]),
|
|
||||||
})
|
|
||||||
).finish();
|
|
||||||
|
|
||||||
apiFetch("/api/games/batch", {
|
|
||||||
method: "POST",
|
|
||||||
headers: {
|
|
||||||
"Content-Type": "application/octet-stream",
|
|
||||||
},
|
|
||||||
body: gamesToFetch,
|
|
||||||
})
|
|
||||||
.then((res) => res.arrayBuffer())
|
|
||||||
.then((buffer) => {
|
|
||||||
const list = GameInfoResponse.decode(new Uint8Array(buffer));
|
|
||||||
games = games.concat(list.games);
|
|
||||||
|
|
||||||
games.forEach((game) => {
|
|
||||||
metaData[game.title] = game;
|
|
||||||
});
|
|
||||||
|
|
||||||
const filteredGames = games.filter((g) => {
|
|
||||||
const game = g as GameProto;
|
|
||||||
return (
|
|
||||||
game.maxPlayers >= selectedPeople.size &&
|
|
||||||
game.minPlayers <= selectedPeople.size
|
|
||||||
);
|
|
||||||
});
|
|
||||||
setFilteredGames(filteredGames.map((g) => (g as GameProto).title));
|
|
||||||
});
|
|
||||||
}, [selectedPeople, people, metaData]);
|
|
||||||
|
|
||||||
const togglePerson = (name: string) => {
|
const togglePerson = (name: string) => {
|
||||||
const newSelected = new Set(selectedPeople);
|
const newSelected = new Set(selectedPeople);
|
||||||
if (newSelected.has(name)) {
|
if (newSelected.has(name)) {
|
||||||
@ -125,118 +42,17 @@ export function GameFilter() {
|
|||||||
Select multiple people to find games that everyone would play
|
Select multiple people to find games that everyone would play
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div style={{ marginBottom: "3rem" }}>
|
<PersonSelector
|
||||||
<h3>Select People</h3>
|
people={people}
|
||||||
<div
|
selectedPeople={selectedPeople}
|
||||||
className="grid-container"
|
onTogglePerson={togglePerson}
|
||||||
style={{
|
/>
|
||||||
display: "flex",
|
|
||||||
flexWrap: "wrap",
|
|
||||||
gap: "1rem",
|
|
||||||
justifyContent: "center",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{people.map((person) => (
|
|
||||||
<div
|
|
||||||
key={person.name}
|
|
||||||
className="list-item gamefilter-entry"
|
|
||||||
style={{
|
|
||||||
borderColor: selectedPeople.has(person.name)
|
|
||||||
? "var(--accent-color)"
|
|
||||||
: "var(--border-color)",
|
|
||||||
}}
|
|
||||||
onClick={() => togglePerson(person.name)}
|
|
||||||
>
|
|
||||||
<div style={{ gap: "0.5rem" }}>
|
|
||||||
<strong>{person.name}</strong>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
fontSize: "0.9em",
|
|
||||||
color: "var(--text-muted)",
|
|
||||||
marginTop: "0.5rem",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{person.opinion.length} opinion(s)
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{selectedPeople.size > 0 && (
|
<FilteredGamesList
|
||||||
<div>
|
filteredGames={filteredGames}
|
||||||
<h3>Games Everyone Would Play ({filteredGames.length})</h3>
|
gameToPositive={gameToPositive}
|
||||||
{filteredGames.length > 0 ? (
|
selectedPeopleCount={selectedPeople.size}
|
||||||
<ul className="grid-container">
|
/>
|
||||||
{filteredGames.map((game) => (
|
|
||||||
<Link
|
|
||||||
to={`/game/${encodeURIComponent(game)}`}
|
|
||||||
key={game}
|
|
||||||
className="list-item game-entry"
|
|
||||||
style={{
|
|
||||||
textDecoration: "none",
|
|
||||||
color: "inherit",
|
|
||||||
display: "flex",
|
|
||||||
justifyContent: "space-between",
|
|
||||||
alignItems: "center",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div>
|
|
||||||
<strong>{game}</strong>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
fontSize: "0.9em",
|
|
||||||
color: "#4caf50",
|
|
||||||
marginTop: "0.5rem",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<span>✓</span> {gameToPositive.get(game)!.size} selected
|
|
||||||
would play
|
|
||||||
</div>
|
|
||||||
{selectedPeople.size - gameToPositive.get(game)!.size >
|
|
||||||
0 && (
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
fontSize: "0.9em",
|
|
||||||
color: "#d4d400",
|
|
||||||
marginTop: "0.3rem",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<span>?</span>{" "}
|
|
||||||
{selectedPeople.size - gameToPositive.get(game)!.size}{" "}
|
|
||||||
{selectedPeople.size - gameToPositive.get(game)!.size >
|
|
||||||
1
|
|
||||||
? "are"
|
|
||||||
: "is"}{" "}
|
|
||||||
neutral
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
<GameImage game={game} />
|
|
||||||
</Link>
|
|
||||||
))}
|
|
||||||
</ul>
|
|
||||||
) : (
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
padding: "3rem",
|
|
||||||
textAlign: "center",
|
|
||||||
background: "var(--secondary-alt-bg)",
|
|
||||||
borderRadius: "16px",
|
|
||||||
border: "1px dashed var(--border-color)",
|
|
||||||
color: "var(--text-muted)",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div style={{ fontSize: "2rem", marginBottom: "1rem" }}>🔍</div>
|
|
||||||
<p>No games found where all selected people would play.</p>
|
|
||||||
<p style={{ fontSize: "0.9rem" }}>
|
|
||||||
Try selecting fewer people or adding more opinions!
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
94
frontend/src/components/FilteredGamesList.tsx
Normal file
94
frontend/src/components/FilteredGamesList.tsx
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
import { Link } from "react-router-dom";
|
||||||
|
import { GameImage } from "../GameImage";
|
||||||
|
|
||||||
|
interface FilteredGamesListProps {
|
||||||
|
filteredGames: string[];
|
||||||
|
gameToPositive: Map<string, Set<string>>;
|
||||||
|
selectedPeopleCount: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function FilteredGamesList({
|
||||||
|
filteredGames,
|
||||||
|
gameToPositive,
|
||||||
|
selectedPeopleCount,
|
||||||
|
}: FilteredGamesListProps) {
|
||||||
|
if (selectedPeopleCount === 0) return null;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<h3>Games Everyone Would Play ({filteredGames.length})</h3>
|
||||||
|
{filteredGames.length > 0 ? (
|
||||||
|
<ul className="grid-container">
|
||||||
|
{filteredGames.map((game) => {
|
||||||
|
const positiveCount = gameToPositive.get(game)?.size || 0;
|
||||||
|
const neutralCount = selectedPeopleCount - positiveCount;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Link
|
||||||
|
to={`/game/${encodeURIComponent(game)}`}
|
||||||
|
key={game}
|
||||||
|
className="list-item game-entry"
|
||||||
|
style={{
|
||||||
|
textDecoration: "none",
|
||||||
|
color: "inherit",
|
||||||
|
display: "flex",
|
||||||
|
justifyContent: "space-between",
|
||||||
|
alignItems: "center",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<strong>{game}</strong>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
fontSize: "0.9em",
|
||||||
|
color: "#4caf50",
|
||||||
|
marginTop: "0.5rem",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<span>✓</span> {positiveCount} selected would play
|
||||||
|
</div>
|
||||||
|
{neutralCount > 0 && (
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
fontSize: "0.9em",
|
||||||
|
color: "#d4d400",
|
||||||
|
marginTop: "0.3rem",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<span>?</span> {neutralCount}{" "}
|
||||||
|
{neutralCount > 1 ? "are" : "is"} neutral
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<GameImage game={game} />
|
||||||
|
</Link>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</ul>
|
||||||
|
) : (
|
||||||
|
<EmptyState />
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function EmptyState() {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
padding: "3rem",
|
||||||
|
textAlign: "center",
|
||||||
|
background: "var(--secondary-alt-bg)",
|
||||||
|
borderRadius: "16px",
|
||||||
|
border: "1px dashed var(--border-color)",
|
||||||
|
color: "var(--text-muted)",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div style={{ fontSize: "2rem", marginBottom: "1rem" }}>🔍</div>
|
||||||
|
<p>No games found where all selected people would play.</p>
|
||||||
|
<p style={{ fontSize: "0.9rem" }}>
|
||||||
|
Try selecting fewer people or adding more opinions!
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
55
frontend/src/components/PersonSelector.tsx
Normal file
55
frontend/src/components/PersonSelector.tsx
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
import { Person } from "../../items";
|
||||||
|
|
||||||
|
interface PersonSelectorProps {
|
||||||
|
people: Person[];
|
||||||
|
selectedPeople: Set<string>;
|
||||||
|
onTogglePerson: (name: string) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function PersonSelector({
|
||||||
|
people,
|
||||||
|
selectedPeople,
|
||||||
|
onTogglePerson,
|
||||||
|
}: PersonSelectorProps) {
|
||||||
|
return (
|
||||||
|
<div style={{ marginBottom: "3rem" }}>
|
||||||
|
<h3>Select People</h3>
|
||||||
|
<div
|
||||||
|
className="grid-container"
|
||||||
|
style={{
|
||||||
|
display: "flex",
|
||||||
|
flexWrap: "wrap",
|
||||||
|
gap: "1rem",
|
||||||
|
justifyContent: "center",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{people.map((person) => (
|
||||||
|
<div
|
||||||
|
key={person.name}
|
||||||
|
className="list-item gamefilter-entry"
|
||||||
|
style={{
|
||||||
|
borderColor: selectedPeople.has(person.name)
|
||||||
|
? "var(--accent-color)"
|
||||||
|
: "var(--border-color)",
|
||||||
|
cursor: "pointer",
|
||||||
|
}}
|
||||||
|
onClick={() => onTogglePerson(person.name)}
|
||||||
|
>
|
||||||
|
<div style={{ gap: "0.5rem" }}>
|
||||||
|
<strong>{person.name}</strong>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
fontSize: "0.9em",
|
||||||
|
color: "var(--text-muted)",
|
||||||
|
marginTop: "0.5rem",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{person.opinion.length} opinion(s)
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
98
frontend/src/hooks/useGameFilter.ts
Normal file
98
frontend/src/hooks/useGameFilter.ts
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
import { useState, useEffect, useRef, useMemo } from "react";
|
||||||
|
import {
|
||||||
|
Person,
|
||||||
|
Game as GameProto,
|
||||||
|
GetGameInfoRequest,
|
||||||
|
GameInfoResponse,
|
||||||
|
} from "../../items";
|
||||||
|
import { apiFetch } from "../api";
|
||||||
|
|
||||||
|
export function useGameFilter(people: Person[], selectedPeople: Set<string>) {
|
||||||
|
const [fetchedTitles, setFetchedTitles] = useState<string[]>([]);
|
||||||
|
const metaDataRef = useRef<{ [key: string]: GameProto }>({});
|
||||||
|
|
||||||
|
const { gameToNegative, gameToPositiveOpinion } = useMemo(() => {
|
||||||
|
const gameToNegative = new Map<string, Set<string>>();
|
||||||
|
const gameToPositiveOpinion = new Map<string, Set<string>>();
|
||||||
|
|
||||||
|
if (selectedPeople.size === 0)
|
||||||
|
return { gameToNegative, gameToPositiveOpinion };
|
||||||
|
|
||||||
|
const selectedPersons = people.filter((p) => selectedPeople.has(p.name));
|
||||||
|
selectedPersons.forEach((person) => {
|
||||||
|
person.opinion.forEach((op) => {
|
||||||
|
if (!gameToNegative.has(op.title))
|
||||||
|
gameToNegative.set(op.title, new Set());
|
||||||
|
if (!gameToPositiveOpinion.has(op.title))
|
||||||
|
gameToPositiveOpinion.set(op.title, new Set());
|
||||||
|
|
||||||
|
if (!op.wouldPlay) {
|
||||||
|
gameToNegative.get(op.title)!.add(person.name);
|
||||||
|
} else {
|
||||||
|
gameToPositiveOpinion.get(op.title)!.add(person.name);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
return { gameToNegative, gameToPositiveOpinion };
|
||||||
|
}, [people, selectedPeople]);
|
||||||
|
|
||||||
|
const titlesEveryoneWouldPlay = useMemo(() => {
|
||||||
|
return Array.from(gameToNegative.entries())
|
||||||
|
.filter(([, players]) => players.size === 0)
|
||||||
|
.map(([game]) => game);
|
||||||
|
}, [gameToNegative]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const titlesToFetch = titlesEveryoneWouldPlay.filter(
|
||||||
|
(title) => !metaDataRef.current[title]
|
||||||
|
);
|
||||||
|
if (titlesToFetch.length === 0) return;
|
||||||
|
|
||||||
|
const gamesToFetch = GetGameInfoRequest.encode(
|
||||||
|
GetGameInfoRequest.create({
|
||||||
|
games: titlesToFetch,
|
||||||
|
})
|
||||||
|
).finish();
|
||||||
|
|
||||||
|
apiFetch("/api/games/batch", {
|
||||||
|
method: "POST",
|
||||||
|
headers: { "Content-Type": "application/octet-stream" },
|
||||||
|
body: gamesToFetch,
|
||||||
|
})
|
||||||
|
.then((res) => res.arrayBuffer())
|
||||||
|
.then((buffer) => {
|
||||||
|
const list = GameInfoResponse.decode(new Uint8Array(buffer));
|
||||||
|
list.games.forEach((game) => {
|
||||||
|
metaDataRef.current[game.title] = game;
|
||||||
|
});
|
||||||
|
// Trigger a re-render to update filteredGames
|
||||||
|
setFetchedTitles([...titlesToFetch]);
|
||||||
|
})
|
||||||
|
.catch((err) => console.error("Failed to fetch game metadata:", err));
|
||||||
|
}, [titlesEveryoneWouldPlay]);
|
||||||
|
|
||||||
|
const filteredGames = useMemo(() => {
|
||||||
|
if (selectedPeople.size === 0) return [];
|
||||||
|
|
||||||
|
const games = titlesEveryoneWouldPlay
|
||||||
|
.filter((title) => metaDataRef.current[title])
|
||||||
|
.map((title) => metaDataRef.current[title]);
|
||||||
|
|
||||||
|
return filterByPlayerCount(games, selectedPeople.size);
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
}, [titlesEveryoneWouldPlay, selectedPeople.size, fetchedTitles]);
|
||||||
|
|
||||||
|
return { filteredGames, gameToPositive: gameToPositiveOpinion };
|
||||||
|
}
|
||||||
|
|
||||||
|
function filterByPlayerCount(
|
||||||
|
games: GameProto[],
|
||||||
|
playerCount: number
|
||||||
|
): string[] {
|
||||||
|
return games
|
||||||
|
.filter(
|
||||||
|
(game) => game.maxPlayers >= playerCount && game.minPlayers <= playerCount
|
||||||
|
)
|
||||||
|
.map((game) => game.title);
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user