Sfoglia il codice sorgente

Added List component

eliam.ruiz 2 anni fa
parent
commit
f8721bfd4a
2 ha cambiato i file con 62 aggiunte e 0 eliminazioni
  1. 14
    0
      src/components/ListComponent.css
  2. 48
    0
      src/components/ListComponent.tsx

+ 14
- 0
src/components/ListComponent.css Vedi File

@@ -0,0 +1,14 @@
1
+
2
+.list {
3
+    border-radius: 20px; 
4
+    padding: 0 0 0 0;
5
+    
6
+}
7
+
8
+.ListItemText {
9
+    font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
10
+}
11
+
12
+ion-list-header {
13
+    /* color: "primary"; */
14
+}

+ 48
- 0
src/components/ListComponent.tsx Vedi File

@@ -0,0 +1,48 @@
1
+import {
2
+  IonContent,
3
+  IonItem,
4
+  IonLabel,
5
+  IonList,
6
+  IonListHeader,
7
+} from "@ionic/react";
8
+import "../components/ListComponent.css";
9
+
10
+const ListComponent: React.FC<{ title?: string; laws: string[] }> = (props) => {
11
+  const title = props.title;
12
+  const laws = props.laws;
13
+  return (
14
+    <IonContent>
15
+      {title ? (
16
+        <IonListHeader>
17
+          <IonLabel>{title}</IonLabel>
18
+        </IonListHeader>
19
+      ) : null}
20
+
21
+      {laws.map((LawName: string) => {
22
+        return (
23
+          <IonItem href="#">
24
+            <p className="ListItemText">{LawName}</p>
25
+          </IonItem>
26
+        );
27
+      })}
28
+
29
+      {/*
30
+      <IonList className="list" lines="full">
31
+        <IonItem href="#">
32
+          <p className="ListItemText">Ley #1</p>
33
+        </IonItem>
34
+        <IonItem href="#">
35
+          <p className="ListItemText">Ley #1</p>
36
+        </IonItem>
37
+        <IonItem href="#">
38
+          <p className="ListItemText">Ley #1</p>
39
+        </IonItem>
40
+        <IonItem href="#">
41
+          <p className="ListItemText">Ley #1</p>
42
+        </IonItem>
43
+      </IonList>
44
+      */}
45
+    </IonContent>
46
+  );
47
+};
48
+export default ListComponent;