aboutsummaryrefslogtreecommitdiff
path: root/src/components/comments/CommentsCount.tsx
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-06-23 17:50:22 -0400
committerGitHub <noreply@github.com>2021-06-23 17:50:22 -0400
commit53bdc94cf0491e348b7d4ad61e51ce1844423773 (patch)
tree5cc31490ed3d276e51cb1dc4385c2b26e6071ff9 /src/components/comments/CommentsCount.tsx
parent53461e8412b1f3b95124f9d9a6f50580d26930f5 (diff)
parentd309c8e66470d8d89063b817397cd6568bf6a8bf (diff)
Merge pull request #469 from shravyaramesh/tma923-image-cropper
[TMA-923/924] Image cropper, Display arbitrary sized image
Diffstat (limited to 'src/components/comments/CommentsCount.tsx')
-rw-r--r--src/components/comments/CommentsCount.tsx48
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;