-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
1,658 additions
and
26 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
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,13 +1,41 @@ | ||
//imports needed | ||
import "./App.css"; | ||
import { createBrowserRouter, RouterProvider } from "react-router-dom";// docs: https://reactrouter.com/en/main/start/overview | ||
|
||
//imports of pages | ||
import { HomePage } from "./pages/HomePage"; | ||
import { InGame } from "./pages/InGame"; | ||
import { Lobby } from "./pages/Lobby"; | ||
import { RoundEnd } from "./pages/RoundEnd"; | ||
|
||
// router | ||
const router = createBrowserRouter([ | ||
{ | ||
path: "/", | ||
element: <HomePage />, | ||
}, | ||
{ | ||
path: "/in-game", | ||
element: <InGame />, | ||
}, | ||
{ | ||
path: "/lobby", | ||
element: <Lobby />, | ||
}, | ||
{ | ||
path: "/round-end", | ||
element: <RoundEnd />, | ||
} | ||
]); | ||
|
||
|
||
// the app with the above-defined routes | ||
function App() { | ||
return ( | ||
<> | ||
<div> | ||
<h1 className="text-6xl font-bold underline">Makers UI game group!</h1> | ||
</div> | ||
<RouterProvider router={router} /> | ||
</> | ||
); | ||
} | ||
|
||
export default App; | ||
export default App; |
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,22 +1,26 @@ | ||
// the landing page with the create a game option | ||
|
||
//imports needed | ||
import { Link } from "react-router-dom"; | ||
import { Button } from "../components/Button"; | ||
{/*import { Button } from "../components/Button"; */} | ||
|
||
// page function | ||
export function HomePage() { | ||
return ( | ||
<> | ||
<div className="home"> | ||
<h1>Guess the number!</h1> | ||
<h1 data-testid="game-name">Guess the number!</h1> | ||
<p> | ||
Rules of the game: | ||
<ul> | ||
<li>Guess the number between 1 and 100</li> | ||
<li>2 to 6 players</li> | ||
</ul> | ||
</p> | ||
|
||
<Button onClick={handleClick}>Create game</Button> | ||
<Link to="/lobby" className="lobby-link"></Link> | ||
{/* <Button onClick={handleClick}>Create game</Button> */} | ||
|
||
</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
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