Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32193711
D6466.1765099182.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D6466.1765099182.diff
View Options
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 = React.useMemo(() => [], []);
+
+ 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 (
+ <View key={item.id} style={memoizedStyles.mediaContainer}>
+ <TouchableOpacity>
+ <Image source={item.source} style={memoizedStyles.media} />
+ </TouchableOpacity>
+ </View>
+ );
+ },
+ [memoizedStyles.media, memoizedStyles.mediaContainer],
+ );
+
+ return <FlatList data={mediaInfos} numColumns={3} renderItem={renderItem} />;
+}
+
+const unboundStyles = {
+ mediaContainer: {
+ height: 180,
+ justifyContent: 'center',
+ alignItems: 'center',
+ },
+ media: {
+ height: 180,
+ },
+};
+
+export default ThreadSettingsMediaGallery;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 7, 9:19 AM (16 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5843277
Default Alt Text
D6466.1765099182.diff (1 KB)
Attached To
Mode
D6466: [native] Create a component for the media gallery on native
Attached
Detach File
Event Timeline
Log In to Comment