Browse Source

Merge branch 'eliam-sprint-1' of sergio.mattei/RenacerSocial into main

sergio.mattei 2 years ago
parent
commit
58dd79c6b9
7 changed files with 109 additions and 30 deletions
  1. 1
    1
      src/App.tsx
  2. 14
    0
      src/components/ListComponent.css
  3. 48
    0
      src/components/ListComponent.tsx
  4. 5
    4
      src/pages/Tab1.tsx
  5. 0
    25
      src/pages/Tab2.tsx
  6. 0
    0
      src/pages/home.css
  7. 41
    0
      src/pages/home.tsx

+ 1
- 1
src/App.tsx View File

@@ -12,7 +12,7 @@ import {
12 12
 import { IonReactRouter } from "@ionic/react-router";
13 13
 import { ellipse, square, triangle } from "ionicons/icons";
14 14
 import Tab1 from "./pages/Tab1";
15
-import Tab2 from "./pages/Tab2";
15
+import Tab2 from "./pages/home";
16 16
 import Tab3 from "./pages/Tab3";
17 17
 
18 18
 /* Core CSS required for Ionic components to work properly */

+ 14
- 0
src/components/ListComponent.css View 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 View 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;

+ 5
- 4
src/pages/Tab1.tsx View File

@@ -1,22 +1,23 @@
1 1
 import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar } from '@ionic/react';
2
-import ExploreContainer from '../components/ExploreContainer';
3 2
 import './Tab1.css';
3
+import '../components/ListComponent'
4
+import ListComponent from '../components/ListComponent';
4 5
 
5 6
 const Tab1: React.FC = () => {
6 7
   return (
7 8
     <IonPage>
8 9
       <IonHeader>
9 10
         <IonToolbar>
10
-          <IonTitle>Tab 1</IonTitle>
11
+          <IonTitle>List component test!</IonTitle>
11 12
         </IonToolbar>
12 13
       </IonHeader>
13 14
       <IonContent fullscreen>
14 15
         <IonHeader collapse="condense">
15 16
           <IonToolbar>
16
-            <IonTitle size="large">Tab 1</IonTitle>
17
+            <IonTitle size="large">This is a list</IonTitle>
17 18
           </IonToolbar>
18 19
         </IonHeader>
19
-        <ExploreContainer name="Tab 1 page" />
20
+       <ListComponent laws={[]}/>
20 21
       </IonContent>
21 22
     </IonPage>
22 23
   );

+ 0
- 25
src/pages/Tab2.tsx View File

@@ -1,25 +0,0 @@
1
-import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar } from '@ionic/react';
2
-import ExploreContainer from '../components/ExploreContainer';
3
-import './Tab2.css';
4
-
5
-const Tab2: React.FC = () => {
6
-  return (
7
-    <IonPage>
8
-      <IonHeader>
9
-        <IonToolbar>
10
-          <IonTitle>Tab 2</IonTitle>
11
-        </IonToolbar>
12
-      </IonHeader>
13
-      <IonContent fullscreen>
14
-        <IonHeader collapse="condense">
15
-          <IonToolbar>
16
-            <IonTitle size="large">Tab 2</IonTitle>
17
-          </IonToolbar>
18
-        </IonHeader>
19
-        <ExploreContainer name="Tab 2 page" />
20
-      </IonContent>
21
-    </IonPage>
22
-  );
23
-};
24
-
25
-export default Tab2;

src/pages/Tab2.css → src/pages/home.css View File


+ 41
- 0
src/pages/home.tsx View File

@@ -0,0 +1,41 @@
1
+import {
2
+  IonContent,
3
+  IonHeader,
4
+  IonPage,
5
+  IonTitle,
6
+  IonToolbar,
7
+} from "@ionic/react";
8
+import ExploreContainer from "../components/ExploreContainer";
9
+import "./home.css";
10
+import "../components/ListComponent";
11
+import ListComponent from "../components/ListComponent";
12
+
13
+const Tab2: React.FC = () => {
14
+  return (
15
+    <IonPage>
16
+      <IonHeader>
17
+        <IonToolbar>
18
+          <IonTitle>Renacer Social</IonTitle>
19
+        </IonToolbar>
20
+      </IonHeader>
21
+      <IonContent>
22
+        <IonHeader collapse="condense">
23
+          <IonToolbar>
24
+            <IonTitle size="large">Renacer Social</IonTitle>
25
+          </IonToolbar>
26
+        </IonHeader>
27
+        <div className="ion-padding">
28
+          <h5>Bienvenidos</h5>
29
+          <p>
30
+            Somos una organización Lorem Ipsum is simply dummy text of the
31
+            printing and typesetting industry. Lorem Ipsum.
32
+          </p>
33
+        </div>
34
+
35
+        <ListComponent laws={["eliam", "Sergio"]} title="Articulos Recientes" />
36
+      </IonContent>
37
+    </IonPage>
38
+  );
39
+};
40
+
41
+export default Tab2;