|
@@ -4,10 +4,9 @@ import {
|
4
|
4
|
IonItem,
|
5
|
5
|
IonLabel,
|
6
|
6
|
} from "@ionic/react";
|
7
|
|
-import "../components/ListComponent";
|
8
|
7
|
import ListComponent from "../components/ListComponent";
|
9
|
|
-import "../intefaces";
|
10
|
|
-import Category from "../intefaces";
|
|
8
|
+import { Category } from "../types";
|
|
9
|
+import "./DropdownComponent.css";
|
11
|
10
|
|
12
|
11
|
const DropdownComponent: React.FC<{
|
13
|
12
|
category: Category[];
|
|
@@ -16,25 +15,15 @@ const DropdownComponent: React.FC<{
|
16
|
15
|
return (
|
17
|
16
|
<IonAccordionGroup>
|
18
|
17
|
{category.map((catItem: Category, index) => {
|
19
|
|
- var position = "";
|
20
|
|
- if (index === 1) {
|
21
|
|
- position = "first";
|
22
|
|
- } else if (index === 2) {
|
23
|
|
- position = "second";
|
24
|
|
- } else if (index === 3) {
|
25
|
|
- position = "third";
|
26
|
|
- } else if (index === 4) {
|
27
|
|
- position = "fourth";
|
28
|
|
- } else if (index === 5) {
|
29
|
|
- position = "fifth";
|
30
|
|
- }
|
31
|
18
|
return (
|
32
|
|
- <IonAccordion value={position}>
|
|
19
|
+ <IonAccordion value={`${index}`}>
|
33
|
20
|
<IonItem slot="header" color="light">
|
34
|
21
|
<IonLabel>{catItem.name}</IonLabel>
|
35
|
22
|
</IonItem>
|
36
|
23
|
<IonItem slot="content">
|
37
|
|
- <ListComponent items={catItem.listItems} />
|
|
24
|
+ <div className="accordion-list-container">
|
|
25
|
+ <ListComponent items={catItem.listItems} />
|
|
26
|
+ </div>
|
38
|
27
|
</IonItem>
|
39
|
28
|
</IonAccordion>
|
40
|
29
|
);
|