-
Notifications
You must be signed in to change notification settings - Fork 585
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Kiosk: Remove direct dom manipulation (#9692)
* Remove direct dom manipulation * tweak adding game css * prettier * Removed unneeded css attribute * update readme * Remove unwanted memo dependency
- Loading branch information
1 parent
3514eb4
commit 5b4bd1c
Showing
10 changed files
with
42 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function Footer() { | ||
return <div className="footer"></div>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { useContext, useMemo } from "react"; | ||
import { AppStateContext } from "../State/AppStateContext"; | ||
import configData from "../config.json"; | ||
import "../Kiosk.css"; | ||
|
||
export default function PlayingGame() { | ||
const { state: kiosk, dispatch } = useContext(AppStateContext); | ||
const { launchedGameId: gameId } = kiosk; | ||
|
||
const playUrl = useMemo(() => { | ||
if (gameId) { | ||
const playUrlBase = `${configData.PlayUrlRoot}?id=${gameId}&hideSimButtons=1&noFooter=1&single=1&fullscreen=1&autofocus=1`; | ||
const playQueryParam = kiosk.builtGamesCache[gameId] | ||
? "&server=1" | ||
: "&sendBuilt=1"; | ||
return playUrlBase + playQueryParam; | ||
} | ||
}, [gameId]); | ||
return ( | ||
<iframe | ||
className="sim-embed" | ||
sandbox="allow-popups allow-forms allow-scripts allow-same-origin" | ||
src={playUrl} | ||
></iframe> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,13 @@ | ||
import { stateAndDispatch } from "../State"; | ||
import { KioskState } from "../Types"; | ||
import * as Actions from "../State/Actions"; | ||
import { navigate } from "./navigate"; | ||
import * as Gamespace from "../Services/Gamespace"; | ||
|
||
export function exitGame(nextState: KioskState): void { | ||
const { state } = stateAndDispatch(); | ||
|
||
if (state.kioskState !== KioskState.PlayingGame) { | ||
return; | ||
} | ||
|
||
navigate(nextState); | ||
|
||
Gamespace.addElements(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters