Viktoriia vor 5 Monaten
Ursprung
Commit
ec15df7aa9

+ 8 - 6
src/screens/InAppScreens/MessagesScreen/ChatScreen/index.tsx

@@ -1144,12 +1144,14 @@ const ChatScreen = ({ route }: { route: any }) => {
   const renderInputToolbar = (props: any) => (
     <InputToolbar
       {...props}
-      renderActions={() => (
-        <Actions
-          icon={() => <MaterialCommunityIcons name="plus" size={28} color={Colors.DARK_BLUE} />}
-          onPressActionButton={openAttachmentsModal}
-        />
-      )}
+      renderActions={() =>
+        userType === 'normal' ? (
+          <Actions
+            icon={() => <MaterialCommunityIcons name="plus" size={28} color={Colors.DARK_BLUE} />}
+            onPressActionButton={openAttachmentsModal}
+          />
+        ) : null
+      }
       containerStyle={{
         backgroundColor: Colors.FILL_LIGHT
       }}

+ 26 - 14
src/screens/InAppScreens/MessagesScreen/Components/MoreModal.tsx

@@ -200,23 +200,35 @@ const MoreModal = () => {
             </Text>
           </TouchableOpacity>
 
-          <View style={styles.optionsContainer}>
-            <TouchableOpacity style={styles.option} onPress={handleMute}>
-              <Text style={styles.optionText}>{chatData.muted === 1 ? 'Unmute' : 'Mute'}</Text>
-              <BellSlashIcon fill={Colors.DARK_BLUE} />
-            </TouchableOpacity>
-          </View>
+          {chatData?.userType === 'normal' && (
+            <View style={styles.optionsContainer}>
+              <TouchableOpacity style={styles.option} onPress={handleMute}>
+                <Text style={styles.optionText}>{chatData.muted === 1 ? 'Unmute' : 'Mute'}</Text>
+                <BellSlashIcon fill={Colors.DARK_BLUE} />
+              </TouchableOpacity>
+            </View>
+          )}
 
           <View style={[styles.optionsContainer, { paddingVertical: 0, gap: 0 }]}>
-            <TouchableOpacity style={[styles.option, styles.dangerOption]} onPress={handleReport}>
-              <Text style={[styles.optionText, styles.dangerText]}>Report {name}</Text>
-              <MegaphoneIcon fill={Colors.RED} />
-            </TouchableOpacity>
+            {chatData?.userType === 'normal' && (
+              <>
+                <TouchableOpacity
+                  style={[styles.option, styles.dangerOption]}
+                  onPress={handleReport}
+                >
+                  <Text style={[styles.optionText, styles.dangerText]}>Report {name}</Text>
+                  <MegaphoneIcon fill={Colors.RED} />
+                </TouchableOpacity>
 
-            <TouchableOpacity style={[styles.option, styles.dangerOption]} onPress={handleBlock}>
-              <Text style={[styles.optionText, styles.dangerText]}>Block {name}</Text>
-              <BanIcon fill={Colors.RED} />
-            </TouchableOpacity>
+                <TouchableOpacity
+                  style={[styles.option, styles.dangerOption]}
+                  onPress={handleBlock}
+                >
+                  <Text style={[styles.optionText, styles.dangerText]}>Block {name}</Text>
+                  <BanIcon fill={Colors.RED} />
+                </TouchableOpacity>
+              </>
+            )}
 
             <TouchableOpacity style={[styles.option, styles.dangerOption]} onPress={handleDelete}>
               <Text style={[styles.optionText, styles.dangerText]}>Delete chat</Text>