generated from Arquisoft/wiq_0
-
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.
Merge pull request #44 from Arquisoft/front-end
Routing, nav and login first version.
- Loading branch information
Showing
25 changed files
with
402 additions
and
209 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
This file was deleted.
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from "react"; | ||
import { Route, Routes } from "react-router-dom"; | ||
import { GamePage } from "./pages/game"; | ||
import { GroupsPage } from "./pages/groups"; | ||
import { RouterLayout } from "./common/RouterLayout"; | ||
import { InitPage } from "./pages/init"; | ||
import { ScoreboardPage } from "./pages/scoreboard"; | ||
|
||
export const AppRouter: React.FC<{}> = () => { | ||
return ( | ||
<Routes> | ||
<Route element={<RouterLayout />}> | ||
/* when accessing /game or the other paths, it will be shown as the | ||
outlet inside the RouterLayout*/ | ||
<Route path="/game" element={<GamePage />} /> | ||
<Route path="/groups" element={<GroupsPage />} /> | ||
<Route path="/scoreboard" element={<ScoreboardPage />} /> | ||
</Route> | ||
<Route path="/" element={<InitPage/>} /> | ||
</Routes> | ||
); | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React from 'react'; | ||
import './nav.css'; | ||
import { useTranslation } from 'react-i18next'; | ||
import {AppBar, Container, Toolbar, Grid, Stack, Button} from "@mui/material"; | ||
import { useNavigate } from "react-router-dom"; | ||
|
||
const NavBar: React.FC<{}> = () => { | ||
const { t } = useTranslation(); | ||
const navigate = useNavigate(); | ||
return ( | ||
<AppBar className="nav_appBar"> | ||
<Toolbar> | ||
<Container maxWidth="xl"> | ||
<Grid | ||
container | ||
direction="row" | ||
alignItems="center" | ||
> | ||
<Grid item className="logo"> | ||
{t('app_name')} | ||
</Grid> | ||
<Grid item> | ||
<Stack direction="row" spacing={2}> | ||
<Button variant="contained" onClick={() => navigate("/game")}> | ||
{t('nav_game')} | ||
</Button> | ||
<Button variant="contained" onClick={() => navigate("/groups")}> | ||
{t('nav_groups')} | ||
</Button> | ||
<Button variant="contained" onClick={() => navigate("/scoreboard")}> | ||
{t('nav_scoreboard')} | ||
</Button> | ||
</Stack> | ||
</Grid> | ||
</Grid> | ||
</Container> | ||
</Toolbar> | ||
</AppBar> | ||
) | ||
}; | ||
|
||
export default NavBar; |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from "react"; | ||
import { Outlet } from "react-router-dom"; | ||
import NavBar from "./Nav"; | ||
|
||
/* This shows the NavBar and behind the element passed <RouterLayout> here </RouterLayout> */ | ||
export const RouterLayout: React.FC<{}> = () => { | ||
return( | ||
<> | ||
<NavBar /> | ||
<Outlet /> | ||
</> | ||
) | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
.navbar { | ||
width:100%; | ||
height: 50px; | ||
display: flex; | ||
align-items: center; | ||
|
||
} | ||
|
||
.nav_appBar{ | ||
background: #D9D9D9; | ||
position: fixed; | ||
justify-content: space-between; | ||
} | ||
|
||
.logo{ | ||
font-weight: 500; | ||
font-size: large; | ||
} | ||
|
||
.link-container{ | ||
margin-right: 20px; | ||
display:flex; | ||
width: 300px; | ||
justify-content: space-evenly; | ||
cursor: pointer; | ||
} | ||
|
||
.link{ | ||
text-decoration: none; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
|
||
const Game = () => { | ||
return ( | ||
<div> | ||
<h1>Game</h1> | ||
</div> | ||
) | ||
} | ||
|
||
export default Game; // Export the 'Game' component |
Oops, something went wrong.