Browse Source

Added moti messages to home

Ángel G. Romero Rosario 1 year ago
parent
commit
a22b412d0a

BIN
.DS_Store View File


+ 3
- 0
.vscode/settings.json View File

1
+{
2
+    "git.ignoreLimitWarning": true
3
+}

BIN
src/.DS_Store View File


BIN
src/images/.DS_Store View File


BIN
src/pages/.DS_Store View File


+ 32
- 4
src/pages/Home.tsx View File

1
-import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar, IonText } from '@ionic/react';
1
+import { IonContent, IonHeader,IonImg, IonCard, IonCardHeader, IonCardTitle, IonPage, IonTitle, IonToolbar, IonButton, IonIcon } from '@ionic/react';
2
+import { arrowDownCircle } from 'ionicons/icons';
2
 import './styles/styles.css';
3
 import './styles/styles.css';
3
 
4
 
5
+// This is the date that is going to appear on the
6
+// card with the Motivational message
7
+const current = new Date();
8
+const date = `${current.toLocaleString('default', {month: 'long'}) } ${current.getDate()}`;
9
+
10
+
4
 const Home: React.FC = () => {
11
 const Home: React.FC = () => {
12
+
5
   return (
13
   return (
14
+    
6
     <IonPage>
15
     <IonPage>
7
       <IonHeader>
16
       <IonHeader>
8
         <IonToolbar>
17
         <IonToolbar>
10
         </IonToolbar>
19
         </IonToolbar>
11
       </IonHeader>
20
       </IonHeader>
12
       <IonContent fullscreen>
21
       <IonContent fullscreen>
13
-        <IonText>
14
-          <p>Un texto</p>
15
-        </IonText>
22
+
23
+        {/* Card 1 */}
24
+        <IonCard class="moti-card">
25
+          <IonCardHeader class="card-header">
26
+            <IonCardTitle class="card-date">
27
+              {date}
28
+              <IonButton fill="clear"> <IonIcon slot="icon-only" icon={arrowDownCircle} class="moti-download"></IonIcon></IonButton> 
29
+            </IonCardTitle>
30
+          </IonCardHeader>
31
+          <IonImg class="moti-img" alt="Motivational messa ge" src={require("./generatedMsgs/moti1.jpeg")}></IonImg>
32
+        </IonCard>
33
+
34
+        {/* Card 2 */}
35
+        <IonCard class="moti-card">
36
+          <IonCardHeader class="card-header">
37
+            <IonCardTitle class="card-date">
38
+              {date}
39
+              <IonButton fill="clear"> <IonIcon slot="icon-only" icon={arrowDownCircle} class="moti-download"></IonIcon></IonButton>
40
+            </IonCardTitle>
41
+          </IonCardHeader>
42
+          <IonImg class="moti-img" alt="Motivational messa ge" src={require("./generatedMsgs/moti1.jpeg")}></IonImg>
43
+        </IonCard>
16
       </IonContent>
44
       </IonContent>
17
     </IonPage>
45
     </IonPage>
18
   );
46
   );

BIN
src/pages/generatedMsgs/moti1.jpeg View File


+ 31
- 1
src/pages/styles/styles.css View File

20
 
20
 
21
 .info-p {
21
 .info-p {
22
     line-height: 1.5;
22
     line-height: 1.5;
23
-}
23
+}
24
+
25
+/* Styles for home screen */
26
+
27
+.card-header {
28
+    padding-left: 5px;
29
+    padding-right: 5px;
30
+}
31
+
32
+.moti-download {
33
+    font-size: 40px;
34
+}
35
+
36
+.moti-card {
37
+    background-color: #fff;
38
+    border-radius: 15px !important;
39
+    padding: 15px;
40
+    margin: 15px;
41
+}
42
+
43
+.moti-img {
44
+    border-radius: 15px !important;
45
+    overflow: hidden;
46
+}
47
+.card-date {
48
+    color:#8f00ff;
49
+    display:flex;
50
+    justify-content: space-between;
51
+    align-items: center;
52
+}
53
+