@@ -111,7 +111,7 @@ function ensureConnected() {
111111
112112function GamePage ( { match } ) {
113113 const user = useContext ( UserContext ) ;
114- const { volume, notifications } = useContext ( SettingsContext ) ;
114+ const { volume, notifications, focusMode } = useContext ( SettingsContext ) ;
115115 const gameId = match . params . id ;
116116 const nextGameId = useMemo ( ( ) => getNextGameId ( gameId ) , [ gameId ] ) ;
117117 const classes = useStyles ( ) ;
@@ -432,16 +432,18 @@ function GamePage({ match }) {
432432 < Grid container spacing = { 2 } >
433433 < Box clone order = { { xs : 3 , sm : 1 } } >
434434 < Grid item xs = { 12 } sm = { 4 } md = { 3 } className = { classes . sideColumn } >
435- < Paper style = { { display : "flex" , height : "100%" , padding : 8 } } >
436- < Chat
437- title = "Game Chat"
438- messageLimit = { 200 }
439- gameId = { gameId }
440- history = { history }
441- startedAt = { game . startedAt }
442- gameMode = { gameMode }
443- />
444- </ Paper >
435+ { ( focusMode !== "on" || gameEnded ) && (
436+ < Paper style = { { display : "flex" , height : "100%" , padding : 8 } } >
437+ < Chat
438+ title = "Game Chat"
439+ messageLimit = { 200 }
440+ gameId = { gameId }
441+ history = { history }
442+ startedAt = { game . startedAt }
443+ gameMode = { gameMode }
444+ />
445+ </ Paper >
446+ ) }
445447 </ Grid >
446448 </ Box >
447449 < Box clone order = { { xs : 1 , sm : 2 } } position = "relative" >
@@ -510,21 +512,23 @@ function GamePage({ match }) {
510512 </ Box >
511513 < Box clone order = { { xs : 2 , sm : 3 } } >
512514 < Grid item xs = { 12 } md = { 3 } className = { classes . sideColumn } >
513- < Box order = { { xs : 2 , md : 1 } } style = { { maxHeight : "100%" } } >
514- < GameSidebar
515- game = { game }
516- scores = { scores }
517- leaderboard = { leaderboard }
518- pause = { gameData . pause }
519- endedAt = {
520- game . status === "done"
521- ? game . endedAt
522- : ! answer && history . length > 0
523- ? history [ history . length - 1 ] . time
524- : 0
525- }
526- />
527- </ Box >
515+ { ( focusMode !== "on" || gameEnded ) && (
516+ < Box order = { { xs : 2 , md : 1 } } style = { { maxHeight : "100%" } } >
517+ < GameSidebar
518+ game = { game }
519+ scores = { scores }
520+ leaderboard = { leaderboard }
521+ pause = { gameData . pause }
522+ endedAt = {
523+ game . status === "done"
524+ ? game . endedAt
525+ : ! answer && history . length > 0
526+ ? history [ history . length - 1 ] . time
527+ : 0
528+ }
529+ />
530+ </ Box >
531+ ) }
528532 { game . enableHint && (
529533 < Box order = { { xs : 1 , md : 2 } } >
530534 < Box mt = { { xs : 0 , md : 2 } } mb = { 1 } >
0 commit comments