diff --git a/src/client/.env b/src/client/.env index 0fcd09e..0472baa 100644 --- a/src/client/.env +++ b/src/client/.env @@ -1,2 +1,2 @@ -REACT_APP_API_URL=https://api.asura.feal.no +REACT_APP_API_URL=https://asura.feal.no/api BROWSER=none \ No newline at end of file diff --git a/src/client/src/FrontPage.js b/src/client/src/FrontPage.js index 3c3c9bb..af9afaf 100644 --- a/src/client/src/FrontPage.js +++ b/src/client/src/FrontPage.js @@ -6,17 +6,16 @@ import TournamentManager from "./TournamentManager.js"; import TournamentAnnouncement from "./TournamentAnnouncement"; import TournamentMatches from "./TournamentMatches"; import TournamentTeams from "./TournamentTeams"; -import Appbar from './components/appbar'; -import { Button, Container, Typography, Box } from "@mui/material"; -import { Card, CardContent, CardMedia, Paper } from "@mui/material"; +import AppBar from './components/appbar'; +import { Button, Container, Typography, Box, Stack, Card, CardContent, CardMedia, Paper, Grid } from "@mui/material"; import AddCircleIcon from '@mui/icons-material/AddCircle'; function CreateButton(props) { return ( - - - + + - + + - - + ); } @@ -95,50 +89,32 @@ function TournamentList() { }, []); return <> + {tournamentList && tournamentList.map((tournamentObject) => )} - + + ; } - -// - function Home() { return ( - - -
- + <> + + + + {/* */} + Tournaments - - Tournaments - - - {/* - - */} - + + -
-
-
+ ); } export default function App() { return ( - + + } /> } /> @@ -152,5 +128,6 @@ export default function App() { /> + ); } diff --git a/src/client/src/TournamentCreator.js b/src/client/src/TournamentCreator.js index 483e0df..3a439fa 100644 --- a/src/client/src/TournamentCreator.js +++ b/src/client/src/TournamentCreator.js @@ -1,6 +1,6 @@ import * as React from "react"; import { BrowserRouter as Router, Link, Route, Routes } from "react-router-dom"; -import Appbar from "./components/appbar"; +import AppBar from "./components/appbar"; import { Button, TextField, Stack, InputLabel, Select, Container, Slider, Paper, Box, Grid, Typography } from '@mui/material' import FileUploadIcon from '@mui/icons-material/FileUpload'; @@ -160,7 +160,7 @@ function TournamentForm(props) { export default function TournamentCreator(props) { return ( <> - + diff --git a/src/client/src/TournamentManager.js b/src/client/src/TournamentManager.js index 18c4cf6..09dbe60 100644 --- a/src/client/src/TournamentManager.js +++ b/src/client/src/TournamentManager.js @@ -1,7 +1,8 @@ import * as React from "react"; import { BrowserRouter as Router, Link, Route, Routes } from "react-router-dom"; // import { AlertContainer, alert } from "react-custom-alert"; -import Appbar from "./components/appbar"; +import AppBar from "./components/appbar"; +import TournamentBar from "./components/tournamentbar"; import { useParams } from "react-router-dom"; import { Button, TextField, Grid, Box, Container, Paper, Stack} from "@mui/material"; import FileUploadIcon from '@mui/icons-material/FileUpload'; @@ -171,7 +172,8 @@ export default function TournamentManager(props) { const { tournamentId } = useParams(); return ( <> - + + {/* */} diff --git a/src/client/src/TournamentOverview.js b/src/client/src/TournamentOverview.js index a779039..755f57b 100644 --- a/src/client/src/TournamentOverview.js +++ b/src/client/src/TournamentOverview.js @@ -1,6 +1,7 @@ import * as React from "react"; import { Link } from "react-router-dom"; import Appbar from './components/appbar'; +import TournamentBar from "./components/tournamentbar"; import { useParams } from 'react-router-dom' import { Button, Paper, Stack } from "@mui/material"; import "./components/tournamentBracket.css"; @@ -164,6 +165,7 @@ function BracketViewer(props) { return ( (matches && teams) ? + //
{matches.map(tier => { let tierNum = tier[0].tier; @@ -185,16 +187,7 @@ export default function TournamentOverview(props) { return ( <> - - - - - - - - - - + ); diff --git a/src/client/src/TournamentTeams.js b/src/client/src/TournamentTeams.js index 1d2ebc7..f311c7d 100644 --- a/src/client/src/TournamentTeams.js +++ b/src/client/src/TournamentTeams.js @@ -1,15 +1,30 @@ import * as React from "react"; import { BrowserRouter as Router, Link, Route, Routes, useParams } from "react-router-dom"; import Appbar from "./components/appbar"; +import TournamentBar from "./components/tournamentbar"; import { Button, TextField, Stack, MenuItem, Box, InputLabel, Select, Container, TableContainer, Table, TableBody, TableHead, TableCell, TableRow, Paper, Typography} from "@mui/material"; import AddCircleIcon from '@mui/icons-material/AddCircle'; - +import DeleteIcon from '@mui/icons-material/Delete'; +import EditIcon from '@mui/icons-material/Edit'; function showError(error) { alert("Something went wrong. \n" + error); console.error(error); } +function ReturnButton() { + const { tournamentId } = useParams(); + return( + + + + ) +} + function TeamCreator(props) { function postCreate() { let teamName = document.getElementById("teamNameInput").value; @@ -77,8 +92,8 @@ function TeamList(props) { {/* {team.members} */} - - + + @@ -196,6 +211,8 @@ export default function TournamentTeams(props) { return ( <> + +
diff --git a/src/client/src/components/appbar.js b/src/client/src/components/appbar.js index e8dcabb..0d87884 100644 --- a/src/client/src/components/appbar.js +++ b/src/client/src/components/appbar.js @@ -1,39 +1,40 @@ import * as React from "react"; import { BrowserRouter as Router, Link, Route, Routes, History } from "react-router-dom"; -import { AppBar, Typography, Toolbar, CssBaseline, Box, Button, IconButton } from "@mui/material" -import Menu from '@mui/icons-material/Menu' +import { AppBar, Typography, Toolbar, CssBaseline, Box, Button, IconButton, Grid } from "@mui/material" +import MenuIcon from '@mui/icons-material/Menu'; import HomeImage from "./homeimage"; export default function Appbar(props) { return ( <> - - - - - Asura Tournaments - - - {/* */} - -

{props.pageTitle || ""}

- - - - - {/* */} + + + + + {/* + + Asura Tournaments + + */} + + +

{props.pageTitle || ""}

+
+ + + + + + + {/* */} + {/* */} +
+
- ); } \ No newline at end of file diff --git a/src/client/src/components/nosuchpage.js b/src/client/src/components/nosuchpage.js new file mode 100644 index 0000000..2bcbc43 --- /dev/null +++ b/src/client/src/components/nosuchpage.js @@ -0,0 +1,9 @@ +import * as React from "react"; +import { BrowserRouter as Router, Link, Route, Routes } from "react-router-dom"; +import Home from '../FrontPage'; + +export default function NoSuchPage() { + +} + + diff --git a/src/client/src/components/tournamentbar.js b/src/client/src/components/tournamentbar.js new file mode 100644 index 0000000..312eb2d --- /dev/null +++ b/src/client/src/components/tournamentbar.js @@ -0,0 +1,51 @@ +import * as React from "react"; +import { useParams } from "react-router-dom"; +import { BrowserRouter as Router, Link, Route, Routes, History } from "react-router-dom"; +import { Stack, Paper, Typography, Box, Button, Grid } from "@mui/material" + +export default function TournamentBar(props) { + const { tournamentId } = useParams() + if (props.pageTitle == "Edit Tournament") { + return( + + + + + + + + + + + + ) + } else if (props.pageTitle == "Tournament Matches") { + return( + + + + + + + + + + + + ) + } else if (props.pageTitle == "Edit Teams") { + return( + + + + + + + + + + + + ) + } +} \ No newline at end of file