Skip to content

Commit 61566f3

Browse files
committedDec 28, 2020
Added Results length to StrainList.js
1 parent 79b5ca9 commit 61566f3

File tree

2 files changed

+132
-0
lines changed

2 files changed

+132
-0
lines changed
 

‎src/components/api/database.json

+128
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
"password": "testt",
1212
"name": "Travis Stevenson",
1313
"id": 2
14+
},
15+
{
16+
"email": "granny@email.com",
17+
"password": "mydogsam",
18+
"name": "granny jones",
19+
"id": 3
1420
}
1521
],
1622
"userConditions": [
@@ -33,6 +39,11 @@
3339
"conditionId": 5,
3440
"userId": 1,
3541
"id": 7
42+
},
43+
{
44+
"conditionId": 13,
45+
"userId": 3,
46+
"id": 8
3647
}
3748
],
3849
"conditions": [
@@ -156,6 +167,59 @@
156167
},
157168
"name": "Afternoon Delight",
158169
"userId": 2
170+
},
171+
{
172+
"id": 367,
173+
"race": "hybrid",
174+
"flavors": [
175+
"Blueberry"
176+
],
177+
"effects": {
178+
"positive": [
179+
"Relaxed",
180+
"Euphoric",
181+
"Happy",
182+
"Uplifted",
183+
"Focused"
184+
],
185+
"negative": [],
186+
"medical": [
187+
"Depression",
188+
"Spasticity"
189+
]
190+
},
191+
"name": "Blue Wonder",
192+
"userId": 3
193+
},
194+
{
195+
"id": 443,
196+
"race": "hybrid",
197+
"flavors": [
198+
"Pine",
199+
"Earthy",
200+
"Lemon"
201+
],
202+
"effects": {
203+
"positive": [
204+
"Relaxed",
205+
"Hungry",
206+
"Happy",
207+
"Uplifted",
208+
"Sleepy"
209+
],
210+
"negative": [
211+
"Dry Mouth"
212+
],
213+
"medical": [
214+
"Depression",
215+
"Pain",
216+
"Stress",
217+
"Inflammation",
218+
"Spasticity"
219+
]
220+
},
221+
"name": "C3PO",
222+
"userId": 3
159223
}
160224
],
161225
"pass": [
@@ -223,6 +287,70 @@
223287
},
224288
"name": "Afwreck",
225289
"userId": 2
290+
},
291+
{
292+
"id": 368,
293+
"race": "hybrid",
294+
"flavors": [
295+
"Blueberry",
296+
"Earthy",
297+
"Honey"
298+
],
299+
"effects": {
300+
"positive": [
301+
"Creative",
302+
"Energetic",
303+
"Talkative"
304+
],
305+
"negative": [
306+
"Dizzy",
307+
"Dry Mouth",
308+
"Dry Eyes",
309+
"Anxious"
310+
],
311+
"medical": [
312+
"Depression",
313+
"Pain",
314+
"Stress",
315+
"Headaches",
316+
"Spasticity"
317+
]
318+
},
319+
"name": "Blue Wreck",
320+
"userId": 3
321+
},
322+
{
323+
"id": 612,
324+
"race": "hybrid",
325+
"flavors": [
326+
"Tobacco",
327+
"Cheese",
328+
"Pepper"
329+
],
330+
"effects": {
331+
"positive": [
332+
"Relaxed",
333+
"Euphoric",
334+
"Happy",
335+
"Talkative"
336+
],
337+
"negative": [
338+
"Dizzy",
339+
"Dry Mouth",
340+
"Paranoid",
341+
"Dry Eyes",
342+
"Anxious"
343+
],
344+
"medical": [
345+
"Depression",
346+
"Insomnia",
347+
"Stress",
348+
"Inflammation",
349+
"Spasticity"
350+
]
351+
},
352+
"name": "Critical Bilbo",
353+
"userId": 3
226354
}
227355
]
228356
}

‎src/components/strain/StrainList.js

+4
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ export const StrainList = (props) => {
4343
</Accordion.Collapse>
4444
</Card>
4545
</Accordion>
46+
<h1>Results Found: {
47+
strains.filter(strain => strain.effects.medical.find(condition => activeUsersSetConditions.includes(condition))).length
48+
}
49+
</h1>
4650
<div className="strains" style={{ padding: "1rem" }}>
4751

4852
{

0 commit comments

Comments
 (0)
Please sign in to comment.