aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/moments/MomentPost.tsx22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/components/moments/MomentPost.tsx b/src/components/moments/MomentPost.tsx
index 1f363052..4f8bb63f 100644
--- a/src/components/moments/MomentPost.tsx
+++ b/src/components/moments/MomentPost.tsx
@@ -4,16 +4,20 @@ import {useSelector} from 'react-redux';
import {MomentPostContent, MomentPostHeader} from '.';
import {deleteMomentTag, loadMomentTags} from '../../services';
import {RootState} from '../../store/rootReducer';
-import {MomentTagType, MomentType, ScreenType} from '../../types';
+import {MomentPostType, MomentTagType, ScreenType} from '../../types';
import {SCREEN_HEIGHT} from '../../utils';
interface MomentPostProps {
- item: MomentType;
+ moment: MomentPostType;
userXId: string | undefined;
screenType: ScreenType;
}
-const MomentPost: React.FC<MomentPostProps> = ({item, userXId, screenType}) => {
+const MomentPost: React.FC<MomentPostProps> = ({
+ moment,
+ userXId,
+ screenType,
+}) => {
const {userId: loggedInUserId, username: loggedInUsername} = useSelector(
(state: RootState) => state.user.user,
);
@@ -29,7 +33,7 @@ const MomentPost: React.FC<MomentPostProps> = ({item, userXId, screenType}) => {
const isOwnProfile = username === loggedInUsername;
const loadTags = async () => {
- const response = await loadMomentTags(item.moment_id);
+ const response = await loadMomentTags(moment.moment_id);
setTags(response ? response : []);
};
@@ -74,17 +78,17 @@ const MomentPost: React.FC<MomentPostProps> = ({item, userXId, screenType}) => {
userXId={userXId}
screenType={screenType}
username={isOwnProfile ? loggedInUsername : username}
- momentId={item.moment_id}
+ momentId={moment.moment_id}
style={styles.postHeader}
momentTagId={momentTagId}
removeTag={removeTag}
/>
<MomentPostContent
style={styles.postContent}
- momentId={item.moment_id}
- caption={item.caption}
- pathHash={item.moment_url}
- dateTime={item.date_created}
+ momentId={moment.moment_id}
+ caption={moment.caption}
+ pathHash={moment.moment_url}
+ dateTime={moment.date_created}
screenType={screenType}
momentTags={tags}
/>