From a0b6cbaba61f8eb26ecb1e1f7ba15770c8c19b8d Mon Sep 17 00:00:00 2001 From: Shravya Ramesh Date: Tue, 25 May 2021 14:00:22 -0700 Subject: Use MomentPost component, Remove unused functions --- src/screens/profile/IndividualMoment.tsx | 39 ++++---------------------------- 1 file changed, 4 insertions(+), 35 deletions(-) (limited to 'src') diff --git a/src/screens/profile/IndividualMoment.tsx b/src/screens/profile/IndividualMoment.tsx index 515cbacf..4ad4515d 100644 --- a/src/screens/profile/IndividualMoment.tsx +++ b/src/screens/profile/IndividualMoment.tsx @@ -4,11 +4,7 @@ import {StackNavigationProp} from '@react-navigation/stack'; import React from 'react'; import {FlatList, StyleSheet, View} from 'react-native'; import {useSelector} from 'react-redux'; -import { - IndividualMomentTitleBar, - MomentPostContent, - MomentPostHeader, -} from '../../components'; +import {IndividualMomentTitleBar, MomentPost} from '../../components'; import {MainStackParams} from '../../routes'; import {RootState} from '../../store/rootreducer'; import {MomentType} from '../../types'; @@ -35,45 +31,16 @@ const IndividualMoment: React.FC = ({ }) => { const {moment_category, moment_id} = route.params.moment; const {userXId, screenType} = route.params; - const {username: loggedInUsername} = useSelector( - (state: RootState) => state.user.user, - ); - const { - user: {username}, - } = useSelector((state: RootState) => - userXId ? state.userX[screenType][userXId] : state.user, - ); const {moments} = useSelector((state: RootState) => userXId ? state.userX[screenType][userXId] : state.moments, ); - const isOwnProfile = username === loggedInUsername; const momentData = moments.filter( (m) => m.moment_category === moment_category, ); const initialIndex = momentData.findIndex((m) => m.moment_id === moment_id); - const renderMomentPost = ({item}: {item: MomentType}) => ( - - - - - ); - return ( = ({ ( + + )} keyExtractor={(item, index) => index.toString()} showsVerticalScrollIndicator={false} snapToAlignment={'start'} -- cgit v1.2.3-70-g09d2