瀏覽代碼

Added button

Ángel G. Romero Rosario 2 年之前
父節點
當前提交
ab2e35cb5e

+ 13
- 12
build/asset-manifest.json 查看文件

@@ -1,32 +1,33 @@
1 1
 {
2 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 6
     "static/js/372.1940d375.chunk.js": "/static/js/372.1940d375.chunk.js",
7 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 9
     "static/js/22.7ec1dda8.chunk.js": "/static/js/22.7ec1dda8.chunk.js",
10 10
     "static/js/272.fc222ae9.chunk.js": "/static/js/272.fc222ae9.chunk.js",
11 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 13
     "static/js/377.31684c30.chunk.js": "/static/js/377.31684c30.chunk.js",
14
+    "static/media/moti1.jpeg": "/static/media/moti1.9e77264ce56094743da3.jpeg",
14 15
     "service-worker.js": "/service-worker.js",
15 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 20
     "372.1940d375.chunk.js.map": "/static/js/372.1940d375.chunk.js.map",
20 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 23
     "22.7ec1dda8.chunk.js.map": "/static/js/22.7ec1dda8.chunk.js.map",
23 24
     "272.fc222ae9.chunk.js.map": "/static/js/272.fc222ae9.chunk.js.map",
24 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 27
     "377.31684c30.chunk.js.map": "/static/js/377.31684c30.chunk.js.map"
27 28
   },
28 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 查看文件

@@ -1 +1 @@
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
文件差異過大導致無法顯示
查看文件


+ 1
- 1
build/service-worker.js.map
文件差異過大導致無法顯示
查看文件


+ 0
- 2
build/static/css/main.30c9193e.css
文件差異過大導致無法顯示
查看文件


+ 0
- 1
build/static/css/main.30c9193e.css.map
文件差異過大導致無法顯示
查看文件


+ 1
- 0
ios/App/Podfile 查看文件

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

+ 561
- 461
package-lock.json
文件差異過大導致無法顯示
查看文件


+ 3
- 1
package.json 查看文件

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

+ 17
- 3
src/pages/Home.tsx 查看文件

@@ -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">

+ 4
- 0
src/pages/styles/styles.css 查看文件

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

+ 1
- 1
tsconfig.json 查看文件

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