Ángel G. Romero Rosario 1 рік тому
джерело
коміт
23555c44e6

+ 5
- 0
.gitignore 2 Переглянути файл

@@ -0,0 +1,5 @@
1
+node_modules/
2
+public/
3
+ios/
4
+android/
5
+build/

+ 0
- 2
build/static/css/main.30c9193e.css
Різницю між файлами не показано, бо вона завелика
Переглянути файл


+ 0
- 1
build/static/css/main.30c9193e.css.map
Різницю між файлами не показано, бо вона завелика
Переглянути файл


+ 10
- 0
capacitor.config 2.ts Переглянути файл

@@ -0,0 +1,10 @@
1
+import { CapacitorConfig } from '@capacitor/cli';
2
+
3
+const config: CapacitorConfig = {
4
+  appId: 'io.ionic.starter',
5
+  appName: 'TPCApp',
6
+  webDir: 'build',
7
+  bundledWebRuntime: false
8
+};
9
+
10
+export default config;

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