Skip to content

Commit

Permalink
Hide selected picks option (#385)
Browse files Browse the repository at this point in the history
* hide picks option

* reword
  • Loading branch information
benjaminpwagner authored and ZeldaZach committed Mar 6, 2019
1 parent 5f578cf commit bf2ea61
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 83 deletions.
86 changes: 6 additions & 80 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions public/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ let App = {
beep: false,
chat: true,
cols: false,
hidepicks: false,
deckSize: 40,
filename: "filename",
filetype: "txt",
Expand Down
5 changes: 3 additions & 2 deletions public/src/game/Game.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div className='container'>
Expand Down Expand Up @@ -70,5 +70,6 @@ const CardsZone = () => {
: <div key={"pack"}/>;
const props = { zones: ["main", "side", "junk"] };
const pool = App.state.cols ? <Cols key={"pool"} {...props}/> : <Grid key={"pool"} {...props} />;
return [pack, pool];
const showPool = !App.state.hidepicks || App.state.isGameFinished
return showPool ? [pack, pool] : [pack];
};
3 changes: 3 additions & 0 deletions public/src/game/GameSettings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ const GameSettings = () => (
<div>
<Checkbox side="left" text="Column view" link="cols" />
</div>
<div>
<Checkbox side="left" text="Hide selected picks" link="hidepicks" />
</div>
<SortCards />
<CardsImageQuality />
</span>
Expand Down
2 changes: 1 addition & 1 deletion public/src/game/PlayersPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit bf2ea61

Please sign in to comment.