Ángel G. Romero Rosario 2 years ago
parent
commit
23555c44e6

+ 5
- 0
.gitignore 2 View File

1
+node_modules/
2
+public/
3
+ios/
4
+android/
5
+build/

+ 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


+ 10
- 0
capacitor.config 2.ts View File

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