From 49c0aeae95017ac69f57200bbbb1ff92f06f183e Mon Sep 17 00:00:00 2001 From: ivan gomes Date: Tue, 30 Nov 2021 12:30:58 +0100 Subject: [PATCH] updateAll --- package-lock.json | 25 +++++++++++++++---- package.json | 3 ++- .../preview-camera/preview-camera.page.html | 16 +++++++++--- .../preview-camera/preview-camera.page.ts | 14 +++++++++++ src/app/pages/chat/messages/messages.page.ts | 17 ++++++++++--- .../new-publication/new-publication.page.ts | 7 ++++-- src/assets/icon/chat/Ellipse 9.svg | 4 +++ src/main.ts | 1 + 8 files changed, 72 insertions(+), 15 deletions(-) create mode 100644 src/assets/icon/chat/Ellipse 9.svg diff --git a/package-lock.json b/package-lock.json index 5f3686bc9..c0cec9246 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2215,6 +2215,11 @@ "resolved": "https://registry.npmjs.org/@capacitor/push-notifications/-/push-notifications-1.0.7.tgz", "integrity": "sha512-vbvAptFq5cI6xKYYWMb7tsWvA88/PTG4v6ptxN0Ygtc1fQ4l/AzONQiYqdtFpbBhF2fML2kXQ/5eSAfn8HY9aw==" }, + "@capacitor/share": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@capacitor/share/-/share-1.0.7.tgz", + "integrity": "sha512-v7FRld2SdV64YjrZrKGoDyfYqcoEC2I4tk6nkhbOI8ZOaqm6XNiqCWEeTdeb6XPwDftozmfILSzhCxbASrXKMg==" + }, "@capacitor/storage": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/@capacitor/storage/-/storage-1.2.3.tgz", @@ -3129,6 +3134,21 @@ "@types/cordova": "^0.0.34" } }, + "@ionic-native/social-sharing": { + "version": "5.36.0", + "resolved": "https://registry.npmjs.org/@ionic-native/social-sharing/-/social-sharing-5.36.0.tgz", + "integrity": "sha512-DTgEpSYJxgLri0Hry3PpohtVIyi5srMqfPhhGfqVHh20xtvC56sHMvm9xpRg9cH6xtfBCzJbB0S+aGBtrU9m8g==", + "requires": { + "@types/cordova": "^0.0.34" + }, + "dependencies": { + "@types/cordova": { + "version": "0.0.34", + "resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz", + "integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ=" + } + } + }, "@ionic-native/splash-screen": { "version": "5.36.0", "resolved": "https://registry.npmjs.org/@ionic-native/splash-screen/-/splash-screen-5.36.0.tgz", @@ -8013,11 +8033,6 @@ "integrity": "sha512-+v/VzCYBdGsIxJTP2m+RWaq7l/NLu7b976w6XGJUFiN2TVOeaGrytaR4jRy0w9akRai8uKFeBmuGHmlS/sOeCA==", "dev": true }, - "cordova-plugin-x-socialsharing": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/cordova-plugin-x-socialsharing/-/cordova-plugin-x-socialsharing-6.0.3.tgz", - "integrity": "sha512-pnrE2CXsz4G0n0WoFDAasLS1VT3nIsNpddvXgfpiqX3wyOlSjO2NdF+sjYaTvs1B+f7z8EWbYCHpCrgBQiMLIg==" - }, "cordova-res": { "version": "0.15.3", "resolved": "https://registry.npmjs.org/cordova-res/-/cordova-res-0.15.3.tgz", diff --git a/package.json b/package.json index c62f12b60..d2b3d0859 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "@capacitor/keyboard": "^1.1.2", "@capacitor/network": "^1.0.6", "@capacitor/push-notifications": "^1.0.7", + "@capacitor/share": "^1.0.7", "@capacitor/storage": "^1.2.3", "@fortawesome/angular-fontawesome": "^0.9.0", "@fortawesome/fontawesome-free": "^5.15.3", @@ -70,6 +71,7 @@ "@ionic-native/network": "^5.36.0", "@ionic-native/photo-viewer": "^5.36.0", "@ionic-native/screen-orientation": "^5.35.0", + "@ionic-native/social-sharing": "^5.36.0", "@ionic-native/splash-screen": "^5.31.1", "@ionic-native/sqlite": "^5.36.0", "@ionic-native/sqlite-porter": "^4.20.0", @@ -101,7 +103,6 @@ "cordova-plugin-filepath": "^1.5.8", "cordova-plugin-okhttp": "^2.0.0", "cordova-plugin-screen-orientation": "^3.0.2", - "cordova-plugin-x-socialsharing": "^6.0.3", "cordova-res": "^0.15.3", "cross-env": "^7.0.3", "crypto-js": "^4.0.0", diff --git a/src/app/modals/preview-camera/preview-camera.page.html b/src/app/modals/preview-camera/preview-camera.page.html index f57da29b9..8c57c1bf4 100644 --- a/src/app/modals/preview-camera/preview-camera.page.html +++ b/src/app/modals/preview-camera/preview-camera.page.html @@ -27,22 +27,30 @@ - + - + - + - + + + + + + + + + diff --git a/src/app/modals/preview-camera/preview-camera.page.ts b/src/app/modals/preview-camera/preview-camera.page.ts index c5445dc27..23b2c37ec 100644 --- a/src/app/modals/preview-camera/preview-camera.page.ts +++ b/src/app/modals/preview-camera/preview-camera.page.ts @@ -3,6 +3,7 @@ import { IonSlides, ModalController, NavParams } from '@ionic/angular'; import { ImageCroppedEvent } from 'ngx-image-cropper'; import { PublicationsService } from 'src/app/services/publications.service'; import { GroupIconsPage } from '../group-icons/group-icons.page'; +import { Share } from '@capacitor/share'; @Component({ selector: 'app-preview-camera', @@ -102,5 +103,18 @@ async getIconGallery(){ } } +async getIconShare(){ + await Share.share({ + title: 'See cool stuff', + text: 'Really awesome thing you need to see right meow', + url: this.image, + dialogTitle: 'Share with buddies', + }); + +} + + + + } diff --git a/src/app/pages/chat/messages/messages.page.ts b/src/app/pages/chat/messages/messages.page.ts index bded0d72a..591b68890 100644 --- a/src/app/pages/chat/messages/messages.page.ts +++ b/src/app/pages/chat/messages/messages.page.ts @@ -24,6 +24,8 @@ import { Filesystem, Directory, Encoding } from '@capacitor/filesystem'; import { VoiceRecorder, VoiceRecorderPlugin, RecordingData, GenericResponse, CurrentRecordingStatus } from 'capacitor-voice-recorder'; import { Haptics, ImpactStyle } from '@capacitor/haptics'; import { PreviewCameraPage } from 'src/app/modals/preview-camera/preview-camera.page'; +import { SocialSharing } from '@ionic-native/social-sharing/ngx'; +import { Share } from '@capacitor/share'; const IMAGE_DIR = 'stored-images'; @@ -88,7 +90,8 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { private gestureController: GestureController, private processes: ProcessesService, public ThemeService: ThemeService, - private changeDetectorRef: ChangeDetectorRef + private changeDetectorRef: ChangeDetectorRef, + private socialSharing: SocialSharing ) { this.loggedUser = authService.ValidatedUserChat['data']; this.roomId = this.navParams.get('roomId'); @@ -652,8 +655,6 @@ touchStart(card) { modal.present(); } - - imageSize(img){ var canvas = document.createElement('canvas'); @@ -673,6 +674,16 @@ getPicture(img){ document.body.appendChild(canvas); } + + async ShareEmail(msg){ + // Check if sharing via email is supported + await Share.share({ + title: msg.u.username, + text: msg._updatedAt, + url: msg.attachments[0].image_url, + dialogTitle: 'Share with buddies', + }); + } } diff --git a/src/app/pages/publications/new-publication/new-publication.page.ts b/src/app/pages/publications/new-publication/new-publication.page.ts index a322ac46c..4d68e061e 100644 --- a/src/app/pages/publications/new-publication/new-publication.page.ts +++ b/src/app/pages/publications/new-publication/new-publication.page.ts @@ -20,7 +20,7 @@ import { Camera, CameraResultType, CameraSource, Photo } from '@capacitor/camera import { Filesystem, Directory } from '@capacitor/filesystem'; import { NgxImageCompressService } from "ngx-image-compress"; - +import { SocialSharing } from '@ionic-native/social-sharing/ngx'; const IMAGE_DIR = 'stored-images'; interface LocalFile { @@ -87,7 +87,8 @@ export class NewPublicationPage implements OnInit { public ThemeService: ThemeService, private platform: Platform, private loadingCtrl: LoadingController, - public imageCompress: NgxImageCompressService + public imageCompress: NgxImageCompressService, + private socialSharing: SocialSharing ) { this.publicationType = this.navParams.get('publicationType'); @@ -122,6 +123,8 @@ export class NewPublicationPage implements OnInit { this.saveImage(image) } + + } diff --git a/src/assets/icon/chat/Ellipse 9.svg b/src/assets/icon/chat/Ellipse 9.svg new file mode 100644 index 000000000..b0e7d1487 --- /dev/null +++ b/src/assets/icon/chat/Ellipse 9.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/main.ts b/src/main.ts index d52b16637..61a416308 100644 --- a/src/main.ts +++ b/src/main.ts @@ -16,4 +16,5 @@ platformBrowserDynamic().bootstrapModule(AppModule) .catch(err => console.log(err)); // Call the element loader after the platform has been bootstrapped + defineCustomElements(window);