aboutsummaryrefslogtreecommitdiff
path: root/src/components/profile/MomentTile.tsx
blob: 70b20d401b9b1b0e6c24622c856bf8e324ddddf2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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;