From 7de499af625b28074e86854b997e66257ffab8c8 Mon Sep 17 00:00:00 2001
From: Ivan Chen <ivan@tagg.id>
Date: Tue, 8 Jun 2021 16:18:30 -0400
Subject: Adjust styling

---
 src/components/comments/AddComment.tsx | 34 ++++++++++++++++++++++++----------
 1 file changed, 24 insertions(+), 10 deletions(-)

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

diff --git a/src/components/comments/AddComment.tsx b/src/components/comments/AddComment.tsx
index b229d010..24ff830a 100644
--- a/src/components/comments/AddComment.tsx
+++ b/src/components/comments/AddComment.tsx
@@ -24,10 +24,15 @@ import {MentionInputControlled} from './MentionInputControlled';
 export interface AddCommentProps {
   momentId: string;
   placeholderText: string;
+  theme?: 'dark' | 'white';
 }
 
-const AddComment: React.FC<AddCommentProps> = ({momentId, placeholderText}) => {
-  const {setShouldUpdateAllComments, commentTapped} =
+const AddComment: React.FC<AddCommentProps> = ({
+  momentId,
+  placeholderText,
+  theme = 'white',
+}) => {
+  const {setShouldUpdateAllComments = () => null, commentTapped} =
     useContext(CommentContext);
   const [inReplyToMention, setInReplyToMention] = useState('');
   const [comment, setComment] = useState('');
@@ -106,13 +111,14 @@ const AddComment: React.FC<AddCommentProps> = ({momentId, placeholderText}) => {
       keyboardVerticalOffset={SCREEN_HEIGHT * 0.1}>
       <View
         style={[
-          styles.container,
-          keyboardVisible ? styles.whiteBackround : {},
+          theme === 'white' ? styles.containerWhite : styles.containerDark,
+          keyboardVisible && theme !== 'dark' ? styles.whiteBackround : {},
         ]}>
         <View style={styles.textContainer}>
           <Avatar style={styles.avatar} uri={avatar} />
           <MentionInputControlled
             containerStyle={styles.text}
+            placeholderTextColor={theme === 'dark' ? '#828282' : undefined}
             placeholder={placeholderText}
             value={inReplyToMention + comment}
             onChange={(newText: string) => {
@@ -124,11 +130,15 @@ const AddComment: React.FC<AddCommentProps> = ({momentId, placeholderText}) => {
             inputRef={ref}
             partTypes={mentionPartTypes('blue')}
           />
-          <View style={styles.submitButton}>
-            <TouchableOpacity style={styles.submitButton} onPress={addComment}>
-              <UpArrowIcon width={35} height={35} color={'white'} />
-            </TouchableOpacity>
-          </View>
+          {(theme === 'white' || (theme === 'dark' && keyboardVisible)) && (
+            <View style={styles.submitButton}>
+              <TouchableOpacity
+                style={styles.submitButton}
+                onPress={addComment}>
+                <UpArrowIcon width={35} height={35} color={'white'} />
+              </TouchableOpacity>
+            </View>
+          )}
         </View>
       </View>
     </KeyboardAvoidingView>
@@ -136,7 +146,11 @@ const AddComment: React.FC<AddCommentProps> = ({momentId, placeholderText}) => {
 };
 
 const styles = StyleSheet.create({
-  container: {
+  containerDark: {
+    alignItems: 'center',
+    width: SCREEN_WIDTH,
+  },
+  containerWhite: {
     backgroundColor: '#f7f7f7',
     alignItems: 'center',
     width: SCREEN_WIDTH,
-- 
cgit v1.2.3-70-g09d2

