diff options
author | Ivan Chen <ivan@tagg.id> | 2021-06-24 17:41:45 -0400 |
---|---|---|
committer | Ivan Chen <ivan@tagg.id> | 2021-06-24 17:41:45 -0400 |
commit | b184179a8bff25ad018d02abc31acadc7b3f6a62 (patch) | |
tree | efd94448ee76860156d7622a61e6eb8785c10f10 /src/components/comments/CommentsCount.tsx | |
parent | 981051448fee6197544383e535fea7a72827d41d (diff) | |
parent | 53bdc94cf0491e348b7d4ad61e51ce1844423773 (diff) |
Merge branch 'master' into tma948-video-playback
# Conflicts:
# ios/Podfile.lock
# package.json
# src/components/moments/Moment.tsx
# src/routes/main/MainStackNavigator.tsx
# src/screens/moments/TagFriendsScreen.tsx
# src/screens/profile/CaptionScreen.tsx
# yarn.lock
Diffstat (limited to 'src/components/comments/CommentsCount.tsx')
-rw-r--r-- | src/components/comments/CommentsCount.tsx | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/components/comments/CommentsCount.tsx b/src/components/comments/CommentsCount.tsx new file mode 100644 index 00000000..90514193 --- /dev/null +++ b/src/components/comments/CommentsCount.tsx @@ -0,0 +1,48 @@ +import {useNavigation} from '@react-navigation/core'; +import React from 'react'; +import {StyleSheet, Text} from 'react-native'; +import {TouchableOpacity} from 'react-native-gesture-handler'; +import CommentsIcon from '../../assets/icons/moment-comment-icon.svg'; +import {MomentPostType, ScreenType} from '../../types'; +import {normalize} from '../../utils'; + +interface CommentsCountProps { + moment: MomentPostType; + screenType: ScreenType; +} + +const CommentsCount: React.FC<CommentsCountProps> = ({moment, screenType}) => { + const navigation = useNavigation(); + return ( + <TouchableOpacity + style={styles.countContainer} + onPress={() => + navigation.navigate('MomentCommentsScreen', { + moment_id: moment.moment_id, + screenType, + }) + }> + <CommentsIcon width={25} height={25} /> + <Text style={styles.count}>{moment.comments_count}</Text> + </TouchableOpacity> + ); +}; + +const styles = StyleSheet.create({ + countContainer: { + minWidth: 50, + flexDirection: 'column', + justifyContent: 'center', + alignItems: 'center', + }, + count: { + fontWeight: '500', + fontSize: normalize(11), + lineHeight: normalize(13), + letterSpacing: normalize(0.05), + textAlign: 'center', + color: 'white', + marginTop: normalize(5), + }, +}); +export default CommentsCount; |