From f0b9d3be6a5f12bc4520b3803ce3b22a787141d1 Mon Sep 17 00:00:00 2001 From: Astagor Date: Mon, 4 May 2020 18:59:06 +0200 Subject: [PATCH] Added share photo from gallery on mobile --- .../MeetingDrawer/FileSharing/FileSharing.js | 36 ++++++++++++++++++- app/src/translations/cn.json | 1 + app/src/translations/cs.json | 1 + app/src/translations/de.json | 1 + app/src/translations/dk.json | 1 + app/src/translations/el.json | 1 + app/src/translations/en.json | 1 + app/src/translations/es.json | 1 + app/src/translations/fr.json | 1 + app/src/translations/hr.json | 1 + app/src/translations/hu.json | 1 + app/src/translations/it.json | 1 + app/src/translations/nb.json | 1 + app/src/translations/pl.json | 1 + app/src/translations/pt.json | 1 + app/src/translations/ro.json | 1 + app/src/translations/tr.json | 1 + app/src/translations/uk.json | 1 + 18 files changed, 52 insertions(+), 1 deletion(-) diff --git a/app/src/components/MeetingDrawer/FileSharing/FileSharing.js b/app/src/components/MeetingDrawer/FileSharing/FileSharing.js index 6278e46..66a0d15 100644 --- a/app/src/components/MeetingDrawer/FileSharing/FileSharing.js +++ b/app/src/components/MeetingDrawer/FileSharing/FileSharing.js @@ -42,6 +42,7 @@ const FileSharing = (props) => const { canShareFiles, + browser, canShare, classes } = props; @@ -57,6 +58,17 @@ const FileSharing = (props) => defaultMessage : 'File sharing not supported' }); + const buttonGalleryDescription = canShareFiles ? + intl.formatMessage({ + id : 'label.shareGalleryFile', + defaultMessage : 'Share from gallery' + }) + : + intl.formatMessage({ + id : 'label.fileSharingUnsupported', + defaultMessage : 'File sharing not supported' + }); + return ( @@ -69,6 +81,14 @@ const FileSharing = (props) => onClick={(e) => (e.target.value = null)} id='share-files-button' /> + - + { + (browser.platform === 'mobile') && canShareFiles && canShare && + } ); @@ -87,6 +118,7 @@ const FileSharing = (props) => FileSharing.propTypes = { roomClient : PropTypes.any.isRequired, + browser : PropTypes.object.isRequired, canShareFiles : PropTypes.bool.isRequired, tabOpen : PropTypes.bool.isRequired, canShare : PropTypes.bool.isRequired, @@ -97,6 +129,7 @@ const mapStateToProps = (state) => { return { canShareFiles : state.me.canShareFiles, + browser : state.me.browser, tabOpen : state.toolarea.currentToolTab === 'files', canShare : state.me.roles.some((role) => @@ -113,6 +146,7 @@ export default withRoomContext(connect( { return ( prev.room.permissionsFromRoles === next.room.permissionsFromRoles && + prev.me.browser === next.me.browser && prev.me.roles === next.me.roles && prev.me.canShareFiles === next.me.canShareFiles && prev.toolarea.currentToolTab === next.toolarea.currentToolTab diff --git a/app/src/translations/cn.json b/app/src/translations/cn.json index e82e9d5..f26d3c5 100644 --- a/app/src/translations/cn.json +++ b/app/src/translations/cn.json @@ -92,6 +92,7 @@ "label.filesharing": "文件共享", "label.participants": "参与者", "label.shareFile": "共享文件", + "label.shareGalleryFile": null, "label.fileSharingUnsupported": "不支持文件共享", "label.unknown": "未知", "label.democratic": "民主视图", diff --git a/app/src/translations/cs.json b/app/src/translations/cs.json index 1a2b3c5..4c6eda8 100644 --- a/app/src/translations/cs.json +++ b/app/src/translations/cs.json @@ -91,6 +91,7 @@ "label.filesharing": "Sdílení souborů", "label.participants": "Účastníci", "label.shareFile": "Sdílet soubor", + "label.shareGalleryFile": null, "label.fileSharingUnsupported": "Sdílení souborů není podporováno", "label.unknown": "Neznámý", "label.democratic": "Rozvržení: Demokratické", diff --git a/app/src/translations/de.json b/app/src/translations/de.json index a6f6ac2..63bece8 100644 --- a/app/src/translations/de.json +++ b/app/src/translations/de.json @@ -92,6 +92,7 @@ "label.filesharing": "Dateien", "label.participants": "Teilnehmer", "label.shareFile": "Datei hochladen", + "label.shareGalleryFile": null, "label.fileSharingUnsupported": "Dateifreigabe nicht unterstützt", "label.unknown": "Unbekannt", "label.democratic": "Demokratisch", diff --git a/app/src/translations/dk.json b/app/src/translations/dk.json index 4027363..7228963 100644 --- a/app/src/translations/dk.json +++ b/app/src/translations/dk.json @@ -92,6 +92,7 @@ "label.filesharing": "Fildeling", "label.participants": "Deltagere", "label.shareFile": "Del fil", + "label.shareGalleryFile": null, "label.fileSharingUnsupported": "Fildeling er ikke understøttet", "label.unknown": "Ukendt", "label.democracy": "Galleri visning", diff --git a/app/src/translations/el.json b/app/src/translations/el.json index 5f93f42..dfc1f86 100644 --- a/app/src/translations/el.json +++ b/app/src/translations/el.json @@ -92,6 +92,7 @@ "label.filesharing": "Διαμοιρασμοός αρχείου", "label.participants": "Συμμετέχοντες", "label.shareFile": "Διαμοιραστείτε ένα αρχείο", + "label.shareGalleryFile": null, "label.fileSharingUnsupported": "Ο διαμοιρασμός αρχείων δεν υποστηρίζεται", "label.unknown": "Άγνωστο", "label.democratic": null, diff --git a/app/src/translations/en.json b/app/src/translations/en.json index 8fe4fa1..0f38032 100644 --- a/app/src/translations/en.json +++ b/app/src/translations/en.json @@ -92,6 +92,7 @@ "label.filesharing": "File sharing", "label.participants": "Participants", "label.shareFile": "Share file", + "label.shareGalleryFile": null, "label.fileSharingUnsupported": "File sharing not supported", "label.unknown": "Unknown", "label.democratic": "Democratic view", diff --git a/app/src/translations/es.json b/app/src/translations/es.json index d73506c..2d42660 100644 --- a/app/src/translations/es.json +++ b/app/src/translations/es.json @@ -92,6 +92,7 @@ "label.filesharing": "Compartir ficheros", "label.participants": "Participantes", "label.shareFile": "Compartir fichero", + "label.shareGalleryFile": null, "label.fileSharingUnsupported": "Compartir ficheros no está disponible", "label.unknown": "Desconocido", "label.democratic": "Vista democrática", diff --git a/app/src/translations/fr.json b/app/src/translations/fr.json index f884c36..753e8f3 100644 --- a/app/src/translations/fr.json +++ b/app/src/translations/fr.json @@ -92,6 +92,7 @@ "label.filesharing": "Partage de fichier", "label.participants": "Participants", "label.shareFile": "Partager un fichier", + "label.shareGalleryFile": null, "label.fileSharingUnsupported": "Partage de fichier non supporté", "label.unknown": "Inconnu", "label.democratic": "Vue démocratique", diff --git a/app/src/translations/hr.json b/app/src/translations/hr.json index eb9d08e..ca803be 100644 --- a/app/src/translations/hr.json +++ b/app/src/translations/hr.json @@ -92,6 +92,7 @@ "label.filesharing": "Dijeljenje datoteka", "label.participants": "Sudionici", "label.shareFile": "Dijeli datoteku", + "label.shareGalleryFile": null, "label.fileSharingUnsupported": "Dijeljenje datoteka nije podržano", "label.unknown": "Nepoznato", "label.democratic":"Demokratski prikaz", diff --git a/app/src/translations/hu.json b/app/src/translations/hu.json index f25b06a..43228fa 100644 --- a/app/src/translations/hu.json +++ b/app/src/translations/hu.json @@ -92,6 +92,7 @@ "label.filesharing": "Fájl megosztás", "label.participants": "Résztvevők", "label.shareFile": "Fájl megosztása", + "label.shareGalleryFile": null, "label.fileSharingUnsupported": "Fájl megosztás nem támogatott", "label.unknown": "Ismeretlen", "label.democratic": "Egyforma képméretű képkiosztás", diff --git a/app/src/translations/it.json b/app/src/translations/it.json index d027e7a..8126d6f 100644 --- a/app/src/translations/it.json +++ b/app/src/translations/it.json @@ -91,6 +91,7 @@ "label.filesharing": "Condivisione file", "label.participants": "Partecipanti", "label.shareFile": "Condividi file", + "label.shareGalleryFile": null, "label.fileSharingUnsupported": "Condivisione file non supportata", "label.unknown": "Sconosciuto", "label.democratic": "Vista Democratica", diff --git a/app/src/translations/nb.json b/app/src/translations/nb.json index e803bda..d95a866 100644 --- a/app/src/translations/nb.json +++ b/app/src/translations/nb.json @@ -92,6 +92,7 @@ "label.filesharing": "Fildeling", "label.participants": "Deltakere", "label.shareFile": "Del fil", + "label.shareGalleryFile": null, "label.fileSharingUnsupported": "Fildeling ikke støttet", "label.unknown": "Ukjent", "label.democratic": "Demokratisk", diff --git a/app/src/translations/pl.json b/app/src/translations/pl.json index 399f788..d366cf3 100644 --- a/app/src/translations/pl.json +++ b/app/src/translations/pl.json @@ -92,6 +92,7 @@ "label.filesharing": "Udostępnianie plików", "label.participants": "Uczestnicy", "label.shareFile": "Udostępnij plik", + "label.shareGalleryFile": null, "label.fileSharingUnsupported": "Udostępnianie plików nie jest obsługiwane", "label.unknown": "Nieznane", "label.democratic": "Układ demokratyczny", diff --git a/app/src/translations/pt.json b/app/src/translations/pt.json index d66d8da..867a3e5 100644 --- a/app/src/translations/pt.json +++ b/app/src/translations/pt.json @@ -92,6 +92,7 @@ "label.filesharing": "Partilha de ficheiro", "label.participants": "Participantes", "label.shareFile": "Partilhar ficheiro", + "label.shareGalleryFile": null, "label.fileSharingUnsupported": "Partilha de ficheiro não disponível", "label.unknown": "Desconhecido", "label.democratic": "Vista democrática", diff --git a/app/src/translations/ro.json b/app/src/translations/ro.json index b37b36a..ed8b24f 100644 --- a/app/src/translations/ro.json +++ b/app/src/translations/ro.json @@ -92,6 +92,7 @@ "label.filesharing": "Partajarea fișierelor", "label.participants": "Participanți", "label.shareFile": "Partajează fișierul", + "label.shareGalleryFile": null, "label.fileSharingUnsupported": "Partajarea fișierelor nu este acceptată", "label.unknown": "Necunoscut", "label.democratic": "Distribuție egală a dimensiunii imaginii", diff --git a/app/src/translations/tr.json b/app/src/translations/tr.json index d3d20e3..3d1b83b 100644 --- a/app/src/translations/tr.json +++ b/app/src/translations/tr.json @@ -92,6 +92,7 @@ "label.filesharing": "Dosya paylaşım", "label.participants": "Katılımcı", "label.shareFile": "Dosya paylaş", + "label.shareGalleryFile": null, "label.fileSharingUnsupported": "Dosya paylaşımı desteklenmiyor", "label.unknown": "Bilinmeyen", "label.democratic": "Demokratik görünüm", diff --git a/app/src/translations/uk.json b/app/src/translations/uk.json index dcb3c7d..9b4c4b5 100644 --- a/app/src/translations/uk.json +++ b/app/src/translations/uk.json @@ -92,6 +92,7 @@ "label.filesharing": "Обмін файлами", "label.participants": "Учасники", "label.shareFile": "Надіслати файл", + "label.shareGalleryFile": null, "label.fileSharingUnsupported": "Обмін файлами не підтримується", "label.unknown": "Невідомо", "label.democrat": "Демократичний вигляд",