Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17,549 changes: 17,377 additions & 172 deletions front/package-lock.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions front/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"bootstrap": "^5.2.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.4.3",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
},
Expand Down
1 change: 1 addition & 0 deletions front/public/athletes.json

Large diffs are not rendered by default.

21 changes: 5 additions & 16 deletions front/src/App.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@
import logo from './logo.svg';
import './App.css';
import logo from "./logo.svg";
import "./App.css";
import Router from "./Router";
import "bootstrap/dist/css/bootstrap.min.css";

function App() {
return (
<div className="App">
<header className="App-header">
<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>
<Router />
</div>
);
}
Expand Down
20 changes: 20 additions & 0 deletions front/src/Router.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from "react";
import Home from "./components/Home";
import { BrowserRouter, Route, Routes } from "react-router-dom";
import Sponsor from "./components/Sponsor";
import Athlete from "./components/Athlete/Athlete";
const Router = () => {
return (
<div>
<BrowserRouter>
<Routes>
<Route exact path="/" element={<Home />} />
<Route path="/sponsor" element={<Sponsor />} />
<Route path="/athlete" element={<Athlete />} />
</Routes>
</BrowserRouter>
</div>
);
};

export default Router;
45 changes: 45 additions & 0 deletions front/src/components/Athlete/Athlete.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import React, { useState} from "react";
import Navigation from "../Navigation";
import AthleteList from "./AthleteList";

const dataSponsor =[
{
"name": "blabla",
"about": "adzeferfvdvv"
},
{
"name": "cc",
"about": "adzeferfvdvv"

},
{
"name": "aa",
"about": "adzeferfvdvv"

},
{
"name": "tt",
"about": "adzeferfvdvv"

},

]
const Athlete = () => {

const [dataSponsor, setDataSponsor] = useState("");
return (
<div>Athlete
<Navigation />
<div style={{display: "flex"}}>
<div>
<AthleteList setDataSponsor={setDataSponsor} />
</div>
<div>
{/* <About dataSponsor={dataSponsor} /> */}
</div>
</div>
</div>
)
}

export default Athlete;
33 changes: 33 additions & 0 deletions front/src/components/Athlete/AthleteList.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React from "react";
const data = [
{
"name": "dedfd",
"about": "jhfebkjhfbk",
},
{
"name": "ddd",
"about": "jhfebkjhfbk",
},
{
"name": "ggg",
"about": "jhfebkjhfbk",
},
{
"name": "hhh",
"about": "jhfebkjhfbk",
},
{
"name": "qqqq",
"about": "jhfebkjhfbk",
},
]
const AthleteList =(props)=> {
return(<div>
{data.map(v => (
<h1 onClick={() => props.setDataSponsor(v)}>
{v.name}
</h1>))}
</div>)
}

export default AthleteList;
10 changes: 10 additions & 0 deletions front/src/components/Home.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from "react";
import Navigation from "./Navigation";
const Home = () => {
return <div>
Home
<Navigation />
</div>;
};

export default Home;
15 changes: 15 additions & 0 deletions front/src/components/Navigation.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from "react";
import { useNavigate } from "react-router-dom";

const Navigation = () =>{
const navigate = useNavigate();

return(<div>
<button onClick={() => navigate("/")} class="btn btn-primary">Home</button>
<button onClick={() => navigate("/athlete")}>Athlete</button>
<button onClick={() => navigate("/sponsor")}>Sponsor</button>
</div>)
}

export default Navigation;

12 changes: 12 additions & 0 deletions front/src/components/Sponsor.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from "react";
import Navigation from "./Navigation";


const Sponsor = () => {
return (<div>
Sponsor
<Navigation />
</div>)
}

export default Sponsor;
10 changes: 10 additions & 0 deletions front/src/components/sponsors.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react'

const sponsors = () => {
return (
<div>sponsors</div>

)
}

export default sponsors
Loading