HomePhabricator
Diffusion Comm 6f6e14289405

[native] Navigate to the image / video modal when a user clicks on a media item

Description

[native] Navigate to the image / video modal when a user clicks on a media item

Summary:
We want to allow users to click on a media item in the gallery and navigate to either the VideoPlaybackModal or the ImageModal. The key parameter for the navigation is similar to the getMediaKey method (https://github.com/CommE2E/comm/blob/dc2f711faf30930a7c9f7f906a2a2b9f28d38bb0/native/chat/multimedia-message-utils.js#L129-L134). Here, for the thread media gallery, the key multimedia|${threadID}|${mediaInfo.index} is unique per media so when the key is pushed to the StackNavigator, there will be no existing duplicate key. We calculate the corners by checking the index of the media item relative to the gallery and the length of mediaInfos.

https://linear.app/comm/issue/ENG-2990/navigate-to-the-image-video-modal-when-a-user-clicks-on-a-media-item

Depends on D6660

Test Plan:
Checked that the navigation works on both iOS and Android.

Reviewers: atul, ginsu, tomek, ashoat

Reviewed By: ashoat

Subscribers: ashoat

Differential Revision: https://phab.comm.dev/D6718