From 07e9bcb7769b0e1deb6d39805ead359c6e007b43 Mon Sep 17 00:00:00 2001 From: Djorkaeff Alexandre Date: Fri, 26 Jun 2020 17:22:56 -0300 Subject: [PATCH] [NEW] Send multiple attachments (#2162) Co-authored-by: Diego Mello --- android/app/src/main/AndroidManifest.xml | 6 +- .../generated/BasePackageList.java | 1 + app/constants/colors.js | 12 +- app/containers/ActionSheet/Provider.js | 17 +- app/containers/Header/index.js | 13 +- app/containers/HeaderButton.js | 10 +- app/containers/MessageBox/LeftButtons.ios.js | 12 +- app/containers/MessageBox/Recording.js | 4 +- .../MessageBox/RightButtons.android.js | 15 +- app/containers/MessageBox/UploadModal.js | 249 - app/containers/MessageBox/index.js | 194 +- app/containers/MessageBox/styles.js | 3 + app/containers/RoomTypeIcon.js | 2 +- app/containers/StatusBar.js | 16 +- app/containers/message/styles.js | 3 +- app/i18n/locales/en.js | 3 + app/i18n/locales/pt-BR.js | 2 + .../ImageViewer/ImageComponent.js | 13 + ...ndex.android.js => ImageViewer.android.js} | 30 +- .../ImageViewer/ImageViewer.ios.js | 51 + app/presentation/ImageViewer/index.ios.js | 38 - app/presentation/ImageViewer/index.js | 3 + app/presentation/ImageViewer/types.js | 4 + app/selectors/login.js | 8 +- app/share.js | 61 +- app/stacks/InsideStack.js | 5 + app/stacks/MasterDetailStack/index.js | 5 + app/utils/isReadOnly.js | 14 +- app/utils/media.js | 9 +- app/views/AttachmentView.js | 42 +- app/views/RoomView/Header/Icon.js | 2 +- app/views/RoomView/UploadProgress.js | 4 +- app/views/RoomView/index.js | 4 +- app/views/ShareListView/index.js | 167 +- app/views/ShareListView/styles.js | 12 + app/views/ShareView/Header.js | 94 + app/views/ShareView/Preview.js | 136 + app/views/ShareView/Thumbs.js | 191 + app/views/ShareView/constants.js | 1 + app/views/ShareView/index.js | 519 +- app/views/ShareView/styles.js | 86 +- app/views/ShareView/utils.js | 4 + ios/Podfile.lock | 29 +- .../EXVideoThumbnailsModule.h | 1 + .../RNImageCropPicker/UIImage+Extension.h | 1 + .../CGGeometry+RSKImageCropper.h | 1 - .../RSKImageCropViewController+Protected.h | 1 - .../RSKImageCropViewController.h | 1 - .../Private/RSKImageCropper/RSKImageCropper.h | 1 - .../RSKImageCropper/RSKImageScrollView.h | 1 - .../RSKImageCropper/RSKInternalUtility.h | 1 - .../Private/RSKImageCropper/RSKTouchView.h | 1 - .../UIApplication+RSKImageCropper.h | 1 - .../RSKImageCropper/UIImage+RSKImageCropper.h | 1 - .../TOActivityCroppedImageProvider.h | 1 + .../TOCropViewController/TOCropOverlayView.h | 1 + .../TOCropViewController/TOCropScrollView.h | 1 + .../TOCropViewController/TOCropToolbar.h | 1 + .../Private/TOCropViewController/TOCropView.h | 1 + .../TOCropViewConstants.h | 1 + .../TOCropViewController.h | 1 + .../TOCropViewControllerTransitioning.h | 1 + .../TOCroppedImageAttributes.h | 1 + .../TOCropViewController/UIImage+CropRotate.h | 1 + .../EXVideoThumbnailsModule.h | 1 + .../RNImageCropPicker/UIImage+Extension.h | 1 + .../CGGeometry+RSKImageCropper.h | 1 - .../RSKImageCropViewController+Protected.h | 1 - .../RSKImageCropViewController.h | 1 - .../Public/RSKImageCropper/RSKImageCropper.h | 1 - .../RSKImageCropper/RSKImageScrollView.h | 1 - .../RSKImageCropper/RSKInternalUtility.h | 1 - .../Public/RSKImageCropper/RSKTouchView.h | 1 - .../UIApplication+RSKImageCropper.h | 1 - .../RSKImageCropper/UIImage+RSKImageCropper.h | 1 - .../TOActivityCroppedImageProvider.h | 1 + .../TOCropViewController/TOCropOverlayView.h | 1 + .../TOCropViewController/TOCropScrollView.h | 1 + .../TOCropViewController/TOCropToolbar.h | 1 + .../Public/TOCropViewController/TOCropView.h | 1 + .../TOCropViewConstants.h | 1 + .../TOCropViewController.h | 1 + .../TOCropViewControllerTransitioning.h | 1 + .../TOCroppedImageAttributes.h | 1 + .../TOCropViewController/UIImage+CropRotate.h | 1 + .../EXVideoThumbnails.podspec.json | 26 + .../RNImageCropPicker.podspec.json | 10 +- .../rn-extensions-share.podspec.json | 2 +- ios/Pods/Manifest.lock | 29 +- ios/Pods/Pods.xcodeproj/project.pbxproj | 32101 ++++++++-------- ios/Pods/RSKImageCropper/README.md | 195 - .../CGGeometry+RSKImageCropper.h | 114 - .../CGGeometry+RSKImageCropper.m | 203 - .../RSKImageCropViewController+Protected.h | 69 - .../RSKImageCropViewController.h | 352 - .../RSKImageCropViewController.m | 1059 - .../RSKImageCropper/RSKImageCropper.h | 44 - .../RSKImageCropper/RSKImageCropper.modulemap | 6 - .../ar.lproj/RSKImageCropper.strings | 30 - .../bg.lproj/RSKImageCropper.strings | 30 - .../bs.lproj/RSKImageCropper.strings | 30 - .../ca.lproj/RSKImageCropper.strings | 30 - .../cs.lproj/RSKImageCropper.strings | 30 - .../da.lproj/RSKImageCropper.strings | 30 - .../de.lproj/RSKImageCropper.strings | 30 - .../el.lproj/RSKImageCropper.strings | 30 - .../en.lproj/RSKImageCropper.strings | 30 - .../es.lproj/RSKImageCropper.strings | 30 - .../et.lproj/RSKImageCropper.strings | 30 - .../fi.lproj/RSKImageCropper.strings | 30 - .../fil.lproj/RSKImageCropper.strings | 30 - .../fr.lproj/RSKImageCropper.strings | 30 - .../he.lproj/RSKImageCropper.strings | 30 - .../hi.lproj/RSKImageCropper.strings | 30 - .../hr.lproj/RSKImageCropper.strings | 30 - .../hu.lproj/RSKImageCropper.strings | 30 - .../id.lproj/RSKImageCropper.strings | 30 - .../it.lproj/RSKImageCropper.strings | 30 - .../ja.lproj/RSKImageCropper.strings | 30 - .../ko.lproj/RSKImageCropper.strings | 30 - .../lt.lproj/RSKImageCropper.strings | 30 - .../lv.lproj/RSKImageCropper.strings | 30 - .../mk.lproj/RSKImageCropper.strings | 30 - .../ms.lproj/RSKImageCropper.strings | 30 - .../nb.lproj/RSKImageCropper.strings | 30 - .../nl.lproj/RSKImageCropper.strings | 30 - .../pl.lproj/RSKImageCropper.strings | 30 - .../pt.lproj/RSKImageCropper.strings | 30 - .../pt_BR.lproj/RSKImageCropper.strings | 30 - .../pt_PT.lproj/RSKImageCropper.strings | 30 - .../ro.lproj/RSKImageCropper.strings | 30 - .../ru.lproj/RSKImageCropper.strings | 31 - .../sk.lproj/RSKImageCropper.strings | 30 - .../sl.lproj/RSKImageCropper.strings | 30 - .../sr.lproj/RSKImageCropper.strings | 30 - .../sv.lproj/RSKImageCropper.strings | 30 - .../th.lproj/RSKImageCropper.strings | 30 - .../tr.lproj/RSKImageCropper.strings | 30 - .../uk.lproj/RSKImageCropper.strings | 30 - .../vi.lproj/RSKImageCropper.strings | 30 - .../zh-Hans.lproj/RSKImageCropper.strings | 30 - .../zh-Hant.lproj/RSKImageCropper.strings | 30 - .../zh.lproj/RSKImageCropper.strings | 30 - .../RSKImageCropper/RSKImageScrollView.h | 61 - .../RSKImageCropper/RSKImageScrollView.m | 315 - .../RSKImageCropper/RSKInternalUtility.h | 49 - .../RSKImageCropper/RSKInternalUtility.m | 48 - .../RSKImageCropper/RSKTouchView.h | 31 - .../RSKImageCropper/RSKTouchView.m | 37 - .../UIApplication+RSKImageCropper.h | 39 - .../UIApplication+RSKImageCropper.m | 56 - .../RSKImageCropper/UIImage+RSKImageCropper.h | 35 - .../RSKImageCropper/UIImage+RSKImageCropper.m | 141 - .../LICENSE | 12 +- .../Categories/UIImage+CropRotate.h | 31 + .../Categories/UIImage+CropRotate.m | 72 + .../Constants/TOCropViewConstants.h | 70 + .../Models/TOActivityCroppedImageProvider.h | 38 + .../Models/TOActivityCroppedImageProvider.m | 76 + .../TOCropViewControllerTransitioning.h | 49 + .../TOCropViewControllerTransitioning.m | 120 + .../Models/TOCroppedImageAttributes.h | 38 + .../Models/TOCroppedImageAttributes.m | 46 + .../TOCropViewControllerLocalizable.strings | 8 + .../TOCropViewControllerLocalizable.strings | 9 + .../TOCropViewControllerLocalizable.strings | 8 + .../TOCropViewControllerLocalizable.strings | 8 + .../TOCropViewControllerLocalizable.strings | 8 + .../TOCropViewControllerLocalizable.strings | 8 + .../TOCropViewControllerLocalizable.strings | 8 + .../TOCropViewControllerLocalizable.strings | 8 + .../TOCropViewControllerLocalizable.strings | 8 + .../TOCropViewControllerLocalizable.strings | 8 + .../TOCropViewControllerLocalizable.strings | 9 + .../TOCropViewControllerLocalizable.strings | 8 + .../TOCropViewControllerLocalizable.strings | 8 + .../TOCropViewControllerLocalizable.strings | 8 + .../TOCropViewControllerLocalizable.strings | 8 + .../TOCropViewControllerLocalizable.strings | 8 + .../TOCropViewControllerLocalizable.strings | 8 + .../TOCropViewControllerLocalizable.strings | 8 + .../TOCropViewControllerLocalizable.strings | 8 + .../TOCropViewControllerLocalizable.strings | 8 + .../TOCropViewControllerLocalizable.strings | 8 + .../TOCropViewControllerLocalizable.strings | 8 + .../TOCropViewControllerLocalizable.strings | 9 + .../TOCropViewControllerLocalizable.strings | 9 + .../TOCropViewControllerLocalizable.strings | 9 + .../TOCropViewControllerLocalizable.strings | 9 + .../TOCropViewController.h | 427 + .../TOCropViewController.m | 1265 + .../Views/TOCropOverlayView.h | 43 + .../Views/TOCropOverlayView.m | 231 + .../Views/TOCropScrollView.h | 39 + .../Views/TOCropScrollView.m | 51 + .../Views/TOCropToolbar.h | 84 + .../Views/TOCropToolbar.m | 625 + .../TOCropViewController/Views/TOCropView.h | 291 + .../TOCropViewController/Views/TOCropView.m | 1754 + ios/Pods/TOCropViewController/README.md | 263 + .../EXVideoThumbnails-dummy.m | 5 + .../EXVideoThumbnails-prefix.pch} | 0 .../EXVideoThumbnails.xcconfig | 11 + ...ods-RocketChatRN-acknowledgements.markdown | 48 +- .../Pods-RocketChatRN-acknowledgements.plist | 60 +- .../Pods-RocketChatRN-resources.sh | 4 +- .../Pods-RocketChatRN.debug.xcconfig | 6 +- .../Pods-RocketChatRN.release.xcconfig | 6 +- ...hareRocketChatRN-acknowledgements.markdown | 48 +- ...s-ShareRocketChatRN-acknowledgements.plist | 60 +- .../Pods-ShareRocketChatRN-resources.sh | 4 +- .../Pods-ShareRocketChatRN.debug.xcconfig | 6 +- .../Pods-ShareRocketChatRN.release.xcconfig | 6 +- .../RNImageCropPicker.xcconfig | 2 +- ...QBImagePicker-RNImageCropPicker-Info.plist | 2 +- .../RSKImageCropper/RSKImageCropper-dummy.m | 5 - ...llerBundle-TOCropViewController-Info.plist | 24 + .../TOCropViewController-dummy.m | 5 + .../TOCropViewController-prefix.pch | 12 + .../TOCropViewController.xcconfig} | 6 +- ios/RocketChatRN.xcodeproj/project.pbxproj | 8 +- ios/ShareRocketChatRN/Info.plist | 6 +- package.json | 4 +- yarn.lock | 22 +- 224 files changed, 23596 insertions(+), 21112 deletions(-) delete mode 100644 app/containers/MessageBox/UploadModal.js create mode 100644 app/presentation/ImageViewer/ImageComponent.js rename app/presentation/ImageViewer/{index.android.js => ImageViewer.android.js} (93%) create mode 100644 app/presentation/ImageViewer/ImageViewer.ios.js delete mode 100644 app/presentation/ImageViewer/index.ios.js create mode 100644 app/presentation/ImageViewer/index.js create mode 100644 app/presentation/ImageViewer/types.js create mode 100644 app/views/ShareView/Header.js create mode 100644 app/views/ShareView/Preview.js create mode 100644 app/views/ShareView/Thumbs.js create mode 100644 app/views/ShareView/constants.js create mode 100644 app/views/ShareView/utils.js create mode 120000 ios/Pods/Headers/Private/EXVideoThumbnails/EXVideoThumbnailsModule.h create mode 120000 ios/Pods/Headers/Private/RNImageCropPicker/UIImage+Extension.h delete mode 120000 ios/Pods/Headers/Private/RSKImageCropper/CGGeometry+RSKImageCropper.h delete mode 120000 ios/Pods/Headers/Private/RSKImageCropper/RSKImageCropViewController+Protected.h delete mode 120000 ios/Pods/Headers/Private/RSKImageCropper/RSKImageCropViewController.h delete mode 120000 ios/Pods/Headers/Private/RSKImageCropper/RSKImageCropper.h delete mode 120000 ios/Pods/Headers/Private/RSKImageCropper/RSKImageScrollView.h delete mode 120000 ios/Pods/Headers/Private/RSKImageCropper/RSKInternalUtility.h delete mode 120000 ios/Pods/Headers/Private/RSKImageCropper/RSKTouchView.h delete mode 120000 ios/Pods/Headers/Private/RSKImageCropper/UIApplication+RSKImageCropper.h delete mode 120000 ios/Pods/Headers/Private/RSKImageCropper/UIImage+RSKImageCropper.h create mode 120000 ios/Pods/Headers/Private/TOCropViewController/TOActivityCroppedImageProvider.h create mode 120000 ios/Pods/Headers/Private/TOCropViewController/TOCropOverlayView.h create mode 120000 ios/Pods/Headers/Private/TOCropViewController/TOCropScrollView.h create mode 120000 ios/Pods/Headers/Private/TOCropViewController/TOCropToolbar.h create mode 120000 ios/Pods/Headers/Private/TOCropViewController/TOCropView.h create mode 120000 ios/Pods/Headers/Private/TOCropViewController/TOCropViewConstants.h create mode 120000 ios/Pods/Headers/Private/TOCropViewController/TOCropViewController.h create mode 120000 ios/Pods/Headers/Private/TOCropViewController/TOCropViewControllerTransitioning.h create mode 120000 ios/Pods/Headers/Private/TOCropViewController/TOCroppedImageAttributes.h create mode 120000 ios/Pods/Headers/Private/TOCropViewController/UIImage+CropRotate.h create mode 120000 ios/Pods/Headers/Public/EXVideoThumbnails/EXVideoThumbnailsModule.h create mode 120000 ios/Pods/Headers/Public/RNImageCropPicker/UIImage+Extension.h delete mode 120000 ios/Pods/Headers/Public/RSKImageCropper/CGGeometry+RSKImageCropper.h delete mode 120000 ios/Pods/Headers/Public/RSKImageCropper/RSKImageCropViewController+Protected.h delete mode 120000 ios/Pods/Headers/Public/RSKImageCropper/RSKImageCropViewController.h delete mode 120000 ios/Pods/Headers/Public/RSKImageCropper/RSKImageCropper.h delete mode 120000 ios/Pods/Headers/Public/RSKImageCropper/RSKImageScrollView.h delete mode 120000 ios/Pods/Headers/Public/RSKImageCropper/RSKInternalUtility.h delete mode 120000 ios/Pods/Headers/Public/RSKImageCropper/RSKTouchView.h delete mode 120000 ios/Pods/Headers/Public/RSKImageCropper/UIApplication+RSKImageCropper.h delete mode 120000 ios/Pods/Headers/Public/RSKImageCropper/UIImage+RSKImageCropper.h create mode 120000 ios/Pods/Headers/Public/TOCropViewController/TOActivityCroppedImageProvider.h create mode 120000 ios/Pods/Headers/Public/TOCropViewController/TOCropOverlayView.h create mode 120000 ios/Pods/Headers/Public/TOCropViewController/TOCropScrollView.h create mode 120000 ios/Pods/Headers/Public/TOCropViewController/TOCropToolbar.h create mode 120000 ios/Pods/Headers/Public/TOCropViewController/TOCropView.h create mode 120000 ios/Pods/Headers/Public/TOCropViewController/TOCropViewConstants.h create mode 120000 ios/Pods/Headers/Public/TOCropViewController/TOCropViewController.h create mode 120000 ios/Pods/Headers/Public/TOCropViewController/TOCropViewControllerTransitioning.h create mode 120000 ios/Pods/Headers/Public/TOCropViewController/TOCroppedImageAttributes.h create mode 120000 ios/Pods/Headers/Public/TOCropViewController/UIImage+CropRotate.h create mode 100644 ios/Pods/Local Podspecs/EXVideoThumbnails.podspec.json delete mode 100644 ios/Pods/RSKImageCropper/README.md delete mode 100644 ios/Pods/RSKImageCropper/RSKImageCropper/CGGeometry+RSKImageCropper.h delete mode 100644 ios/Pods/RSKImageCropper/RSKImageCropper/CGGeometry+RSKImageCropper.m delete mode 100644 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropViewController+Protected.h delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropViewController.h delete mode 100644 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropViewController.m delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropper.h delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropper.modulemap delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/ar.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/bg.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/bs.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/ca.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/cs.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/da.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/de.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/el.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/en.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/es.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/et.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/fi.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/fil.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/fr.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/he.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/hi.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/hr.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/hu.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/id.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/it.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/ja.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/ko.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/lt.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/lv.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/mk.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/ms.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/nb.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/nl.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/pl.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/pt.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/pt_BR.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/pt_PT.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/ro.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/ru.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/sk.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/sl.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/sr.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/sv.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/th.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/tr.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/uk.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/vi.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/zh-Hans.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/zh-Hant.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageCropperStrings.bundle/zh.lproj/RSKImageCropper.strings delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageScrollView.h delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKImageScrollView.m delete mode 100644 ios/Pods/RSKImageCropper/RSKImageCropper/RSKInternalUtility.h delete mode 100644 ios/Pods/RSKImageCropper/RSKImageCropper/RSKInternalUtility.m delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKTouchView.h delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/RSKTouchView.m delete mode 100644 ios/Pods/RSKImageCropper/RSKImageCropper/UIApplication+RSKImageCropper.h delete mode 100644 ios/Pods/RSKImageCropper/RSKImageCropper/UIApplication+RSKImageCropper.m delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/UIImage+RSKImageCropper.h delete mode 100755 ios/Pods/RSKImageCropper/RSKImageCropper/UIImage+RSKImageCropper.m rename ios/Pods/{RSKImageCropper => TOCropViewController}/LICENSE (86%) mode change 100755 => 100644 create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Categories/UIImage+CropRotate.h create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Categories/UIImage+CropRotate.m create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Constants/TOCropViewConstants.h create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Models/TOActivityCroppedImageProvider.h create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Models/TOActivityCroppedImageProvider.m create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Models/TOCropViewControllerTransitioning.h create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Models/TOCropViewControllerTransitioning.m create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Models/TOCroppedImageAttributes.h create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Models/TOCroppedImageAttributes.m create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Resources/Base.lproj/TOCropViewControllerLocalizable.strings create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Resources/ar.lproj/TOCropViewControllerLocalizable.strings create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Resources/da-DK.lproj/TOCropViewControllerLocalizable.strings create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Resources/de.lproj/TOCropViewControllerLocalizable.strings create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Resources/en.lproj/TOCropViewControllerLocalizable.strings create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Resources/es.lproj/TOCropViewControllerLocalizable.strings create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Resources/fa-IR.lproj/TOCropViewControllerLocalizable.strings create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Resources/fa.lproj/TOCropViewControllerLocalizable.strings create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Resources/fi.lproj/TOCropViewControllerLocalizable.strings create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Resources/fr.lproj/TOCropViewControllerLocalizable.strings create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Resources/hu.lproj/TOCropViewControllerLocalizable.strings create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Resources/id.lproj/TOCropViewControllerLocalizable.strings create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Resources/it.lproj/TOCropViewControllerLocalizable.strings create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Resources/ja.lproj/TOCropViewControllerLocalizable.strings create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Resources/ko.lproj/TOCropViewControllerLocalizable.strings create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Resources/ms.lproj/TOCropViewControllerLocalizable.strings create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Resources/nl.lproj/TOCropViewControllerLocalizable.strings create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Resources/pl.lproj/TOCropViewControllerLocalizable.strings create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Resources/pt-BR.lproj/TOCropViewControllerLocalizable.strings create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Resources/pt.lproj/TOCropViewControllerLocalizable.strings create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Resources/ro.lproj/TOCropViewControllerLocalizable.strings create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Resources/ru.lproj/TOCropViewControllerLocalizable.strings create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Resources/tr.lproj/TOCropViewControllerLocalizable.strings create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Resources/vi.lproj/TOCropViewControllerLocalizable.strings create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Resources/zh-Hans.lproj/TOCropViewControllerLocalizable.strings create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Resources/zh-Hant.lproj/TOCropViewControllerLocalizable.strings create mode 100755 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/TOCropViewController.h create mode 100755 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/TOCropViewController.m create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Views/TOCropOverlayView.h create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Views/TOCropOverlayView.m create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Views/TOCropScrollView.h create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Views/TOCropScrollView.m create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Views/TOCropToolbar.h create mode 100644 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Views/TOCropToolbar.m create mode 100755 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Views/TOCropView.h create mode 100755 ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Views/TOCropView.m create mode 100644 ios/Pods/TOCropViewController/README.md create mode 100644 ios/Pods/Target Support Files/EXVideoThumbnails/EXVideoThumbnails-dummy.m rename ios/Pods/Target Support Files/{RSKImageCropper/RSKImageCropper-prefix.pch => EXVideoThumbnails/EXVideoThumbnails-prefix.pch} (100%) create mode 100644 ios/Pods/Target Support Files/EXVideoThumbnails/EXVideoThumbnails.xcconfig delete mode 100644 ios/Pods/Target Support Files/RSKImageCropper/RSKImageCropper-dummy.m create mode 100644 ios/Pods/Target Support Files/TOCropViewController/ResourceBundle-TOCropViewControllerBundle-TOCropViewController-Info.plist create mode 100644 ios/Pods/Target Support Files/TOCropViewController/TOCropViewController-dummy.m create mode 100644 ios/Pods/Target Support Files/TOCropViewController/TOCropViewController-prefix.pch rename ios/Pods/Target Support Files/{RSKImageCropper/RSKImageCropper.xcconfig => TOCropViewController/TOCropViewController.xcconfig} (62%) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 8130afc8..a672c0e2 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -3,13 +3,8 @@ package="chat.rocket.reactnative"> - - + diff --git a/android/app/src/main/java/chat/rocket/reactnative/generated/BasePackageList.java b/android/app/src/main/java/chat/rocket/reactnative/generated/BasePackageList.java index 80778aba..724f732a 100644 --- a/android/app/src/main/java/chat/rocket/reactnative/generated/BasePackageList.java +++ b/android/app/src/main/java/chat/rocket/reactnative/generated/BasePackageList.java @@ -15,6 +15,7 @@ public class BasePackageList { new expo.modules.keepawake.KeepAwakePackage(), new expo.modules.localauthentication.LocalAuthenticationPackage(), new expo.modules.permissions.PermissionsPackage(), + new expo.modules.videothumbnails.VideoThumbnailsPackage(), new expo.modules.webbrowser.WebBrowserPackage() ); } diff --git a/app/constants/colors.js b/app/constants/colors.js index 22025481..7b9d5676 100644 --- a/app/constants/colors.js +++ b/app/constants/colors.js @@ -53,7 +53,9 @@ export const themes = { passcodePrimary: '#2F343D', passcodeSecondary: '#6C727A', passcodeDotEmpty: '#CBCED1', - passcodeDotFull: '#6C727A' + passcodeDotFull: '#6C727A', + previewBackground: '#1F2329', + previewTintColor: '#ffffff' }, dark: { backgroundColor: '#030b1b', @@ -95,7 +97,9 @@ export const themes = { passcodePrimary: '#FFFFFF', passcodeSecondary: '#CBCED1', passcodeDotEmpty: '#CBCED1', - passcodeDotFull: '#6C727A' + passcodeDotFull: '#6C727A', + previewBackground: '#030b1b', + previewTintColor: '#ffffff' }, black: { backgroundColor: '#000000', @@ -137,6 +141,8 @@ export const themes = { passcodePrimary: '#FFFFFF', passcodeSecondary: '#CBCED1', passcodeDotEmpty: '#CBCED1', - passcodeDotFull: '#6C727A' + passcodeDotFull: '#6C727A', + previewBackground: '#000000', + previewTintColor: '#ffffff' } }; diff --git a/app/containers/ActionSheet/Provider.js b/app/containers/ActionSheet/Provider.js index 3dfcd0dc..3708e674 100644 --- a/app/containers/ActionSheet/Provider.js +++ b/app/containers/ActionSheet/Provider.js @@ -1,5 +1,4 @@ -import React, { useRef, useContext } from 'react'; -import hoistNonReactStatics from 'hoist-non-react-statics'; +import React, { useRef, useContext, forwardRef } from 'react'; import PropTypes from 'prop-types'; import ActionSheet from './ActionSheet'; @@ -14,15 +13,11 @@ export const useActionSheet = () => useContext(context); const { Provider, Consumer } = context; -export const withActionSheet = (Component) => { - const ConnectedActionSheet = props => ( - - {contexts => } - - ); - hoistNonReactStatics(ConnectedActionSheet, Component); - return ConnectedActionSheet; -}; +export const withActionSheet = Component => forwardRef((props, ref) => ( + + {contexts => } + +)); export const ActionSheetProvider = React.memo(({ children }) => { const ref = useRef(); diff --git a/app/containers/Header/index.js b/app/containers/Header/index.js index 2b61c79d..249b832e 100644 --- a/app/containers/Header/index.js +++ b/app/containers/Header/index.js @@ -4,11 +4,22 @@ import { SafeAreaView } from 'react-native-safe-area-context'; import { View, StyleSheet } from 'react-native'; import { themes } from '../../constants/colors'; import { themedHeader } from '../../utils/navigation'; -import { isIOS } from '../../utils/deviceInfo'; +import { isIOS, isTablet } from '../../utils/deviceInfo'; // Get from https://github.com/react-navigation/react-navigation/blob/master/packages/stack/src/views/Header/HeaderSegment.tsx#L69 export const headerHeight = isIOS ? 44 : 56; +export const getHeaderHeight = (isLandscape) => { + if (isIOS) { + if (isLandscape && !isTablet) { + return 32; + } else { + return 44; + } + } + return 56; +}; + const styles = StyleSheet.create({ container: { height: headerHeight, diff --git a/app/containers/HeaderButton.js b/app/containers/HeaderButton.js index 6782ec99..3ac44d45 100644 --- a/app/containers/HeaderButton.js +++ b/app/containers/HeaderButton.js @@ -36,9 +36,11 @@ export const DrawerButton = React.memo(({ navigation, testID, ...otherProps }) = )); -export const CloseModalButton = React.memo(({ navigation, testID, onPress = () => navigation.pop() }) => ( +export const CloseModalButton = React.memo(({ + navigation, testID, onPress = () => navigation.pop(), ...props +}) => ( - + )); @@ -57,9 +59,9 @@ export const MoreButton = React.memo(({ onPress, testID }) => ( )); -export const SaveButton = React.memo(({ onPress, testID }) => ( +export const SaveButton = React.memo(({ onPress, testID, ...props }) => ( - + )); diff --git a/app/containers/MessageBox/LeftButtons.ios.js b/app/containers/MessageBox/LeftButtons.ios.js index e00d1b8d..29c03846 100644 --- a/app/containers/MessageBox/LeftButtons.ios.js +++ b/app/containers/MessageBox/LeftButtons.ios.js @@ -1,22 +1,28 @@ import React from 'react'; import PropTypes from 'prop-types'; +import { View } from 'react-native'; import { CancelEditingButton, ActionsButton } from './buttons'; +import styles from './styles'; const LeftButtons = React.memo(({ - theme, showMessageBoxActions, editing, editCancel + theme, showMessageBoxActions, editing, editCancel, isActionsEnabled }) => { if (editing) { return ; } - return ; + if (isActionsEnabled) { + return ; + } + return ; }); LeftButtons.propTypes = { theme: PropTypes.string, showMessageBoxActions: PropTypes.func.isRequired, editing: PropTypes.bool, - editCancel: PropTypes.func.isRequired + editCancel: PropTypes.func.isRequired, + isActionsEnabled: PropTypes.bool }; export default LeftButtons; diff --git a/app/containers/MessageBox/Recording.js b/app/containers/MessageBox/Recording.js index 7611cdc9..d71724fb 100644 --- a/app/containers/MessageBox/Recording.js +++ b/app/containers/MessageBox/Recording.js @@ -6,7 +6,7 @@ import { import { AudioRecorder, AudioUtils } from 'react-native-audio'; import { BorderlessButton } from 'react-native-gesture-handler'; import { activateKeepAwake, deactivateKeepAwake } from 'expo-keep-awake'; -import RNFetchBlob from 'rn-fetch-blob'; +import * as FileSystem from 'expo-file-system'; import styles from './styles'; import I18n from '../../i18n'; @@ -113,7 +113,7 @@ export default class extends React.PureComponent { this.recording = false; const filePath = await AudioRecorder.stopRecording(); if (isAndroid) { - const data = await RNFetchBlob.fs.stat(decodeURIComponent(filePath)); + const data = await FileSystem.getInfoAsync(decodeURIComponent(filePath), { size: true }); this.finishRecording(true, filePath, data.size); } } catch (err) { diff --git a/app/containers/MessageBox/RightButtons.android.js b/app/containers/MessageBox/RightButtons.android.js index b351dde7..88d6e728 100644 --- a/app/containers/MessageBox/RightButtons.android.js +++ b/app/containers/MessageBox/RightButtons.android.js @@ -1,23 +1,25 @@ import React from 'react'; import PropTypes from 'prop-types'; +import { View } from 'react-native'; import { SendButton, AudioButton, ActionsButton } from './buttons'; +import styles from './styles'; const RightButtons = React.memo(({ - theme, showSend, submit, recordAudioMessage, recordAudioMessageEnabled, showMessageBoxActions + theme, showSend, submit, recordAudioMessage, recordAudioMessageEnabled, showMessageBoxActions, isActionsEnabled }) => { if (showSend) { return ; } - if (recordAudioMessageEnabled) { + if (recordAudioMessageEnabled || isActionsEnabled) { return ( <> - - + {recordAudioMessageEnabled ? : null} + {isActionsEnabled ? : null} ); } - return ; + return ; }); RightButtons.propTypes = { @@ -26,7 +28,8 @@ RightButtons.propTypes = { submit: PropTypes.func.isRequired, recordAudioMessage: PropTypes.func.isRequired, recordAudioMessageEnabled: PropTypes.bool, - showMessageBoxActions: PropTypes.func.isRequired + showMessageBoxActions: PropTypes.func.isRequired, + isActionsEnabled: PropTypes.bool }; export default RightButtons; diff --git a/app/containers/MessageBox/UploadModal.js b/app/containers/MessageBox/UploadModal.js deleted file mode 100644 index dd248e6a..00000000 --- a/app/containers/MessageBox/UploadModal.js +++ /dev/null @@ -1,249 +0,0 @@ -import React, { Component } from 'react'; -import { - View, Text, StyleSheet, Image, ScrollView, TouchableHighlight -} from 'react-native'; -import PropTypes from 'prop-types'; -import Modal from 'react-native-modal'; -import equal from 'deep-equal'; - -import TextInput from '../TextInput'; -import Button from '../Button'; -import I18n from '../../i18n'; -import sharedStyles from '../../views/Styles'; -import { isIOS } from '../../utils/deviceInfo'; -import { themes } from '../../constants/colors'; -import { CustomIcon } from '../../lib/Icons'; -import { withTheme } from '../../theme'; -import { withDimensions } from '../../dimensions'; - -const styles = StyleSheet.create({ - modal: { - width: '100%', - alignItems: 'center', - margin: 0 - }, - titleContainer: { - flexDirection: 'row', - paddingHorizontal: 16, - paddingTop: 16 - }, - title: { - fontSize: 14, - ...sharedStyles.textBold - }, - container: { - height: 430, - flexDirection: 'column' - }, - scrollView: { - flex: 1, - padding: 16 - }, - image: { - height: 150, - flex: 1, - marginBottom: 16, - resizeMode: 'contain' - }, - bigPreview: { - height: 250 - }, - buttonContainer: { - flexDirection: 'row', - justifyContent: 'space-between', - padding: 16 - }, - button: { - marginBottom: 0 - }, - androidButton: { - paddingHorizontal: 15, - justifyContent: 'center', - height: 48, - borderRadius: 2 - }, - androidButtonText: { - fontSize: 18, - textAlign: 'center' - }, - fileIcon: { - margin: 20, - flex: 1, - textAlign: 'center' - }, - video: { - flex: 1, - borderRadius: 4, - height: 150, - marginBottom: 6, - alignItems: 'center', - justifyContent: 'center' - } - -}); - -class UploadModal extends Component { - static propTypes = { - isVisible: PropTypes.bool, - file: PropTypes.object, - close: PropTypes.func, - submit: PropTypes.func, - width: PropTypes.number, - theme: PropTypes.string, - isMasterDetail: PropTypes.bool - } - - state = { - name: '', - description: '', - file: {} - }; - - static getDerivedStateFromProps(props, state) { - if (!equal(props.file, state.file) && props.file && props.file.path) { - return { - file: props.file, - name: props.file.filename || 'Filename', - description: '' - }; - } - return null; - } - - shouldComponentUpdate(nextProps, nextState) { - const { name, description, file } = this.state; - const { width, isVisible, theme } = this.props; - - if (nextState.name !== name) { - return true; - } - if (nextProps.theme !== theme) { - return true; - } - if (nextState.description !== description) { - return true; - } - if (nextProps.isVisible !== isVisible) { - return true; - } - if (nextProps.width !== width) { - return true; - } - if (!equal(nextState.file, file)) { - return true; - } - return false; - } - - submit = () => { - const { file, submit } = this.props; - const { name, description } = this.state; - submit({ ...file, name, description }); - } - - renderButtons = () => { - const { close, theme } = this.props; - if (isIOS) { - return ( - -