From 6837eac533bdf39013bde22ab8df2eb687a06a2e Mon Sep 17 00:00:00 2001
From: Ivan Chen <ivan@tagg.id>
Date: Tue, 8 Jun 2021 16:52:05 -0400
Subject: Move things around, Add logic to disable button

---
 src/components/comments/AddComment.tsx | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

(limited to 'src/components/comments/AddComment.tsx')

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',
   },
-- 
cgit v1.2.3-70-g09d2

