HomePhabricator
Diffusion Comm ea3f91b287d3

[native] Display both photos and videos in the media gallery on native

Description

[native] Display both photos and videos in the media gallery on native

Summary:
Now that the responders and endpoints are set up, we need to populate the FlatList with real data from the database. This means we need to get the data and use it as the data prop in the FlatList.

Previously, the component memoized an empty array mediaInfos to prevent the FlatList from re-rendering each time ThreadSettingsMediaGallery re-rendered, since otherwise the array would have a new reference. Now, with useState, the reference to mediaInfos should persist across re-renders and mediaInfos shouldn't change until we fetch the media. This will be important for when we incorporate a full screen media gallery and fetch more media as the user scrolls to populate mediaInfos.

https://linear.app/comm/issue/ENG-2875/display-both-photos-and-videos-in-the-media-gallery-on-native

Depends on D6587

Test Plan:
Confirmed on both iOS and Android that the media loads in the thread settings. The videos are linked below.

Reviewers: atul, tomek, ginsu, ashoat

Reviewed By: ashoat

Subscribers: ashoat

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

Details