Kaynağa Gözat

changes laws variable name to be more general

eliam.ruiz 2 yıl önce
ebeveyn
işleme
4d1f61ab2a

+ 1
- 5
src/components/ListComponent.css Dosyayı Görüntüle

@@ -7,8 +7,4 @@
7 7
 
8 8
 .ListItemText {
9 9
     font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
10
-}
11
-
12
-ion-list-header {
13
-    /* color: "primary"; */
14
-}
10
+}

+ 5
- 5
src/components/ListComponent.tsx Dosyayı Görüntüle

@@ -1,9 +1,9 @@
1 1
 import { IonContent, IonItem, IonLabel, IonListHeader } from "@ionic/react";
2 2
 import "../components/ListComponent.css";
3 3
 
4
-const ListComponent: React.FC<{ title?: string; laws: string[] }> = (props) => {
4
+const ListComponent: React.FC<{ title?: string; items: string[] }> = (props) => {
5 5
   const title = props.title;
6
-  const laws = props.laws;
6
+  const items = props.items;
7 7
   return (
8 8
     <IonContent>
9 9
       {title ? (
@@ -12,10 +12,10 @@ const ListComponent: React.FC<{ title?: string; laws: string[] }> = (props) => {
12 12
         </IonListHeader>
13 13
       ) : null}
14 14
 
15
-      {laws.map((lawName: string) => {
15
+      {items.map((itemName: string) => {
16 16
         return (
17
-          <IonItem routerLink={`/article/${encodeURIComponent(lawName)}`}>
18
-            <p className="ListItemText">{lawName}</p>
17
+          <IonItem routerLink={`/article/${encodeURIComponent(itemName)}`}>
18
+            <p className="ListItemText">{itemName}</p>
19 19
           </IonItem>
20 20
         );
21 21
       })}

+ 1
- 1
src/pages/Home.tsx Dosyayı Görüntüle

@@ -31,7 +31,7 @@ const Home: React.FC = () => {
31 31
         </div>
32 32
 
33 33
         <ListComponent
34
-          laws={["Articulo 1", "Articulo 2"]}
34
+          items={["Articulo 1", "Articulo 2"]}
35 35
           title="Articulos Recientes"
36 36
         />
37 37
       </IonContent>

+ 1
- 1
src/pages/LawListPage.tsx Dosyayı Görüntüle

@@ -21,7 +21,7 @@ const LawListPage: React.FC = () => {
21 21
             <IonTitle size="large">Leyes</IonTitle>
22 22
           </IonToolbar>
23 23
         </IonHeader>
24
-        <ListComponent laws={["Law 1", "Law 2"]} />
24
+        <ListComponent items={["Law 1", "Law 2"]} />
25 25
       </IonContent>
26 26
     </IonPage>
27 27
   );