diff options
author | Ivan Chen <ivan@tagg.id> | 2021-06-08 16:52:05 -0400 |
---|---|---|
committer | Ivan Chen <ivan@tagg.id> | 2021-06-08 16:52:05 -0400 |
commit | 6837eac533bdf39013bde22ab8df2eb687a06a2e (patch) | |
tree | 304cd93c85755149825244245ea40d69c4e0e5d8 /src/components/comments | |
parent | 7de499af625b28074e86854b997e66257ffab8c8 (diff) |
Move things around, Add logic to disable button
Diffstat (limited to 'src/components/comments')
-rw-r--r-- | src/components/comments/AddComment.tsx | 10 |
1 files changed, 9 insertions, 1 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', }, |