diff options
Diffstat (limited to 'src/components/moments/MomentTile.tsx')
-rw-r--r-- | src/components/moments/MomentTile.tsx | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/components/moments/MomentTile.tsx b/src/components/moments/MomentTile.tsx new file mode 100644 index 00000000..70b20d40 --- /dev/null +++ b/src/components/moments/MomentTile.tsx @@ -0,0 +1,33 @@ +import {useNavigation} from '@react-navigation/native'; +import React from 'react'; +import {StyleSheet, View, Image, TouchableOpacity} from 'react-native'; +import {MomentType} from 'src/types'; + +interface MomentTileProps { + moment: MomentType; +} +const MomentTile: React.FC<MomentTileProps> = ({moment}) => { + const navigation = useNavigation(); + const {path_hash} = moment; + return ( + <TouchableOpacity + onPress={() => { + navigation.navigate('IndividualMoment', {moment}); + }}> + <View style={styles.image}> + <Image style={styles.image} source={{uri: path_hash}} /> + </View> + </TouchableOpacity> + ); +}; + +const styles = StyleSheet.create({ + image: { + aspectRatio: 1, + height: '100%', + alignItems: 'center', + justifyContent: 'center', + flexDirection: 'column', + }, +}); +export default MomentTile; |