Created and linked pages for creating tournaments and overview

This commit is contained in:
Kristoffer Longva Eriksen 2022-03-17 14:26:42 +01:00
parent b1d1189f12
commit da13804bf4
7 changed files with 60 additions and 6 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -0,0 +1,11 @@
import * as React from "react";
import { BrowserRouter as Router, Link, Route, Routes } from "react-router-dom";
import logo from "./../Asura2222.png";
export default function Home_Image() {
return (
<Link to="/">
<img src={logo} alt="Tournament logo"></img>
</Link>
);
}

View File

@ -0,0 +1,20 @@
import * as React from "react";
import { BrowserRouter as Router, Link, Route, Routes } from "react-router-dom";
import Home_Image from "./components/home_image";
function Save_Button(props) {
return (
<Link to="/">
<button>Create Tournament!</button>
</Link>
);
}
export default function Create_Tournament(props) {
return (
<React.Fragment>
<Home_Image />
<Save_Button />
</React.Fragment>
);
}

View File

@ -1,7 +1,18 @@
import * as React from "react"; import * as React from "react";
import { BrowserRouter as Router, Link, Route, Routes } from "react-router-dom"; import { BrowserRouter as Router, Link, Route, Routes } from "react-router-dom";
import Manage_Button from "./components/manage_button"; import Manage_Button from "./components/manage_button";
import Create_Tournament from "./create_tournament.js";
import Tournament_Overview from "./tournament_overview.js";
import Tournament_Manager from "./manage_tournament.js"; import Tournament_Manager from "./manage_tournament.js";
import Home_Image from "./components/home_image";
function Create_Button(props) {
return (
<button className="Create_Button">
<Link to="/create">Create Tournament</Link>
</button>
);
}
function Overview_Button(props) { function Overview_Button(props) {
return ( return (
@ -28,6 +39,8 @@ function ListElement(props) {
function Home() { function Home() {
return ( return (
<React.StrictMode> <React.StrictMode>
<Home_Image />
<Create_Button />
<div id="tournamentList"> <div id="tournamentList">
<ListElement name="Weekend Warmup" competitors="16" date="29.04.2022" /> <ListElement name="Weekend Warmup" competitors="16" date="29.04.2022" />
<ListElement <ListElement
@ -46,6 +59,8 @@ export default function App() {
<Router> <Router>
<Routes> <Routes>
<Route path="/" element={<Home />} /> <Route path="/" element={<Home />} />
<Route path="/create" element={<Create_Tournament />} />
<Route path="/tournament" element={<Tournament_Overview />} />
<Route path="/tournament/manage" element={<Tournament_Manager />} /> <Route path="/tournament/manage" element={<Tournament_Manager />} />
</Routes> </Routes>
</Router> </Router>

View File

@ -29,26 +29,25 @@ code {
} }
.ListElement { .ListElement {
background-color: #073b4c; background-color: #073b4c;
width: 100%; width: 40vw;
height: 7vh; height: 7vh;
display: grid; display: grid;
flex-flow: row;
column-gap: 5vw;
grid-template-columns: 4fr 1fr 1fr; grid-template-columns: 4fr 1fr 1fr;
margin-bottom: 5vh; margin-bottom: 5vh;
} }
.Manage_Button { .Manage_Button {
background-color: #ef476f; background-color: #ef476f;
display: inline; width: 10vw;
width: 100%;
height: 100%; height: 100%;
color: #eeeeee; color: #eeeeee;
padding-left: 5vh;
} }
.Overview_Button { .Overview_Button {
background-color: #118ab2; background-color: #118ab2;
display: inline; width: 10vw;
width: 100%;
height: 100%; height: 100%;
color: #eeeeee; color: #eeeeee;
} }

View File

@ -1,9 +1,11 @@
import * as React from "react"; import * as React from "react";
import { BrowserRouter as Router, Link, Route, Routes } from "react-router-dom"; import { BrowserRouter as Router, Link, Route, Routes } from "react-router-dom";
import Home_Image from "./components/home_image";
export default function Tournament_Manager() { export default function Tournament_Manager() {
return ( return (
<React.Fragment> <React.Fragment>
<Home_Image />
<h1 className="pageHeader">Tournament</h1> <h1 className="pageHeader">Tournament</h1>
<br></br> <br></br>
<input <input

View File

@ -0,0 +1,7 @@
import * as React from "react";
import { BrowserRouter as Router, Link, Route, Routes } from "react-router-dom";
import Home_Image from "./components/home_image";
export default function Tournament_Overview(props) {
return <Home_Image />;
}