From 66d21408b6b87ce2f5819b174f5ea9480bb72572 Mon Sep 17 00:00:00 2001 From: Djorkaeff Alexandre Date: Wed, 18 Dec 2019 18:13:11 -0300 Subject: [PATCH] [NEW] Image Viewer (#1479) --- .../__snapshots__/Storyshots.test.js.snap | 148 +- app/containers/FileModal.js | 132 - app/containers/HeaderButton.js | 10 + app/containers/message/Attachments.js | 8 +- app/containers/message/Image.js | 16 +- app/containers/message/Video.js | 6 +- app/containers/message/index.js | 6 +- app/i18n/locales/en.js | 4 + app/i18n/locales/pt-BR.js | 4 + app/index.js | 23 +- app/lib/utils.js | 12 +- app/presentation/ImageViewer/index.android.js | 442 + app/presentation/ImageViewer/index.ios.js | 38 + app/tablet.js | 5 + app/views/AttachmentView.js | 152 + app/views/MessagesView/index.js | 44 +- app/views/RoomActionsView/index.js | 2 +- app/views/RoomView/index.js | 24 +- app/views/SearchMessagesView/index.js | 2 +- app/views/Styles.js | 14 +- ios/Podfile.lock | 12 + .../Headers/Private/ReactNativeART/ARTBrush.h | 1 + .../Private/ReactNativeART/ARTCGFloatArray.h | 1 + .../Private/ReactNativeART/ARTContainer.h | 1 + .../Headers/Private/ReactNativeART/ARTGroup.h | 1 + .../Private/ReactNativeART/ARTGroupManager.h | 1 + .../ReactNativeART/ARTLinearGradient.h | 1 + .../Headers/Private/ReactNativeART/ARTNode.h | 1 + .../Private/ReactNativeART/ARTNodeManager.h | 1 + .../Private/ReactNativeART/ARTPattern.h | 1 + .../ReactNativeART/ARTRadialGradient.h | 1 + .../Private/ReactNativeART/ARTRenderable.h | 1 + .../ReactNativeART/ARTRenderableManager.h | 1 + .../Headers/Private/ReactNativeART/ARTShape.h | 1 + .../Private/ReactNativeART/ARTShapeManager.h | 1 + .../Private/ReactNativeART/ARTSolidColor.h | 1 + .../Private/ReactNativeART/ARTSurfaceView.h | 1 + .../ReactNativeART/ARTSurfaceViewManager.h | 1 + .../Headers/Private/ReactNativeART/ARTText.h | 1 + .../Private/ReactNativeART/ARTTextFrame.h | 1 + .../Private/ReactNativeART/ARTTextManager.h | 1 + .../Private/ReactNativeART/RCTConvert+ART.h | 1 + .../RNCAssetsLibraryRequestHandler.h | 1 + .../RNCCameraRollManager.h | 1 + .../Headers/Public/ReactNativeART/ARTBrush.h | 1 + .../Public/ReactNativeART/ARTCGFloatArray.h | 1 + .../Public/ReactNativeART/ARTContainer.h | 1 + .../Headers/Public/ReactNativeART/ARTGroup.h | 1 + .../Public/ReactNativeART/ARTGroupManager.h | 1 + .../Public/ReactNativeART/ARTLinearGradient.h | 1 + .../Headers/Public/ReactNativeART/ARTNode.h | 1 + .../Public/ReactNativeART/ARTNodeManager.h | 1 + .../Public/ReactNativeART/ARTPattern.h | 1 + .../Public/ReactNativeART/ARTRadialGradient.h | 1 + .../Public/ReactNativeART/ARTRenderable.h | 1 + .../ReactNativeART/ARTRenderableManager.h | 1 + .../Headers/Public/ReactNativeART/ARTShape.h | 1 + .../Public/ReactNativeART/ARTShapeManager.h | 1 + .../Public/ReactNativeART/ARTSolidColor.h | 1 + .../Public/ReactNativeART/ARTSurfaceView.h | 1 + .../ReactNativeART/ARTSurfaceViewManager.h | 1 + .../Headers/Public/ReactNativeART/ARTText.h | 1 + .../Public/ReactNativeART/ARTTextFrame.h | 1 + .../Public/ReactNativeART/ARTTextManager.h | 1 + .../Public/ReactNativeART/RCTConvert+ART.h | 1 + .../RNCAssetsLibraryRequestHandler.h | 1 + .../RNCCameraRollManager.h | 1 + .../RNSharedElement.podspec.json | 21 + .../ReactNativeART.podspec.json | 22 + .../react-native-cameraroll.podspec.json | 21 + .../react-native-splash-screen.podspec.json | 21 - ios/Pods/Manifest.lock | 12 + ios/Pods/Pods.xcodeproj/project.pbxproj | 16648 ++++++++-------- ...ods-RocketChatRN-acknowledgements.markdown | 49 + .../Pods-RocketChatRN-acknowledgements.plist | 61 + .../Pods-RocketChatRN.debug.xcconfig | 6 +- .../Pods-RocketChatRN.release.xcconfig | 6 +- ...hareRocketChatRN-acknowledgements.markdown | 49 + ...s-ShareRocketChatRN-acknowledgements.plist | 61 + .../Pods-ShareRocketChatRN.debug.xcconfig | 6 +- .../Pods-ShareRocketChatRN.release.xcconfig | 6 +- .../ReactNativeART/ReactNativeART-dummy.m | 5 + .../ReactNativeART/ReactNativeART-prefix.pch | 12 + .../ReactNativeART/ReactNativeART.xcconfig | 11 + .../react-native-cameraroll-dummy.m | 5 + .../react-native-cameraroll-prefix.pch | 12 + .../react-native-cameraroll.xcconfig | 11 + package.json | 4 + yarn.lock | 31 +- 89 files changed, 9892 insertions(+), 8338 deletions(-) delete mode 100644 app/containers/FileModal.js create mode 100644 app/presentation/ImageViewer/index.android.js create mode 100644 app/presentation/ImageViewer/index.ios.js create mode 100644 app/views/AttachmentView.js create mode 120000 ios/Pods/Headers/Private/ReactNativeART/ARTBrush.h create mode 120000 ios/Pods/Headers/Private/ReactNativeART/ARTCGFloatArray.h create mode 120000 ios/Pods/Headers/Private/ReactNativeART/ARTContainer.h create mode 120000 ios/Pods/Headers/Private/ReactNativeART/ARTGroup.h create mode 120000 ios/Pods/Headers/Private/ReactNativeART/ARTGroupManager.h create mode 120000 ios/Pods/Headers/Private/ReactNativeART/ARTLinearGradient.h create mode 120000 ios/Pods/Headers/Private/ReactNativeART/ARTNode.h create mode 120000 ios/Pods/Headers/Private/ReactNativeART/ARTNodeManager.h create mode 120000 ios/Pods/Headers/Private/ReactNativeART/ARTPattern.h create mode 120000 ios/Pods/Headers/Private/ReactNativeART/ARTRadialGradient.h create mode 120000 ios/Pods/Headers/Private/ReactNativeART/ARTRenderable.h create mode 120000 ios/Pods/Headers/Private/ReactNativeART/ARTRenderableManager.h create mode 120000 ios/Pods/Headers/Private/ReactNativeART/ARTShape.h create mode 120000 ios/Pods/Headers/Private/ReactNativeART/ARTShapeManager.h create mode 120000 ios/Pods/Headers/Private/ReactNativeART/ARTSolidColor.h create mode 120000 ios/Pods/Headers/Private/ReactNativeART/ARTSurfaceView.h create mode 120000 ios/Pods/Headers/Private/ReactNativeART/ARTSurfaceViewManager.h create mode 120000 ios/Pods/Headers/Private/ReactNativeART/ARTText.h create mode 120000 ios/Pods/Headers/Private/ReactNativeART/ARTTextFrame.h create mode 120000 ios/Pods/Headers/Private/ReactNativeART/ARTTextManager.h create mode 120000 ios/Pods/Headers/Private/ReactNativeART/RCTConvert+ART.h create mode 120000 ios/Pods/Headers/Private/react-native-cameraroll/RNCAssetsLibraryRequestHandler.h create mode 120000 ios/Pods/Headers/Private/react-native-cameraroll/RNCCameraRollManager.h create mode 120000 ios/Pods/Headers/Public/ReactNativeART/ARTBrush.h create mode 120000 ios/Pods/Headers/Public/ReactNativeART/ARTCGFloatArray.h create mode 120000 ios/Pods/Headers/Public/ReactNativeART/ARTContainer.h create mode 120000 ios/Pods/Headers/Public/ReactNativeART/ARTGroup.h create mode 120000 ios/Pods/Headers/Public/ReactNativeART/ARTGroupManager.h create mode 120000 ios/Pods/Headers/Public/ReactNativeART/ARTLinearGradient.h create mode 120000 ios/Pods/Headers/Public/ReactNativeART/ARTNode.h create mode 120000 ios/Pods/Headers/Public/ReactNativeART/ARTNodeManager.h create mode 120000 ios/Pods/Headers/Public/ReactNativeART/ARTPattern.h create mode 120000 ios/Pods/Headers/Public/ReactNativeART/ARTRadialGradient.h create mode 120000 ios/Pods/Headers/Public/ReactNativeART/ARTRenderable.h create mode 120000 ios/Pods/Headers/Public/ReactNativeART/ARTRenderableManager.h create mode 120000 ios/Pods/Headers/Public/ReactNativeART/ARTShape.h create mode 120000 ios/Pods/Headers/Public/ReactNativeART/ARTShapeManager.h create mode 120000 ios/Pods/Headers/Public/ReactNativeART/ARTSolidColor.h create mode 120000 ios/Pods/Headers/Public/ReactNativeART/ARTSurfaceView.h create mode 120000 ios/Pods/Headers/Public/ReactNativeART/ARTSurfaceViewManager.h create mode 120000 ios/Pods/Headers/Public/ReactNativeART/ARTText.h create mode 120000 ios/Pods/Headers/Public/ReactNativeART/ARTTextFrame.h create mode 120000 ios/Pods/Headers/Public/ReactNativeART/ARTTextManager.h create mode 120000 ios/Pods/Headers/Public/ReactNativeART/RCTConvert+ART.h create mode 120000 ios/Pods/Headers/Public/react-native-cameraroll/RNCAssetsLibraryRequestHandler.h create mode 120000 ios/Pods/Headers/Public/react-native-cameraroll/RNCCameraRollManager.h create mode 100644 ios/Pods/Local Podspecs/RNSharedElement.podspec.json create mode 100644 ios/Pods/Local Podspecs/ReactNativeART.podspec.json create mode 100644 ios/Pods/Local Podspecs/react-native-cameraroll.podspec.json delete mode 100644 ios/Pods/Local Podspecs/react-native-splash-screen.podspec.json create mode 100644 ios/Pods/Target Support Files/ReactNativeART/ReactNativeART-dummy.m create mode 100644 ios/Pods/Target Support Files/ReactNativeART/ReactNativeART-prefix.pch create mode 100644 ios/Pods/Target Support Files/ReactNativeART/ReactNativeART.xcconfig create mode 100644 ios/Pods/Target Support Files/react-native-cameraroll/react-native-cameraroll-dummy.m create mode 100644 ios/Pods/Target Support Files/react-native-cameraroll/react-native-cameraroll-prefix.pch create mode 100644 ios/Pods/Target Support Files/react-native-cameraroll/react-native-cameraroll.xcconfig diff --git a/__tests__/__snapshots__/Storyshots.test.js.snap b/__tests__/__snapshots__/Storyshots.test.js.snap index 0b49d598..b7e07750 100644 --- a/__tests__/__snapshots__/Storyshots.test.js.snap +++ b/__tests__/__snapshots__/Storyshots.test.js.snap @@ -10718,39 +10718,59 @@ exports[`Storyshots Message list 1`] = ` style={ Array [ Object { - "overflow": "hidden", + "borderRadius": 4, + "borderWidth": 1, + "minHeight": 200, + "width": "100%", + }, + Object { + "borderColor": "#e1e5e8", }, - Array [ - Object { - "borderRadius": 4, - "borderWidth": 1, - "minHeight": 200, - "width": "100%", - }, - Object { - "borderColor": "#e1e5e8", - }, - ], ] } > - + > + + - + > + + { - if (attachment && attachment.image_url) { - const url = formatAttachmentUrl(attachment.image_url, user.id, user.token, baseUrl); - return ( - - - - {attachment.title} - {attachment.description ? {attachment.description} : null} - - - null} - renderImage={props => } - loadingRender={() => } - /> - - ); - } - if (attachment && attachment.video_url) { - const [loading, setLoading] = useState(true); - const uri = formatAttachmentUrl(attachment.video_url, user.id, user.token, baseUrl); - return ( - <> -