Integrated music in the Game.jsx
This commit is contained in:
parent
fb0a1e0b14
commit
b78aed6502
@ -3,8 +3,9 @@ import {GroupContext} from "@/common/contexts/GroupContext.jsx";
|
||||
import {Navigate} from "react-router";
|
||||
import "./styles.sass";
|
||||
import Waiting from "@/pages/Game/states/Waiting";
|
||||
import {socket} from "@/common/utils/socket.js";
|
||||
import Calculate from "@/pages/Game/states/Calculate/index.js";
|
||||
import Calculate from "@/pages/Game/states/Calculate";
|
||||
import Sound from "react-sound";
|
||||
import HintSound from "@/common/sounds/hint.mp3";
|
||||
|
||||
export const Game = () => {
|
||||
const {groups} = useContext(GroupContext);
|
||||
@ -23,8 +24,13 @@ export const Game = () => {
|
||||
|
||||
return (
|
||||
<div className="game-page">
|
||||
{currentState === "hint" && <h2 className="hint"><span>Ziel</span>: Erhalte durch den Verkauf von Kuchen
|
||||
so viel Gewinn wie möglich.</h2>}
|
||||
{currentState === "hint" && <>
|
||||
<Sound url={HintSound} playStatus={Sound.status.PLAYING} volume={60} loop={false}/>
|
||||
<h2 className="hint">
|
||||
<span>Ziel</span>: Erhalte durch den Verkauf von Kuchen
|
||||
so viel Gewinn wie möglich.
|
||||
</h2>
|
||||
</>}
|
||||
{currentState === "waiting" && <Waiting setState={setCurrentState}/>}
|
||||
{currentState === "calculate" && <Calculate setState={setCurrentState}/>}
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user