|
@@ -1,5 +1,7 @@
|
1
|
|
-import { IonContent, IonHeader,IonImg, IonCard, IonCardHeader, IonCardTitle, IonPage, IonTitle, IonToolbar, IonButton, IonIcon } from '@ionic/react';
|
2
|
|
-import { arrowDownCircle } from 'ionicons/icons';
|
|
1
|
+import { IonContent, IonHeader,IonImg, IonCard, IonCardHeader, IonCardTitle, IonPage, IonTitle, IonToolbar, IonButton, IonIcon, IonText } from '@ionic/react';
|
|
2
|
+import { arrowDownCircle, heart } from 'ionicons/icons';
|
|
3
|
+import { isPlatform } from '@ionic/react';
|
|
4
|
+
|
3
|
5
|
import './styles/styles.css';
|
4
|
6
|
|
5
|
7
|
// This is the date that is going to appear on the
|
|
@@ -7,6 +9,14 @@ import './styles/styles.css';
|
7
|
9
|
const current = new Date();
|
8
|
10
|
const date = `${current.toLocaleString('default', {month: 'long'}) } ${current.getDate()}`;
|
9
|
11
|
|
|
12
|
+// Determine which platform the app is running (ios or android)
|
|
13
|
+// Compose message that will be opened with the click of a button
|
|
14
|
+const separator = isPlatform('ios') === false ? '&' : '?'
|
|
15
|
+const phoneNumber = '7877101934'
|
|
16
|
+const message = 'Hola. Tengo una emergencia, mi ubicación es esta:'
|
|
17
|
+
|
|
18
|
+const finalMessage = "sms:" + phoneNumber + separator + "body=" + message;
|
|
19
|
+
|
10
|
20
|
|
11
|
21
|
const Home: React.FC = () => {
|
12
|
22
|
|
|
@@ -15,10 +25,14 @@ const Home: React.FC = () => {
|
15
|
25
|
<IonPage>
|
16
|
26
|
<IonHeader>
|
17
|
27
|
<IonToolbar>
|
18
|
|
- <IonTitle class="ion-text-center screen-titles">TPC ❤️</IonTitle>
|
|
28
|
+ <IonTitle class="ion-text-center screen-titles">
|
|
29
|
+ <IonText>TPC</IonText>
|
|
30
|
+ <IonButton href={finalMessage}> <IonIcon slot="icon-only" icon={heart}class="moti-download"></IonIcon></IonButton>
|
|
31
|
+ </IonTitle>
|
19
|
32
|
</IonToolbar>
|
20
|
33
|
</IonHeader>
|
21
|
34
|
<IonContent fullscreen>
|
|
35
|
+
|
22
|
36
|
|
23
|
37
|
{/* Card 1 */}
|
24
|
38
|
<IonCard class="moti-card">
|