aboutsummaryrefslogtreecommitdiff
path: root/src/components/comments/CommentsCount.tsx
diff options
context:
space:
mode:
authorShravya Ramesh <shravs1208@gmail.com>2021-06-22 08:44:12 -0700
committerShravya Ramesh <shravs1208@gmail.com>2021-06-22 08:44:12 -0700
commit706a6c77971a10d8d45d1b3e189eadc28f89841e (patch)
tree11f1547b1903b94c63614b15206c81cccf6a8b44 /src/components/comments/CommentsCount.tsx
parent4cb6ccf53bc7bf6a6749e9b04c7e1dd057aab56e (diff)
Fix lint errors
Diffstat (limited to 'src/components/comments/CommentsCount.tsx')
-rw-r--r--src/components/comments/CommentsCount.tsx39
1 files changed, 20 insertions, 19 deletions
diff --git a/src/components/comments/CommentsCount.tsx b/src/components/comments/CommentsCount.tsx
index cb30fe76..90514193 100644
--- a/src/components/comments/CommentsCount.tsx
+++ b/src/components/comments/CommentsCount.tsx
@@ -1,6 +1,6 @@
import {useNavigation} from '@react-navigation/core';
import React from 'react';
-import {Text} from 'react-native';
+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';
@@ -15,12 +15,7 @@ const CommentsCount: React.FC<CommentsCountProps> = ({moment, screenType}) => {
const navigation = useNavigation();
return (
<TouchableOpacity
- style={{
- minWidth: 50,
- flexDirection: 'column',
- justifyContent: 'center',
- alignItems: 'center',
- }}
+ style={styles.countContainer}
onPress={() =>
navigation.navigate('MomentCommentsScreen', {
moment_id: moment.moment_id,
@@ -28,20 +23,26 @@ const CommentsCount: React.FC<CommentsCountProps> = ({moment, screenType}) => {
})
}>
<CommentsIcon width={25} height={25} />
- <Text
- style={{
- fontWeight: '500',
- fontSize: normalize(11),
- lineHeight: normalize(13),
- letterSpacing: normalize(0.05),
- textAlign: 'center',
- color: 'white',
- marginTop: normalize(5),
- }}>
- {moment.comments_count}
- </Text>
+ <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;