Arrow up when menu selected

This commit is contained in:
Kongzibapt 2021-02-07 12:24:17 +01:00
parent 92eb17769f
commit 60294eed6b
6 changed files with 16 additions and 7 deletions

BIN
img/arrow_select_up.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

View file

@ -37,7 +37,13 @@
background-position-y: center;
background-position-x: 16vw;
}
#unwoundMenu{
background: url("../../img/arrow_select_up.png") no-repeat;
background-size: 2.5vw;
background-position-y: center;
background-position-x: 16vw;
}
#sortSelect{
background: transparent;

BIN
src/img/arrow_select_up.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

View file

@ -16,10 +16,8 @@ class ArticlesByCategory extends React.Component {
}
componentDidUpdate(){
console.log(this.state.articles);
if (this.props.onSearch){
// implémenter une fonction de recherche en React sur articles
}
}
splitArticlesCategories = () => {

View file

@ -6,10 +6,15 @@ class Sort extends Component {
constructor(props){
super(props)
this.state = {
unwound:false
}
}
changeArrowDirection = () => {
console.log('ok');
this.setState({unwound:!this.state.unwound})
}
render() {
return (
<div id="sortBox">
@ -18,8 +23,8 @@ class Sort extends Component {
</div>
<div id="selectAndOrder">
<div id="selectBlock">
<div id="selectBox">
<select id="sortSelect" onChange={this.props.handleChangeSortType}>
<div id={this.state.unwound ? 'unwoundMenu' : 'selectBox'} >
<select id='sortSelect' onClick={this.changeArrowDirection} onChange={this.props.handleChangeSortType}>
<option className="optionSort" value="name">Ordre Alphabétique</option>
<option className="optionSort" value="category_id">Catégorie</option>
<option className="optionSort" value="quantity">Quantité</option>