-
Notifications
You must be signed in to change notification settings - Fork 580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kiosk: Remove direct dom manipulation #9692
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
dbd694e
Remove direct dom manipulation
eanders-ms ebb109c
tweak adding game css
eanders-ms 967be8b
prettier
eanders-ms 4ac9b22
Removed unneeded css attribute
eanders-ms 7777955
update readme
eanders-ms 814ecb1
Remove unwanted memo dependency
eanders-ms File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might be misunderstanding this, but would we want to change the order for this ternary operator? If there is a game in the
builtGamesCache
, we would want thesendBuilt=1
flag, right?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might be correct! Code is unchanged from the original: https://github.com/microsoft/pxt-arcade/blob/0b1189cbc8abc015854cc940e63f6ae9dc192de4/kiosk/src/Models/Kiosk.ts#L343
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer not to change it in this PR, but will file an issue to investigate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, interesting.. Yeah, this might be a bug. If we don't see performance improvements for subsequent game launches, then the order is wrong. If we do see those load time improvements, then there's something that I'm reading incorrectly. Like you said, something to investigate.