Browse Source

Arrow up when menu selected

Kongzibapt 3 years ago
parent
commit
60294eed6b

BIN
img/arrow_select_up.png View File


BIN
public/img/arrow_select_up.png View File


+ 7
- 1
src/css/Components/sort.css View File

@@ -37,7 +37,13 @@
37 37
                 background-position-y: center;
38 38
                 background-position-x: 16vw;
39 39
             }
40
-            
40
+
41
+            #unwoundMenu{
42
+                background: url("../../img/arrow_select_up.png") no-repeat;
43
+                background-size: 2.5vw;
44
+                background-position-y: center;
45
+                background-position-x: 16vw;
46
+            }
41 47
 
42 48
                 #sortSelect{
43 49
                     background: transparent;

BIN
src/img/arrow_select_up.png View File


+ 1
- 3
src/js/Components/ArticlesByCategory.js View File

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

+ 8
- 3
src/js/Components/Sort.js View File

@@ -6,10 +6,15 @@ class Sort extends Component {
6 6
     constructor(props){
7 7
         super(props)
8 8
         this.state = {
9
-            
9
+            unwound:false
10 10
         }
11 11
     }
12 12
 
13
+    changeArrowDirection = () => {
14
+        console.log('ok');
15
+        this.setState({unwound:!this.state.unwound})
16
+    }
17
+
13 18
     render() {
14 19
         return (
15 20
             <div id="sortBox">
@@ -18,8 +23,8 @@ class Sort extends Component {
18 23
                 </div>
19 24
                 <div id="selectAndOrder">
20 25
                     <div id="selectBlock">
21
-                        <div id="selectBox">
22
-                            <select id="sortSelect" onChange={this.props.handleChangeSortType}>
26
+                        <div id={this.state.unwound ? 'unwoundMenu' : 'selectBox'}  >
27
+                            <select id='sortSelect' onClick={this.changeArrowDirection} onChange={this.props.handleChangeSortType}>
23 28
                                 <option className="optionSort" value="name">Ordre Alphabétique</option>
24 29
                                 <option className="optionSort" value="category_id">Catégorie</option>
25 30
                                 <option className="optionSort" value="quantity">Quantité</option>

Loading…
Cancel
Save