Browse Source

Added button

Ángel G. Romero Rosario 2 years ago
parent
commit
ab2e35cb5e

+ 13
- 12
build/asset-manifest.json View File

1
 {
1
 {
2
   "files": {
2
   "files": {
3
-    "main.css": "/static/css/main.30c9193e.css",
4
-    "main.js": "/static/js/main.a0b94822.js",
5
-    "static/js/738.aba3ba7d.chunk.js": "/static/js/738.aba3ba7d.chunk.js",
3
+    "main.css": "/static/css/main.3f863b78.css",
4
+    "main.js": "/static/js/main.5c3034d0.js",
5
+    "static/js/738.23d458d2.chunk.js": "/static/js/738.23d458d2.chunk.js",
6
     "static/js/372.1940d375.chunk.js": "/static/js/372.1940d375.chunk.js",
6
     "static/js/372.1940d375.chunk.js": "/static/js/372.1940d375.chunk.js",
7
     "static/js/856.c55f21fe.chunk.js": "/static/js/856.c55f21fe.chunk.js",
7
     "static/js/856.c55f21fe.chunk.js": "/static/js/856.c55f21fe.chunk.js",
8
-    "static/js/851.7ada53df.chunk.js": "/static/js/851.7ada53df.chunk.js",
8
+    "static/js/851.b02dec88.chunk.js": "/static/js/851.b02dec88.chunk.js",
9
     "static/js/22.7ec1dda8.chunk.js": "/static/js/22.7ec1dda8.chunk.js",
9
     "static/js/22.7ec1dda8.chunk.js": "/static/js/22.7ec1dda8.chunk.js",
10
     "static/js/272.fc222ae9.chunk.js": "/static/js/272.fc222ae9.chunk.js",
10
     "static/js/272.fc222ae9.chunk.js": "/static/js/272.fc222ae9.chunk.js",
11
     "static/js/841.bef26980.chunk.js": "/static/js/841.bef26980.chunk.js",
11
     "static/js/841.bef26980.chunk.js": "/static/js/841.bef26980.chunk.js",
12
-    "static/js/186.09c3ea27.chunk.js": "/static/js/186.09c3ea27.chunk.js",
12
+    "static/js/186.a076517b.chunk.js": "/static/js/186.a076517b.chunk.js",
13
     "static/js/377.31684c30.chunk.js": "/static/js/377.31684c30.chunk.js",
13
     "static/js/377.31684c30.chunk.js": "/static/js/377.31684c30.chunk.js",
14
+    "static/media/moti1.jpeg": "/static/media/moti1.9e77264ce56094743da3.jpeg",
14
     "service-worker.js": "/service-worker.js",
15
     "service-worker.js": "/service-worker.js",
15
     "index.html": "/index.html",
16
     "index.html": "/index.html",
16
-    "main.30c9193e.css.map": "/static/css/main.30c9193e.css.map",
17
-    "main.a0b94822.js.map": "/static/js/main.a0b94822.js.map",
18
-    "738.aba3ba7d.chunk.js.map": "/static/js/738.aba3ba7d.chunk.js.map",
17
+    "main.3f863b78.css.map": "/static/css/main.3f863b78.css.map",
18
+    "main.5c3034d0.js.map": "/static/js/main.5c3034d0.js.map",
19
+    "738.23d458d2.chunk.js.map": "/static/js/738.23d458d2.chunk.js.map",
19
     "372.1940d375.chunk.js.map": "/static/js/372.1940d375.chunk.js.map",
20
     "372.1940d375.chunk.js.map": "/static/js/372.1940d375.chunk.js.map",
20
     "856.c55f21fe.chunk.js.map": "/static/js/856.c55f21fe.chunk.js.map",
21
     "856.c55f21fe.chunk.js.map": "/static/js/856.c55f21fe.chunk.js.map",
21
-    "851.7ada53df.chunk.js.map": "/static/js/851.7ada53df.chunk.js.map",
22
+    "851.b02dec88.chunk.js.map": "/static/js/851.b02dec88.chunk.js.map",
22
     "22.7ec1dda8.chunk.js.map": "/static/js/22.7ec1dda8.chunk.js.map",
23
     "22.7ec1dda8.chunk.js.map": "/static/js/22.7ec1dda8.chunk.js.map",
23
     "272.fc222ae9.chunk.js.map": "/static/js/272.fc222ae9.chunk.js.map",
24
     "272.fc222ae9.chunk.js.map": "/static/js/272.fc222ae9.chunk.js.map",
24
     "841.bef26980.chunk.js.map": "/static/js/841.bef26980.chunk.js.map",
25
     "841.bef26980.chunk.js.map": "/static/js/841.bef26980.chunk.js.map",
25
-    "186.09c3ea27.chunk.js.map": "/static/js/186.09c3ea27.chunk.js.map",
26
+    "186.a076517b.chunk.js.map": "/static/js/186.a076517b.chunk.js.map",
26
     "377.31684c30.chunk.js.map": "/static/js/377.31684c30.chunk.js.map"
27
     "377.31684c30.chunk.js.map": "/static/js/377.31684c30.chunk.js.map"
27
   },
28
   },
28
   "entrypoints": [
29
   "entrypoints": [
29
-    "static/css/main.30c9193e.css",
30
-    "static/js/main.a0b94822.js"
30
+    "static/css/main.3f863b78.css",
31
+    "static/js/main.5c3034d0.js"
31
   ]
32
   ]
32
 }
33
 }

+ 1
- 1
build/index.html View File

1
-<!doctype html><html lang="en"><head><meta charset="utf-8"/><title>Ionic App</title><base href="/"/><meta name="color-scheme" content="light dark"/><meta name="viewport" content="viewport-fit=cover,width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/><meta name="format-detection" content="telephone=no"/><meta name="msapplication-tap-highlight" content="no"/><link rel="manifest" href="/manifest.json"/><link rel="shortcut icon" type="image/png" href="/assets/icon/favicon.png"/><meta name="apple-mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-title" content="Ionic App"/><meta name="apple-mobile-web-app-status-bar-style" content="black"/><script defer="defer" src="/static/js/main.a0b94822.js"></script><link href="/static/css/main.30c9193e.css" rel="stylesheet"></head><body><div id="root"></div></body></html>
1
+<!doctype html><html lang="en"><head><meta charset="utf-8"/><title>Ionic App</title><base href="/"/><meta name="color-scheme" content="light dark"/><meta name="viewport" content="viewport-fit=cover,width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/><meta name="format-detection" content="telephone=no"/><meta name="msapplication-tap-highlight" content="no"/><link rel="manifest" href="/manifest.json"/><link rel="shortcut icon" type="image/png" href="/assets/icon/favicon.png"/><meta name="apple-mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-title" content="Ionic App"/><meta name="apple-mobile-web-app-status-bar-style" content="black"/><script defer="defer" src="/static/js/main.5c3034d0.js"></script><link href="/static/css/main.3f863b78.css" rel="stylesheet"></head><body><div id="root"></div></body></html>

+ 1
- 1
build/service-worker.js
File diff suppressed because it is too large
View File


+ 1
- 1
build/service-worker.js.map
File diff suppressed because it is too large
View File


+ 0
- 2
build/static/css/main.30c9193e.css
File diff suppressed because it is too large
View File


+ 0
- 1
build/static/css/main.30c9193e.css.map
File diff suppressed because it is too large
View File


+ 1
- 0
ios/App/Podfile View File

15
   pod 'CapacitorHaptics', :path => '../../node_modules/@capacitor/haptics'
15
   pod 'CapacitorHaptics', :path => '../../node_modules/@capacitor/haptics'
16
   pod 'CapacitorKeyboard', :path => '../../node_modules/@capacitor/keyboard'
16
   pod 'CapacitorKeyboard', :path => '../../node_modules/@capacitor/keyboard'
17
   pod 'CapacitorStatusBar', :path => '../../node_modules/@capacitor/status-bar'
17
   pod 'CapacitorStatusBar', :path => '../../node_modules/@capacitor/status-bar'
18
+  pod 'CordovaPlugins', :path => '../capacitor-cordova-ios-plugins'
18
 end
19
 end
19
 
20
 
20
 target 'App' do
21
 target 'App' do

+ 561
- 461
package-lock.json
File diff suppressed because it is too large
View File


+ 3
- 1
package.json View File

10
     "@capacitor/ios": "4.5.0",
10
     "@capacitor/ios": "4.5.0",
11
     "@capacitor/keyboard": "4.1.0",
11
     "@capacitor/keyboard": "4.1.0",
12
     "@capacitor/status-bar": "4.1.0",
12
     "@capacitor/status-bar": "4.1.0",
13
+    "@ionic-native/geolocation": "^5.36.0",
13
     "@ionic/react": "^6.0.0",
14
     "@ionic/react": "^6.0.0",
14
     "@ionic/react-router": "^6.0.0",
15
     "@ionic/react-router": "^6.0.0",
15
     "@testing-library/jest-dom": "^5.11.9",
16
     "@testing-library/jest-dom": "^5.11.9",
20
     "@types/react": "^18.0.17",
21
     "@types/react": "^18.0.17",
21
     "@types/react-router": "^5.1.11",
22
     "@types/react-router": "^5.1.11",
22
     "@types/react-router-dom": "^5.1.7",
23
     "@types/react-router-dom": "^5.1.7",
24
+    "cordova-plugin-geolocation": "^4.1.0",
23
     "history": "^4.9.0",
25
     "history": "^4.9.0",
24
     "ionicons": "^6.0.3",
26
     "ionicons": "^6.0.3",
25
     "react": "^18.2.0",
27
     "react": "^18.2.0",
42
     "workbox-streams": "^5.1.4"
44
     "workbox-streams": "^5.1.4"
43
   },
45
   },
44
   "scripts": {
46
   "scripts": {
45
-    "start": "react-scripts start",
47
+    "start": "react-scripts --openssl-legacy-provider start",
46
     "build": "react-scripts build",
48
     "build": "react-scripts build",
47
     "test": "react-scripts test --transformIgnorePatterns 'node_modules/(?!(@ionic/react|@ionic/react-router|@ionic/core|@stencil/core|ionicons)/)'",
49
     "test": "react-scripts test --transformIgnorePatterns 'node_modules/(?!(@ionic/react|@ionic/react-router|@ionic/core|@stencil/core|ionicons)/)'",
48
     "eject": "react-scripts eject"
50
     "eject": "react-scripts eject"

+ 17
- 3
src/pages/Home.tsx View File

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
 import './styles/styles.css';
5
 import './styles/styles.css';
4
 
6
 
5
 // This is the date that is going to appear on the
7
 // This is the date that is going to appear on the
7
 const current = new Date();
9
 const current = new Date();
8
 const date = `${current.toLocaleString('default', {month: 'long'}) } ${current.getDate()}`;
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
 const Home: React.FC = () => {
21
 const Home: React.FC = () => {
12
 
22
 
15
     <IonPage>
25
     <IonPage>
16
       <IonHeader>
26
       <IonHeader>
17
         <IonToolbar>
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
         </IonToolbar>
32
         </IonToolbar>
20
       </IonHeader>
33
       </IonHeader>
21
       <IonContent fullscreen>
34
       <IonContent fullscreen>
35
+        
22
 
36
 
23
         {/* Card 1 */}
37
         {/* Card 1 */}
24
         <IonCard class="moti-card">
38
         <IonCard class="moti-card">

+ 4
- 0
src/pages/styles/styles.css View File

6
 .screen-titles{
6
 .screen-titles{
7
     color: #ffffff;
7
     color: #ffffff;
8
     font-size: 30px;
8
     font-size: 30px;
9
+    display: flex;
10
+    align-items: center;
9
 }
11
 }
10
 
12
 
11
 .screen-h2 {
13
 .screen-h2 {
51
     align-items: center;
53
     align-items: center;
52
 }
54
 }
53
 
55
 
56
+
57
+

+ 1
- 1
tsconfig.json View File

18
     "resolveJsonModule": true,
18
     "resolveJsonModule": true,
19
     "isolatedModules": true,
19
     "isolatedModules": true,
20
     "noEmit": true,
20
     "noEmit": true,
21
-    "jsx": "react-jsx"
21
+    "jsx": "preserve"
22
   },
22
   },
23
   "include": [
23
   "include": [
24
     "src"
24
     "src"