Skip to content
Snippets Groups Projects
Commit 402836f3 authored by Jonas's avatar Jonas
Browse files

add provisional tournament component without functionality

parent aaa887f1
No related branches found
No related tags found
No related merge requests found
import logo from './logo.svg'; import logo from './logo.svg';
import './App.css'; import './App.css';
import Tournament from "./Tournament";
function App() { function App() {
return ( return <div style={{display: "flex", justifyContent: "center", alignItems: "center"}}>
<div className="App"> <Tournament />
<header className="App-header"> </div>
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
</div>
);
} }
export default App; export default App;
import {useState} from "react";
export default function Tournament() {
return (
<div style={{display: "flex", flexDirection: "row", gap: "50px"}}>
<div className="firstPhase" style={{display: "flex", flexDirection: "column", gap: "50px"}}>
<div className="match">
<Bracket/>
<Bracket/>
</div>
<div className="match">
<Bracket/>
<Bracket/>
</div>
<div className="match">
<Bracket/>
<Bracket/>
</div>
<div className="match">
<Bracket/>
<Bracket/>
</div>
</div>
<div className="secondPhase" style={{display: "flex", flexDirection:"column", justifyContent: "space-around"}}>
<div className="match">
<Bracket/>
<Bracket/>
</div>
<div className="match">
<Bracket/>
<Bracket/>
</div>
</div>
<div className="thirdPhase" style={{display: "flex", alignItems: "center"}}>
<div className="match">
<Bracket/>
<Bracket/>
</div>
</div>
</div>
)
}
function Bracket({highlight, onScoreChange}) {
if (highlight) {
document.getElementById('bracketWrapper').style.border = "3px solid black"
}
return <div id="bracketWrapper" style={{display: "flex",flexDirection:"row" ,padding: "10px", border: "1px solid black", width: "fit-content"}}>
<div id="teamNameWrapper" style={{display: "flex", flexDirection: "column"}}>
<label htmlFor="teamName" style={{fontSize: "8pt"}}>teamname</label>
<input id="teamName" type="text"/>
</div>
<div id="scoreWrapper" style={{display: "flex", flexDirection: "column", marginLeft: "10px"}}>
<label htmlFor="score" style={{fontSize: "8pt"}}>score</label>
<input id="score" type="number" style={{width: "35px"}} onChange={() => onScoreChange(document.getElementById('score').value)}/>
</div>
</div>
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment