Renacer Social, the app

ListComponent.tsx 1.1KB

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