import {useNavigation} from '@react-navigation/native'; import React from 'react'; import {StyleSheet, View, Image, TouchableOpacity} from 'react-native'; import {MomentType} from 'src/types'; import {ProfileContext} from '../../routes'; interface MomentTileProps { moment: MomentType; isProfileView: boolean; } const MomentTile: React.FC = ({moment, isProfileView}) => { const navigation = useNavigation(); //Username is needed by the IndividualMoment screen const { user: {username}, } = React.useContext(ProfileContext); const {path_hash} = moment; return ( { navigation.push('IndividualMoment', {moment, isProfileView, username}); }}> ); }; const styles = StyleSheet.create({ image: { aspectRatio: 1, height: '100%', alignItems: 'center', justifyContent: 'center', flexDirection: 'column', }, }); export default MomentTile;