Skip to content
Merged
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 changes: 5 additions & 12 deletions front/src/components/Athlete/Athlete.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,16 @@ import Navigation from "../Navigation";
import athlete from "../../database/athlete.json"
import AthleteItem from "./AthleteItem";

const Athlete = () => {

const initialState = {
about: "",
company: "",
sports: [],
phone: "",
isActive: ""
}


const Athlete = () => {

const [selected, setSelected] = useState([initialState])
const [selected, setSelected] = useState("")

const handleClick = (id) => {
console.log(id);

setSelected(athlete.filter(element => element.recordid === id))
console.log(selected);
}

return (
Expand Down Expand Up @@ -54,7 +47,7 @@ const Athlete = () => {

<div className="column-sponsor border border-primary rounded">

<AthleteItem sponsor={selected} />
<AthleteItem athlete={selected} />

</div>

Expand Down
20 changes: 5 additions & 15 deletions front/src/components/Athlete/AthleteItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const AthleteItem = ({athlete}) => {


//const {about, company, sports, email, phone, address, isActive, created_date} = sponsor?.[0]

const isEmpty = (obj) => Object.values(obj).every(x => x.length < 1)

const dateFormated = date => {
Expand All @@ -23,11 +22,8 @@ const AthleteItem = ({athlete}) => {
<Fragment>

<div className='d-flex justify-content-between'>
{
true
? <div className='text-success mx-3'>Offre valable</div>
: <div className='text-danger mx-3'>L'Offre est cloturée</div>
}

<div className='text-success mx-3'>Athlete en recherche de sponsor</div>

{/* <div className='mx-3'>
{
Expand All @@ -37,14 +33,10 @@ const AthleteItem = ({athlete}) => {
</div>


<h2>{"titre"}</h2>
<h2>{athlete[0]?.fields.nom}</h2>

<div className='mx-3' >
<h4>About us</h4>
<p className='text-start'>description variable</p>



<h4>{athlete[0].fields.sport}</h4>
<div className="mt-3">
{
true && <AthleteModal company={"variable"} />
Expand All @@ -53,11 +45,9 @@ const AthleteItem = ({athlete}) => {


<div className='d-flex justify-content-between mt-3'>
<p>{"name"}</p>
<p>{"name"}</p>

</div>
<div>
<p>{"other information"}</p>
</div>
</div>
</Fragment>
Expand Down