-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Gemma
committed
Sep 28, 2023
1 parent
5b08315
commit 688da08
Showing
5 changed files
with
175 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import '../../App.css' | ||
import './Cohorts.css' | ||
import React, { useState, useEffect } from 'react' | ||
import Select from 'react-select' | ||
import makeAnimated from 'react-select/animated' | ||
|
||
function CohortsModule (props) { | ||
const [results, setResults] = useState(null) | ||
const [selectedCohortsAux, setSelectedCohortsAux] = useState([]) | ||
const animatedComponents = makeAnimated() | ||
const onSubmitCohorts = () => { | ||
setResults('Cohorts') | ||
|
||
props.setShowGraphs(true) | ||
} | ||
const handleChangeCohorts = selectedOption => { | ||
setSelectedCohortsAux([]) | ||
selectedCohortsAux.push(selectedOption) | ||
props.setSelectedCohorts(selectedCohortsAux) | ||
} | ||
|
||
return ( | ||
<div className='cohortsModule'> | ||
<Select | ||
closeMenuOnSelect={false} | ||
components={animatedComponents} | ||
defaultValue={[]} | ||
isMulti | ||
options={props.optionsCohorts} | ||
onChange={handleChangeCohorts} | ||
autoFocus={true} | ||
//onToggleCallback={onToggle3} | ||
/> | ||
|
||
<form className='d-flex2' onSubmit={onSubmitCohorts}> | ||
{results !== 'Cohorts' && ( | ||
<button className='searchButton2' type='submit'> | ||
<img | ||
className='forwardIcon' | ||
src='./adelante.png' | ||
alt='searchIcon' | ||
></img> | ||
</button> | ||
)} | ||
</form> | ||
</div> | ||
) | ||
} | ||
|
||
export default CohortsModule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.