diff --git a/native/chat/settings/thread-settings-media-gallery.react.js b/native/chat/settings/thread-settings-media-gallery.react.js new file mode 100644 --- /dev/null +++ b/native/chat/settings/thread-settings-media-gallery.react.js @@ -0,0 +1,64 @@ +// @flow + +import * as React from 'react'; +import { + View, + TouchableOpacity, + Image, + FlatList, + useWindowDimensions, +} from 'react-native'; + +import { useStyles } from '../../themes/colors'; + +function ThreadSettingsMediaGallery(): React.Node { + const styles = useStyles(unboundStyles); + const galleryItemGap = 8; + const { width } = useWindowDimensions(); + + const galleryItemWidth = (width - galleryItemGap * 3) / 3; + const mediaInfos = []; + + const memoizedStyles = React.useMemo(() => { + return { + mediaContainer: { + marginTop: galleryItemGap, + marginLeft: galleryItemGap, + width: galleryItemWidth, + ...styles.mediaContainer, + }, + media: { + width: galleryItemWidth, + ...styles.media, + }, + }; + }, [galleryItemGap, galleryItemWidth, styles.media, styles.mediaContainer]); + + const renderItem = React.useCallback( + ({ item }) => { + return ( + + + + + + ); + }, + [memoizedStyles.media, memoizedStyles.mediaContainer], + ); + + return ; +} + +const unboundStyles = { + mediaContainer: { + height: 180, + justifyContent: 'center', + alignItems: 'center', + }, + media: { + height: 180, + }, +}; + +export default ThreadSettingsMediaGallery;