refactoring cascading components
This commit is contained in:
parent
0e73b18a12
commit
dc1b961200
|
|
@ -1,28 +1,29 @@
|
||||||
import Menu from "../components/Menu";
|
import { useWordpressCustomData } from "../services/WordpressFetchData.js";
|
||||||
import { useWordpressData } from "../hooks/WordpressFetchData";
|
import { useState } from "react";
|
||||||
|
|
||||||
|
import { GameContextProvider } from "../context/GameContext.js";
|
||||||
|
|
||||||
|
import Menu from "../components/ui/Menu.jsx";
|
||||||
|
import GameContainer from "../components/game/GameContainer.jsx";
|
||||||
|
|
||||||
|
import Tutorial from "../components/game/Tutorial.jsx";
|
||||||
|
import Logo from "../components/ui/Logo.jsx";
|
||||||
|
import GameModal from "../components/game/GameModal.jsx";
|
||||||
|
|
||||||
export default function Game() {
|
export default function Game() {
|
||||||
const screenData = useWordpressData("/search-and-find");
|
|
||||||
if (!screenData) return;
|
|
||||||
console.log(screenData[0]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<>
|
||||||
<div className='page-container page-container--play'>
|
<div className='page-container page-container--play'>
|
||||||
|
<GameContextProvider>
|
||||||
<div className='screen'>
|
<div className='screen'>
|
||||||
<Menu />
|
<Logo />
|
||||||
<div className='salut'>helloo</div>
|
{/* <Menu /> */}
|
||||||
<section className='screen__game'>
|
<GameModal />
|
||||||
<h1>{screenData[0].title.rendered}</h1>
|
<Tutorial />
|
||||||
{screenData && <h2>{screenData[0].title.rendered}</h2>}
|
<GameContainer gameId={"latest"} />
|
||||||
{screenData && (
|
|
||||||
<div
|
|
||||||
dangerouslySetInnerHTML={{
|
|
||||||
__html: screenData[0].content.rendered,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</section>
|
|
||||||
</div>
|
</div>
|
||||||
|
</GameContextProvider>
|
||||||
</div>
|
</div>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user