aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-06-08 16:52:05 -0400
committerIvan Chen <ivan@tagg.id>2021-06-08 16:52:05 -0400
commit6837eac533bdf39013bde22ab8df2eb687a06a2e (patch)
tree304cd93c85755149825244245ea40d69c4e0e5d8 /src
parent7de499af625b28074e86854b997e66257ffab8c8 (diff)
Move things around, Add logic to disable button
Diffstat (limited to 'src')
-rw-r--r--src/components/comments/AddComment.tsx10
-rw-r--r--src/components/moments/MomentPostContent.tsx16
2 files changed, 17 insertions, 9 deletions
diff --git a/src/components/comments/AddComment.tsx b/src/components/comments/AddComment.tsx
index 24ff830a..12fd7e4d 100644
--- a/src/components/comments/AddComment.tsx
+++ b/src/components/comments/AddComment.tsx
@@ -133,7 +133,12 @@ const AddComment: React.FC<AddCommentProps> = ({
{(theme === 'white' || (theme === 'dark' && keyboardVisible)) && (
<View style={styles.submitButton}>
<TouchableOpacity
- style={styles.submitButton}
+ style={
+ comment === ''
+ ? [styles.submitButton, styles.greyButton]
+ : styles.submitButton
+ }
+ disabled={comment === ''}
onPress={addComment}>
<UpArrowIcon width={35} height={35} color={'white'} />
</TouchableOpacity>
@@ -190,6 +195,9 @@ const styles = StyleSheet.create({
marginVertical: '2%',
alignSelf: 'flex-end',
},
+ greyButton: {
+ backgroundColor: 'grey',
+ },
whiteBackround: {
backgroundColor: '#fff',
},
diff --git a/src/components/moments/MomentPostContent.tsx b/src/components/moments/MomentPostContent.tsx
index e76a8ceb..582cba25 100644
--- a/src/components/moments/MomentPostContent.tsx
+++ b/src/components/moments/MomentPostContent.tsx
@@ -88,14 +88,6 @@ const MomentPostContent: React.FC<MomentPostContentProps> = ({
/>
</Animated.View>
)}
- <View style={styles.footerContainer}>
- <CommentsCount
- commentsCount={moment.comments_count.toString()}
- momentId={moment.moment_id}
- screenType={screenType}
- />
- <Text style={styles.text}>{elapsedTime}</Text>
- </View>
{moment.caption !== '' &&
renderTextWithMentions({
value: moment.caption,
@@ -104,6 +96,14 @@ const MomentPostContent: React.FC<MomentPostContentProps> = ({
onPress: (user: UserType) =>
navigateToProfile(state, dispatch, navigation, screenType, user),
})}
+ <View style={styles.footerContainer}>
+ <CommentsCount
+ commentsCount={moment.comments_count.toString()}
+ momentId={moment.moment_id}
+ screenType={screenType}
+ />
+ <Text style={styles.text}>{elapsedTime}</Text>
+ </View>
<AddComment
placeholderText={'Add a comment here!'}
momentId={moment.moment_id}