aboutsummaryrefslogtreecommitdiff
path: root/src/components/comments/CommentTile.tsx
diff options
context:
space:
mode:
authorAshm Walia <ashmwalia@outlook.com>2021-01-29 10:55:14 -0800
committerAshm Walia <ashmwalia@outlook.com>2021-01-29 10:55:14 -0800
commit0e86cd3c972e54cf700cca65bb2493e84056276c (patch)
tree7d655845fd577107ff68c0d146fbdb2dca45659a /src/components/comments/CommentTile.tsx
parent2c36dcff257de81438500eccf61a3f9a968331ce (diff)
kind of works
Diffstat (limited to 'src/components/comments/CommentTile.tsx')
-rw-r--r--src/components/comments/CommentTile.tsx27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/components/comments/CommentTile.tsx b/src/components/comments/CommentTile.tsx
index b631a985..347954b5 100644
--- a/src/components/comments/CommentTile.tsx
+++ b/src/components/comments/CommentTile.tsx
@@ -6,7 +6,12 @@ import {Alert, Animated, StyleSheet} from 'react-native';
import ClockIcon from '../../assets/icons/clock-icon-01.svg';
import {TAGG_LIGHT_BLUE} from '../../constants';
import {RectButton, TouchableOpacity} from 'react-native-gesture-handler';
-import {getTimePosted, normalize, SCREEN_WIDTH} from '../../utils';
+import {
+ getTimePosted,
+ normalize,
+ SCREEN_HEIGHT,
+ SCREEN_WIDTH,
+} from '../../utils';
import Arrow from '../../assets/icons/back-arrow-colored.svg';
import Trash from '../../assets/ionicons/trash-outline.svg';
import CommentsContainer from './CommentsContainer';
@@ -155,14 +160,16 @@ const CommentTile: React.FC<CommentTileProps> = ({
</View>
{/*** Show replies if toggle state is true */}
- {showReplies && (
- <CommentsContainer
- objectId={comment_object.comment_id}
- screenType={screenType}
- setNewCommentsAvailable={setNewThreadAvailable}
- newCommentsAvailable={newThreadAvailable}
- typeOfComment={'Thread'}
- />
+ {showReplies && comment_object.replies_count > 0 && (
+ <View style={{height: SCREEN_HEIGHT / 2.4}}>
+ <CommentsContainer
+ objectId={comment_object.comment_id}
+ screenType={screenType}
+ setNewCommentsAvailable={setNewThreadAvailable}
+ newCommentsAvailable={newThreadAvailable}
+ typeOfComment={'Thread'}
+ />
+ </View>
)}
</Swipeable>
);
@@ -173,9 +180,9 @@ const styles = StyleSheet.create({
borderBottomWidth: 1,
borderColor: 'lightgray',
backgroundColor: 'white',
- paddingTop: '3%',
flexDirection: 'column',
flex: 1,
+ paddingTop: '3%',
marginLeft: '7%',
},
swipeActions: {