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 {Navigate} from "react-router";
|
||||||
import "./styles.sass";
|
import "./styles.sass";
|
||||||
import Waiting from "@/pages/Game/states/Waiting";
|
import Waiting from "@/pages/Game/states/Waiting";
|
||||||
import {socket} from "@/common/utils/socket.js";
|
import Calculate from "@/pages/Game/states/Calculate";
|
||||||
import Calculate from "@/pages/Game/states/Calculate/index.js";
|
import Sound from "react-sound";
|
||||||
|
import HintSound from "@/common/sounds/hint.mp3";
|
||||||
|
|
||||||
export const Game = () => {
|
export const Game = () => {
|
||||||
const {groups} = useContext(GroupContext);
|
const {groups} = useContext(GroupContext);
|
||||||
@ -23,8 +24,13 @@ export const Game = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="game-page">
|
<div className="game-page">
|
||||||
{currentState === "hint" && <h2 className="hint"><span>Ziel</span>: Erhalte durch den Verkauf von Kuchen
|
{currentState === "hint" && <>
|
||||||
so viel Gewinn wie möglich.</h2>}
|
<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 === "waiting" && <Waiting setState={setCurrentState}/>}
|
||||||
{currentState === "calculate" && <Calculate setState={setCurrentState}/>}
|
{currentState === "calculate" && <Calculate setState={setCurrentState}/>}
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user