Skip to content

Commit

Permalink
Merge pull request #19 from LukeRenton/all-pages/improving-modularity
Browse files Browse the repository at this point in the history
All pages/improving modularity
  • Loading branch information
MitchellNeilson authored May 26, 2024
2 parents ac2b199 + e65e39b commit cc246f6
Show file tree
Hide file tree
Showing 68 changed files with 968 additions and 245 deletions.
15 changes: 6 additions & 9 deletions client/build/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
{
"files": {
"main.css": "/static/css/main.dd8c6356.css",
"main.js": "/static/js/main.a2bd624f.js",
"main.css": "/static/css/main.84c2b173.css",
"main.js": "/static/js/main.824112c8.js",
"static/media/forest_animation.mp4": "/static/media/forest_animation.239347dfe9755133bd14.mp4",
"static/media/wall-background.mp4": "/static/media/wall-background.9691b868f5274a0471f2.mp4",
"static/media/cryptid-background.mp4": "/static/media/cryptid-background.af864c7aa5878e2d51e9.mp4",
"static/media/mountain_animation.mp4": "/static/media/mountain_animation.bc452add00224193d376.mp4",
"static/media/beach_animation.mp4": "/static/media/beach_animation.32fc93ba519e07d62e5e.mp4",
"static/media/game-script-back.png": "/static/media/game-script-back.8572931b5e6b277ed03a.png",
"static/media/LobbyBack-transformed-resized.jpeg": "/static/media/LobbyBack-transformed-resized.7a1d1135358068700242.jpeg",
"static/media/five.png": "/static/media/five.c1b3ba87d07f39378fe8.png",
"static/media/four.png": "/static/media/four.3af19cb8cf8806374a2e.png",
"static/media/six.png": "/static/media/six.172a3f00ec7aa9653c98.png",
Expand All @@ -18,7 +16,6 @@
"static/media/map.png": "/static/media/map.f6934776579d2e333114.png",
"static/media/arrow.gif": "/static/media/arrow.b813b88363e6a9a304bf.gif",
"static/media/one.png": "/static/media/one.3d83e482dc6018398751.png",
"static/media/scroll.png": "/static/media/scroll.071ddc2f6bcd9e140218.png",
"static/media/join_online.png": "/static/media/join_online.794234589f3ff9c8a549.png",
"static/media/host_online.png": "/static/media/host_online.b72087ce619f34e5924d.png",
"static/media/local.png": "/static/media/local.229ba38b4222a9bf7df1.png",
Expand All @@ -34,11 +31,11 @@
"static/media/question.svg": "/static/media/question.d7dd2c99fbcd281ede054bd70207345c.svg",
"static/media/info.svg": "/static/media/info.86375dfea0b36eba22b87e3829720254.svg",
"index.html": "/index.html",
"main.dd8c6356.css.map": "/static/css/main.dd8c6356.css.map",
"main.a2bd624f.js.map": "/static/js/main.a2bd624f.js.map"
"main.84c2b173.css.map": "/static/css/main.84c2b173.css.map",
"main.824112c8.js.map": "/static/js/main.824112c8.js.map"
},
"entrypoints": [
"static/css/main.dd8c6356.css",
"static/js/main.a2bd624f.js"
"static/css/main.84c2b173.css",
"static/js/main.824112c8.js"
]
}
2 changes: 1 addition & 1 deletion client/build/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>Cryptid</title><script defer="defer" src="/static/js/main.a2bd624f.js"></script><link href="/static/css/main.dd8c6356.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>Cryptid</title><script defer="defer" src="/static/js/main.824112c8.js"></script><link href="/static/css/main.84c2b173.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions client/build/static/css/main.84c2b173.css.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion client/build/static/css/main.dd8c6356.css.map

This file was deleted.

3 changes: 3 additions & 0 deletions client/build/static/js/main.824112c8.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/

/*! js-cookie v3.0.5 | MIT */

/**
* @license React
* react-dom.production.min.js
Expand Down
1 change: 1 addition & 0 deletions client/build/static/js/main.824112c8.js.map

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions client/build/static/js/main.a2bd624f.js

This file was deleted.

1 change: 0 additions & 1 deletion client/build/static/js/main.a2bd624f.js.map

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
34 changes: 27 additions & 7 deletions client/src/App.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,48 @@
/*
APP.JS
Type: main react component
Description: Renders all pages and provides variables needed accross components
*/

import './App.css';
import {BrowserRouter as Router, Routes, Route, useNavigate} from "react-router-dom"
import {BrowserRouter as Router, Routes, Route} from "react-router-dom"
import Tutorial from './Pages/Tutorial.js';
import Login from './Pages/Login.js';
import Lobby from './Pages/Lobby.js';
import Game from './Pages/Game.js';
import { useState } from 'react';
import Cookies from 'js-cookie';

function App() {
// State variable to manage local game information
const [localGameInfo, setLocalGameInfo] = useState({});
const [playerNames, setPlayerNames] = useState(["","","","",""]);
const [movesList, setMovesList] = useState([[],[],[],[],[]]);
const [user, setUser] = useState(null);


const updateUser = (newUser) => {
Cookies.set('user',newUser);
setUser(newUser);
}

return (
<div className="App">
<main className="App">
<Router>
<Routes>
<Route path='/' element={<Login/>}/>
<Route path='/tutorial' element={<Tutorial/>}/>
<Route path='/lobby' element={<Lobby setMovesList={setMovesList} playerNames={playerNames} setPlayerNames={setPlayerNames} localGameInfo={localGameInfo} setLocalGameInfo={setLocalGameInfo}/>}/>
<Route path='/game' element={<Game movesList={movesList} setMovesList={setMovesList} playerNames={playerNames} localGameInfo={localGameInfo} />}/>
<Route path='/' element={<Login updateUser={updateUser}/>}/>
{user !== null ?
<>
<Route path='/tutorial' element={<Tutorial/>}/>
<Route path='/lobby' element={<Lobby updateUser={updateUser} setMovesList={setMovesList} playerNames={playerNames} setPlayerNames={setPlayerNames} localGameInfo={localGameInfo} setLocalGameInfo={setLocalGameInfo}/>}/>
<Route path='/game' element={<Game movesList={movesList} setMovesList={setMovesList} playerNames={playerNames} localGameInfo={localGameInfo} />}/>
</>
:
<></>
}
</Routes>
</Router>
</div>
</main>
);
}

Expand Down
14 changes: 10 additions & 4 deletions client/src/Components/Board.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit cc246f6

Please sign in to comment.