From bf2ea61b1d46209b0856669f9eeab9bc3c08e4dc Mon Sep 17 00:00:00 2001 From: Ben Wagner Date: Tue, 5 Mar 2019 23:23:45 -0500 Subject: [PATCH] Hide selected picks option (#385) * hide picks option * reword --- package-lock.json | 86 +++----------------------------- public/src/app.js | 1 + public/src/game/Game.jsx | 5 +- public/src/game/GameSettings.jsx | 3 ++ public/src/game/PlayersPanel.jsx | 2 +- 5 files changed, 14 insertions(+), 83 deletions(-) diff --git a/package-lock.json b/package-lock.json index 654577a2..b08830b8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1868,6 +1868,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, "requires": { "array-uniq": "^1.0.1" } @@ -1875,7 +1876,8 @@ "array-uniq": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=" + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true }, "array-unique": { "version": "0.3.2", @@ -2603,14 +2605,6 @@ } } }, - "clean-webpack-plugin": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/clean-webpack-plugin/-/clean-webpack-plugin-2.0.0.tgz", - "integrity": "sha512-xH9RUgXaeeW2VmtygwcGNFAmYzRrv93uHk+c5gYA4qHmX1gpRfjScsvvCT7PcUb0Z5Y30H/pswTM1qYApVLBXA==", - "requires": { - "del": "^4.0.0" - } - }, "cli-boxes": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-1.0.0.tgz", @@ -3135,45 +3129,6 @@ } } }, - "del": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/del/-/del-4.0.0.tgz", - "integrity": "sha512-/BnSJ+SuZyLu7xMn48kZY0nMXDi+5KNmR4g8n21Wivsl8+B9njV6/5kcTNE9juSprp0zRWBU28JuHUq0FqK1Nw==", - "requires": { - "globby": "^6.1.0", - "is-path-cwd": "^2.0.0", - "is-path-in-cwd": "^2.0.0", - "p-map": "^2.0.0", - "pify": "^4.0.1", - "rimraf": "^2.6.2" - }, - "dependencies": { - "globby": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", - "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", - "requires": { - "array-union": "^1.0.1", - "glob": "^7.0.3", - "object-assign": "^4.0.1", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" - } - } - }, - "pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==" - } - } - }, "depd": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", @@ -5761,23 +5716,11 @@ "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", "dev": true }, - "is-path-cwd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.0.0.tgz", - "integrity": "sha512-m5dHHzpOXEiv18JEORttBO64UgTEypx99vCxQLjbBvGhOJxnTNglYoFXxwo6AbsQb79sqqycQEHv2hWkHZAijA==" - }, - "is-path-in-cwd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-2.0.0.tgz", - "integrity": "sha512-6Vz5Gc9s/sDA3JBVu0FzWufm8xaBsqy1zn8Q6gmvGP6nSDMw78aS4poBNeatWjaRpTpxxLn1WOndAiOlk+qY8A==", - "requires": { - "is-path-inside": "^1.0.0" - } - }, "is-path-inside": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", + "dev": true, "requires": { "path-is-inside": "^1.0.1" } @@ -6842,11 +6785,6 @@ "p-limit": "^2.0.0" } }, - "p-map": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.0.0.tgz", - "integrity": "sha512-GO107XdrSUmtHxVoi60qc9tUl/KkNKm+X2CF4P9amalpGxv5YqVPJNfSb0wcA+syCopkZvYYIzW8OVTQW59x/w==" - }, "p-try": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz", @@ -6964,7 +6902,8 @@ "path-is-inside": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=" + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true }, "path-key": { "version": "2.0.1", @@ -7008,19 +6947,6 @@ "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" - }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "requires": { - "pinkie": "^2.0.0" - } - }, "pkg-dir": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", diff --git a/public/src/app.js b/public/src/app.js index 2e1eaf8b..13ce9b80 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -47,6 +47,7 @@ let App = { beep: false, chat: true, cols: false, + hidepicks: false, deckSize: 40, filename: "filename", filetype: "txt", diff --git a/public/src/game/Game.jsx b/public/src/game/Game.jsx index bfeae035..3d882562 100644 --- a/public/src/game/Game.jsx +++ b/public/src/game/Game.jsx @@ -40,7 +40,7 @@ export default class Game extends Component { } render() { - const { gametype, gamesubtype } = App.state; + const { gametype, gamesubtype } = App.state const moveSettings = App.state.isGameFinished && ["regular sealed", "cube draft", "cube sealed"].includes(`${gamesubtype} ${gametype}`); return (
@@ -70,5 +70,6 @@ const CardsZone = () => { :
; const props = { zones: ["main", "side", "junk"] }; const pool = App.state.cols ? : ; - return [pack, pool]; + const showPool = !App.state.hidepicks || App.state.isGameFinished + return showPool ? [pack, pool] : [pack]; }; diff --git a/public/src/game/GameSettings.jsx b/public/src/game/GameSettings.jsx index 01adbe22..a64baa7e 100644 --- a/public/src/game/GameSettings.jsx +++ b/public/src/game/GameSettings.jsx @@ -25,6 +25,9 @@ const GameSettings = () => (
+
+ +
diff --git a/public/src/game/PlayersPanel.jsx b/public/src/game/PlayersPanel.jsx index efcf1ccf..783c342e 100644 --- a/public/src/game/PlayersPanel.jsx +++ b/public/src/game/PlayersPanel.jsx @@ -62,7 +62,7 @@ const fixPackTimeToScreen = () => { const selfTime = document.getElementById("self-time"); const selfTimeFixed = document.getElementById("self-time-fixed"); const {[0]: zone} = document.getElementsByClassName("zone"); - if (selfTime && selfTimeFixed) { + if (selfTime && selfTimeFixed && zone) { const selfRect = selfTime.getBoundingClientRect(); const zoneRect = zone.getBoundingClientRect(); const selfTimeRect = selfTimeFixed.getBoundingClientRect();