Skip to content

Commit

Permalink
Updated bootstrap version and added page for the equipment
Browse files Browse the repository at this point in the history
  • Loading branch information
porfanid committed May 1, 2024
1 parent 76bbf8c commit bd62e7e
Show file tree
Hide file tree
Showing 6 changed files with 269 additions and 64 deletions.
1 change: 1 addition & 0 deletions .idea/QuestMatch.iml

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

28 changes: 25 additions & 3 deletions FrontEnd/front-end/package-lock.json

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

3 changes: 3 additions & 0 deletions FrontEnd/front-end/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"name": "front-end",
"version": "0.1.0",
"private": true,
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11"
},
"dependencies": {
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^15.0.5",
Expand Down
7 changes: 4 additions & 3 deletions FrontEnd/front-end/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@


<title>QuestMatch</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="%PUBLIC_URL%/css/style.css">
</head>
Expand All @@ -45,8 +45,9 @@
</div>

<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.0.7/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.10.2/dist/umd/popper.min.js" integrity="sha384-7+zCNj/IqJ95wo16oMtfsKbZ9ccEh31eOz1HGyDuCQ6wgnyJNSYdrPa03rtR1zdB" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.min.js" integrity="sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13" crossorigin="anonymous"></script>

</body>


Expand Down
108 changes: 53 additions & 55 deletions FrontEnd/front-end/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function App() {
const [selectedLevel, setSelectedLevel] = useState(null);
const [ setSelectedSpells] = useState(null);

const test = (isLoggedIn) => {
const test = () => {
if (isLoggedIn) {
return (
<button onClick={logOut} className="btn btn-primary ml-auto">
Expand Down Expand Up @@ -68,63 +68,61 @@ function App() {
setIsLoggedIn(localStorage.getItem('isLoggedIn') === 'true');
}, [navigate]);

/**
*
* <Route path="about" element={<About/>} >
* <Route path="" element={<About1/>} />
* <Route path="about" element={<About2/>} />
* <Route path="contact" element={<About2/>} />
* </Route>
*/


return (

<>
<header>
<nav className="navbar navbar-expand-lg navbar-light bg-dark">
<Link className="navbar-brand navbar-light" to="/">QuestMatch</Link>
<button className="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span className="navbar-toggler-icon"></span>
</button>
<div className="collapse navbar-collapse" id="navbarNav">
<ul className="navbar-nav">
<li className="nav-item">
<NavLink to="/" className="nav-link" end>Home</NavLink>
</li>
<li className="nav-item">
<NavLink exact to="/contribute" className="nav-link">Contribute</NavLink>
</li>
<li className="nav-item">
<NavLink exact to="/character" className="nav-link">Create Character</NavLink>
</li>
</ul>
</div>
{
test(isLoggedIn)
}

</nav>
</header>


<Routes>
<Route exact path="/" element={<Home/>} />
<Route exact path="contribute" element={<Contribute/>} />
<Route exact path="login" element={<Login setIsLoggedIn={setIsLoggedIn} />} />
<Route exact path="signup" element={<Signup/>} />
<Route exact path="profile/" element={<Profile/>}/>
<Route exact path="character" element={<Character selectClass={setSelectedClass} selectRace={setSelectedRace} selectLevel={setSelectedLevel}/>}/>
<Route exact path="character/spells" element={<Spells setSelectedSpells={setSelectedSpells} selectedClass={selectedClass} selectedRace={selectedRace} selectedLevel={selectedLevel}/>}/>
<Route exact path="character/equipment" element={<Equipment/>}/>
<Route path="contact" element={<Home/>} />
{/* Add more routes as needed */}
</Routes>


</>
);
<>
<header>
<nav className="navbar navbar-expand-lg navbar-light bg-dark">
<div className="container-fluid">
<Link className="navbar-brand text-light" to="/">QuestMatch</Link>
<button className="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span className="navbar-toggler-icon"></span>
</button>
<div className="collapse navbar-collapse" id="navbarNav">
<ul className="navbar-nav ms-auto">
<li className="nav-item">
<NavLink exact to="/" className="nav-link text-light"
activeClassName="active">Home</NavLink>
</li>
<li className="nav-item">
<NavLink exact to="/contribute" className="nav-link text-light"
activeClassName="active">Contribute</NavLink>
</li>
<li className="nav-item">
<NavLink exact to="/character" className="nav-link text-light"
activeClassName="active">Create Character</NavLink>
</li>
</ul>
</div>
{test()}
</div>
</nav>
</header>


<Routes>
<Route exact path="/" element={<Home/>}/>
<Route exact path="contribute" element={<Contribute/>}/>
<Route exact path="login" element={<Login setIsLoggedIn={setIsLoggedIn}/>}/>
<Route exact path="signup" element={<Signup/>}/>
<Route exact path="profile/" element={<Profile/>}/>
<Route exact path="character"
element={<Character selectClass={setSelectedClass} selectRace={setSelectedRace}
selectLevel={setSelectedLevel}/>}/>
<Route exact path="character/spells"
element={<Spells setSelectedSpells={setSelectedSpells} selectedClass={selectedClass}
selectedRace={selectedRace} selectedLevel={selectedLevel}/>}/>
<Route exact path="character/equipment" element={<Equipment/>}/>
<Route path="contact" element={<Home/>}/>
{/* Add more routes as needed */}
</Routes>


</>
);
}


Expand Down
Loading

0 comments on commit bd62e7e

Please sign in to comment.