Skip to content

Commit

Permalink
Sync kiosk changes
Browse files Browse the repository at this point in the history
  • Loading branch information
eanders-ms committed Aug 21, 2023
1 parent bd79496 commit e532762
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion kiosk/src/Components/AddingGame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const AddingGame: React.FC<IProps> = ({ kiosk }) => {
return parseInt(kioskCodeTime);
} else if (kiosk.time) {
const kioskTime = parseInt(kiosk.time);
return (kioskTime > 240 ? 240 : kioskTime) * 60;
return Math.min(240, Math.max(kioskTime, 0.5)) * 60;
} else {
return 30;
}
Expand Down
2 changes: 1 addition & 1 deletion kiosk/src/Components/GameList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ const GameList: React.FC<IProps> = ({ kiosk, addButtonSelected, deleteButtonSele
return (
<SwiperSlide key={game.id}>
<GameSlide highScores={gameHighScores} addButtonSelected={addButtonSelected}
deleteButtonSelected={deleteButtonSelected} game={game} />
deleteButtonSelected={deleteButtonSelected} game={game} locked={kiosk.locked}/>
</SwiperSlide>
)
})}
Expand Down
3 changes: 3 additions & 0 deletions kiosk/src/Components/GameSlide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ interface IProps {
addButtonSelected: boolean;
deleteButtonSelected: boolean;
game: GameData;
locked: boolean;
}
const GameSlide: React.FC<IProps> = (
{ highScores,
addButtonSelected,
deleteButtonSelected,
game,
locked
}) => {
const buttonSelected = addButtonSelected || deleteButtonSelected;
const carouselSelected = buttonSelected ? "unselected" : "selected";
Expand All @@ -38,6 +40,7 @@ const GameSlide: React.FC<IProps> = (
</div>
}
{ game.userAdded &&
!locked &&
<DeleteButton focused={deleteButtonSelected} />
}
</div>
Expand Down
7 changes: 5 additions & 2 deletions kiosk/src/Models/Kiosk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,11 @@ export class Kiosk {
const addedGames = this.getAllAddedGames();
const addedGamesObjs: GameData[] = Object.values(addedGames);
for (const game of addedGamesObjs) {
if (!game?.deleted) {
this.games.push(game);
if (game) {
game.userAdded = true;
if (!game.deleted) {
this.games.push(game);
}
}
}
}
Expand Down

0 comments on commit e532762

Please sign in to comment.