diff options
| author | Ivan Chen <ivan@tagg.id> | 2021-05-21 20:04:12 -0400 |
|---|---|---|
| committer | Ivan Chen <ivan@tagg.id> | 2021-05-21 20:04:12 -0400 |
| commit | 9895bd4c52854767657f4d70dba4018cba2b8751 (patch) | |
| tree | df1f9920fba601313b9f1d101dc97cf9e9093a93 /src/components/moments | |
| parent | 494677881ac50438af19009b5996cb8548026d61 (diff) | |
Refactor code
Diffstat (limited to 'src/components/moments')
| -rw-r--r-- | src/components/moments/MomentPostContent.tsx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/components/moments/MomentPostContent.tsx b/src/components/moments/MomentPostContent.tsx index 9a174e73..e702cb68 100644 --- a/src/components/moments/MomentPostContent.tsx +++ b/src/components/moments/MomentPostContent.tsx @@ -1,20 +1,20 @@ import {useNavigation} from '@react-navigation/native'; -import React, {useEffect, useState} from 'react'; +import React, {useEffect, useRef, useState} from 'react'; import {Image, StyleSheet, Text, View, ViewProps} from 'react-native'; import {useDispatch, useStore} from 'react-redux'; import {getCommentsCount, loadMomentTags} from '../../services'; -import {userMomentsFetched} from '../../store/reducers'; import {RootState} from '../../store/rootReducer'; import {MomentTagType, ScreenType, UserType} from '../../types'; import { getTimePosted, navigateToProfile, + normalize, SCREEN_HEIGHT, SCREEN_WIDTH, - normalize, } from '../../utils'; import {mentionPartTypes, renderTextWithMentions} from '../../utils/comments'; import {CommentsCount} from '../comments'; +import {MomentTags} from '../common'; interface MomentPostContentProps extends ViewProps { screenType: ScreenType; @@ -37,6 +37,7 @@ const MomentPostContent: React.FC<MomentPostContentProps> = ({ const state: RootState = useStore().getState(); const navigation = useNavigation(); const dispatch = useDispatch(); + const imageRef = useRef(null); useEffect(() => { const loadTags = async () => { @@ -60,10 +61,12 @@ const MomentPostContent: React.FC<MomentPostContentProps> = ({ return ( <View style={[styles.container, style]}> <Image + ref={imageRef} style={styles.image} source={{uri: pathHash}} resizeMode={'cover'} /> + <MomentTags editing={false} tags={tags} imageRef={imageRef} /> <View style={styles.footerContainer}> <CommentsCount commentsCount={comments_count} |
