|
@@ -101,96 +101,138 @@ class ArticleDetails extends React.Component {
|
101
|
101
|
return (<Redirect to='/stock'/>)
|
102
|
102
|
}
|
103
|
103
|
return(
|
|
104
|
+ this.props.squaredBubble ?
|
|
105
|
+
|
|
106
|
+ // SQUARE
|
|
107
|
+
|
104
|
108
|
this.state.selected ?
|
105
|
|
- <div onClick={this.selectArticles} id="bulleSelect" onMouseEnter={this.handleDesc} onMouseLeave={this.handlePhoto}>
|
106
|
|
- {this.state.redcrossPressed ?
|
107
|
|
- <div id="confirmation">
|
108
|
|
- <div id="confirmationTxt">Tu veux vraiment supprimer cet article ?</div>
|
109
|
|
- <div id="choice">
|
110
|
|
- <div id="yes" onClick={this.deleteArticle}>Oui</div>
|
111
|
|
- <div id="no" onClick={this.handleNoDelete}>Non</div>
|
|
109
|
+
|
|
110
|
+ // SELECTED
|
|
111
|
+
|
|
112
|
+ <div onClick={this.selectArticles} id="bulleSelect" onMouseEnter={this.handleDesc} onMouseLeave={this.handlePhoto}>
|
|
113
|
+ {this.state.redcrossPressed ?
|
|
114
|
+ <div id="confirmation">
|
|
115
|
+ <div id="confirmationTxt">Tu veux vraiment supprimer cet article ?</div>
|
|
116
|
+ <div id="choice">
|
|
117
|
+ <div id="yes" onClick={this.deleteArticle}>Oui</div>
|
|
118
|
+ <div id="no" onClick={this.handleNoDelete}>Non</div>
|
|
119
|
+ </div>
|
|
120
|
+ </div>
|
|
121
|
+ :
|
|
122
|
+ <>
|
|
123
|
+ <div id="imageordescblock">
|
|
124
|
+ {this.state.currentArticle === this.props.id ?
|
|
125
|
+ <>
|
|
126
|
+ <div id="icons">
|
|
127
|
+ <div id="bluepen" onClick={() => this.props.editArticle(this.props)}>
|
|
128
|
+ <Icon id="penblue" icon={editSolid} style={{color: '#ffffff', fontSize: '25px'}} rotate="270deg" />
|
|
129
|
+ </div>
|
|
130
|
+ <div id="redcross" onClick={this.handleRedCross}>
|
|
131
|
+ <Icon id="crossred" icon={plusIcon} style={{transform : 'rotate(-45deg)', color: '#ffffff', fontSize: '25px'}} />
|
|
132
|
+ </div>
|
112
|
133
|
</div>
|
113
|
|
- </div>
|
114
|
|
- :
|
115
|
|
- <>
|
116
|
|
- <div id="imageordescblock">
|
117
|
|
- {this.state.currentArticle === this.props.id ?
|
118
|
|
- <>
|
119
|
|
- <div id="icons">
|
120
|
|
- <div id="bluepen" onClick={() => this.props.editArticle(this.props)}>
|
121
|
|
- <Icon id="penblue" icon={editSolid} style={{color: '#ffffff', fontSize: '25px'}} rotate="270deg" />
|
|
134
|
+ <div id="categoryDiv">
|
|
135
|
+ <img onClick={() => this.props.handleCategories(this.props.category)} id="categoryIcon" alt="bonjour" src={`https://etud.insa-toulouse.fr/~proximo/api_proximo/storage/app/public/icon/${this.props.category.icon}`}/>
|
122
|
136
|
</div>
|
123
|
|
- <div id="redcross" onClick={this.handleRedCross}>
|
124
|
|
- <Icon id="crossred" icon={plusIcon} style={{transform : 'rotate(-45deg)', color: '#ffffff', fontSize: '25px'}} />
|
|
137
|
+ <div id="descandprice">
|
|
138
|
+ <h1 id="desc">{this.props.desc}</h1>
|
|
139
|
+ <p id ="price">{this.props.price} €</p>
|
125
|
140
|
</div>
|
126
|
|
- </div>
|
127
|
|
- <div id="categoryDiv">
|
128
|
|
- <img onClick={() => this.props.handleCategories(this.props.category)} id="categoryIcon" alt="bonjour" src={`https://etud.insa-toulouse.fr/~proximo/api_proximo/storage/app/public/icon/${this.props.category.icon}`}/>
|
129
|
|
- </div>
|
130
|
|
- <div id="descandprice">
|
131
|
|
- <h1 id="desc">{this.props.desc}</h1>
|
132
|
|
- <p id ="price">{this.props.price} €</p>
|
133
|
|
- </div>
|
134
|
|
- </>
|
135
|
|
- : <img id="image" src={`https://etud.insa-toulouse.fr/~proximo/api_proximo/storage/app/public/img/${this.props.img}`} alt='bonjour'/>
|
136
|
|
- }
|
137
|
|
- </div>
|
138
|
|
- <h1 id="name">{this.props.name}</h1>
|
139
|
|
- <div id="count">
|
140
|
|
- <Icon onClick={this.minusQuantity} icon={minusIcon} style={{color: '#ffffff', fontSize: '18.558874130249023px',cursor:'pointer'}} />
|
141
|
|
- <div id="countNumber">
|
142
|
|
- <p id="countNumberTxt">{this.state.quantity}</p>
|
|
141
|
+ </>
|
|
142
|
+ : <img id="image" src={`https://etud.insa-toulouse.fr/~proximo/api_proximo/storage/app/public/img/${this.props.img}`} alt='bonjour'/>
|
|
143
|
+ }
|
|
144
|
+ </div>
|
|
145
|
+ <h1 id="name">{this.props.name}</h1>
|
|
146
|
+ <div id="count">
|
|
147
|
+ <Icon onClick={this.minusQuantity} icon={minusIcon} style={{color: '#ffffff', fontSize: '18.558874130249023px',cursor:'pointer'}} />
|
|
148
|
+ <div id="countNumber">
|
|
149
|
+ <p id="countNumberTxt">{this.state.quantity}</p>
|
|
150
|
+ </div>
|
|
151
|
+ <Icon onClick={this.plusQuantity} icon={plusIcon} style={{color: '#ffffff', fontSize: '18.558874130249023px',cursor:'pointer'}} />
|
143
|
152
|
</div>
|
144
|
|
- <Icon onClick={this.plusQuantity} icon={plusIcon} style={{color: '#ffffff', fontSize: '18.558874130249023px',cursor:'pointer'}} />
|
145
|
|
- </div>
|
146
|
|
- </>
|
147
|
|
- }
|
148
|
|
- </div>
|
149
|
|
- :
|
150
|
|
- <div onClick={this.selectArticles} id="bulle" onMouseEnter={this.handleDesc} onMouseLeave={this.handlePhoto}>
|
151
|
|
- {this.state.redcrossPressed ?
|
152
|
|
- <div id="confirmation">
|
153
|
|
- <div id="confirmationTxt">Tu veux vraiment supprimer cet article ?</div>
|
154
|
|
- <div id="choice">
|
155
|
|
- <div id="yes" onClick={this.deleteArticle}>Oui</div>
|
156
|
|
- <div id="no" onClick={this.handleNoDelete}>Non</div>
|
|
153
|
+ </>
|
|
154
|
+ }
|
157
|
155
|
</div>
|
158
|
|
- </div>
|
|
156
|
+
|
159
|
157
|
:
|
160
|
|
- <>
|
161
|
|
- <div id="imageordescblock">
|
162
|
|
- {this.state.currentArticle === this.props.id ?
|
163
|
|
- <>
|
164
|
|
- <div id="icons">
|
165
|
|
- <div id="bluepen" onClick={() => this.props.editArticle(this.props)}>
|
166
|
|
- <Icon icon={editSolid} style={{color: '#ffffff', fontSize: '25px'}} rotate="270deg" />
|
|
158
|
+
|
|
159
|
+ // NOT SELECTED
|
|
160
|
+
|
|
161
|
+ <div onClick={this.selectArticles} id="bulle" onMouseEnter={this.handleDesc} onMouseLeave={this.handlePhoto}>
|
|
162
|
+ {this.state.redcrossPressed ?
|
|
163
|
+ <div id="confirmation">
|
|
164
|
+ <div id="confirmationTxt">Tu veux vraiment supprimer cet article ?</div>
|
|
165
|
+ <div id="choice">
|
|
166
|
+ <div id="yes" onClick={this.deleteArticle}>Oui</div>
|
|
167
|
+ <div id="no" onClick={this.handleNoDelete}>Non</div>
|
|
168
|
+ </div>
|
|
169
|
+ </div>
|
|
170
|
+ :
|
|
171
|
+ <>
|
|
172
|
+ <div id="imageordescblock">
|
|
173
|
+ {this.state.currentArticle === this.props.id ?
|
|
174
|
+ <>
|
|
175
|
+ <div id="icons">
|
|
176
|
+ <div id="bluepen" onClick={() => this.props.editArticle(this.props)}>
|
|
177
|
+ <Icon icon={editSolid} style={{color: '#ffffff', fontSize: '25px'}} rotate="270deg" />
|
|
178
|
+ </div>
|
|
179
|
+ <div id="redcross" onClick={this.handleRedCross}>
|
|
180
|
+ <Icon icon={plusIcon} style={{transform : 'rotate(-45deg)', color: '#ffffff', fontSize: '25px'}} />
|
|
181
|
+ </div>
|
167
|
182
|
</div>
|
168
|
|
- <div id="redcross" onClick={this.handleRedCross}>
|
169
|
|
- <Icon icon={plusIcon} style={{transform : 'rotate(-45deg)', color: '#ffffff', fontSize: '25px'}} />
|
|
183
|
+ <div id="categoryDiv">
|
|
184
|
+ <img onClick={() => this.props.handleCategories(this.props.category)} id="categoryIcon" alt="bonjour" src={`https://etud.insa-toulouse.fr/~proximo/api_proximo/storage/app/public/icon/${this.props.category.icon}`}/>
|
170
|
185
|
</div>
|
171
|
|
- </div>
|
172
|
|
- <div id="categoryDiv">
|
173
|
|
- <img onClick={() => this.props.handleCategories(this.props.category)} id="categoryIcon" alt="bonjour" src={`https://etud.insa-toulouse.fr/~proximo/api_proximo/storage/app/public/icon/${this.props.category.icon}`}/>
|
174
|
|
- </div>
|
175
|
|
- <div id="descandprice">
|
176
|
|
- <h1 id="desc">{this.props.desc}</h1>
|
177
|
|
- <p id ="price">{this.props.price} €</p>
|
178
|
|
- </div>
|
179
|
|
- </>
|
180
|
|
- : <img id="image" src={`https://etud.insa-toulouse.fr/~proximo/api_proximo/storage/app/public/img/${this.props.img}`} alt='bonjour'/>
|
181
|
|
- }
|
182
|
|
- </div>
|
183
|
|
- <h1 id="name">{this.props.name}</h1>
|
184
|
|
- <div id="count">
|
185
|
|
- <Icon onClick={this.minusQuantity} icon={minusIcon} style={{color: '#ffffff', fontSize: '18.558874130249023px',cursor:'pointer'}} />
|
186
|
|
- <div id="countNumber">
|
187
|
|
- <p id="countNumberTxt">{this.state.quantity}</p>
|
|
186
|
+ <div id="descandprice">
|
|
187
|
+ <h1 id="desc">{this.props.desc}</h1>
|
|
188
|
+ <p id ="price">{this.props.price} €</p>
|
|
189
|
+ </div>
|
|
190
|
+ </>
|
|
191
|
+ : <img id="image" src={`https://etud.insa-toulouse.fr/~proximo/api_proximo/storage/app/public/img/${this.props.img}`} alt='bonjour'/>
|
|
192
|
+ }
|
|
193
|
+ </div>
|
|
194
|
+ <h1 id="name">{this.props.name}</h1>
|
|
195
|
+ <div id="count">
|
|
196
|
+ <Icon onClick={this.minusQuantity} icon={minusIcon} style={{color: '#ffffff', fontSize: '18.558874130249023px',cursor:'pointer'}} />
|
|
197
|
+ <div id="countNumber">
|
|
198
|
+ <p id="countNumberTxt">{this.state.quantity}</p>
|
|
199
|
+ </div>
|
|
200
|
+ <Icon onClick={this.plusQuantity} icon={plusIcon} style={{color: '#ffffff', fontSize: '18.558874130249023px',cursor:'pointer'}} />
|
188
|
201
|
</div>
|
189
|
|
- <Icon onClick={this.plusQuantity} icon={plusIcon} style={{color: '#ffffff', fontSize: '18.558874130249023px',cursor:'pointer'}} />
|
|
202
|
+ </>
|
|
203
|
+ }
|
|
204
|
+ </div>
|
|
205
|
+
|
|
206
|
+ :
|
|
207
|
+
|
|
208
|
+ // INLINE
|
|
209
|
+
|
|
210
|
+ this.state.selected ?
|
|
211
|
+
|
|
212
|
+ // SELECTED
|
|
213
|
+
|
|
214
|
+ <div>Ok</div>
|
|
215
|
+
|
|
216
|
+ :
|
|
217
|
+
|
|
218
|
+ // NOT SELECTED
|
|
219
|
+
|
|
220
|
+ <div id="line">
|
|
221
|
+ <div id="imgLine">
|
|
222
|
+ <img id="imageLine" src={`https://etud.insa-toulouse.fr/~proximo/api_proximo/storage/app/public/img/${this.props.img}`} alt='bonjour'/>
|
190
|
223
|
</div>
|
191
|
|
- </>
|
192
|
|
- }
|
193
|
|
- </div>
|
|
224
|
+ <div id="nameLine">
|
|
225
|
+ {this.props.name}
|
|
226
|
+ </div>
|
|
227
|
+ <div id="priceLine">
|
|
228
|
+ {this.props.price} €
|
|
229
|
+ </div>
|
|
230
|
+ <div id="quantityLine">
|
|
231
|
+ <div id="quantityLineBox">
|
|
232
|
+ {this.props.quantity}
|
|
233
|
+ </div>
|
|
234
|
+ </div>
|
|
235
|
+ </div>
|
194
|
236
|
)
|
195
|
237
|
}
|
196
|
238
|
|