about summary refs log tree commit diff
path: root/src/view/com/profile/ProfileHeader.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/view/com/profile/ProfileHeader.tsx')
-rw-r--r--src/view/com/profile/ProfileHeader.tsx39
1 files changed, 36 insertions, 3 deletions
diff --git a/src/view/com/profile/ProfileHeader.tsx b/src/view/com/profile/ProfileHeader.tsx
index 32fe86909..5f0fb6fe2 100644
--- a/src/view/com/profile/ProfileHeader.tsx
+++ b/src/view/com/profile/ProfileHeader.tsx
@@ -89,6 +89,24 @@ export const ProfileHeader = observer(function ProfileHeader({
     }
     onRefreshAll()
   }
+  const onPressMuteAccount = async () => {
+    try {
+      await view.muteAccount()
+      Toast.show('Account muted')
+    } catch (e: any) {
+      console.error(e)
+      Toast.show(`There was an issue! ${e.toString()}`)
+    }
+  }
+  const onPressUnmuteAccount = async () => {
+    try {
+      await view.unmuteAccount()
+      Toast.show('Account unmuted')
+    } catch (e: any) {
+      console.error(e)
+      Toast.show(`There was an issue! ${e.toString()}`)
+    }
+  }
   const onPressReportAccount = () => {
     store.shell.openModal(new ReportAccountModal(view.did))
   }
@@ -144,6 +162,10 @@ export const ProfileHeader = observer(function ProfileHeader({
   if (!isMe) {
     dropdownItems = dropdownItems || []
     dropdownItems.push({
+      label: view.myState.muted ? 'Unmute Account' : 'Mute Account',
+      onPress: view.myState.muted ? onPressUnmuteAccount : onPressMuteAccount,
+    })
+    dropdownItems.push({
       label: 'Report Account',
       onPress: onPressReportAccount,
     })
@@ -286,7 +308,7 @@ export const ProfileHeader = observer(function ProfileHeader({
           />
         ) : undefined}
         {view.isScene && view.creator ? (
-          <View style={styles.relationshipsLine}>
+          <View style={styles.detailLine}>
             <FontAwesomeIcon
               icon={['far', 'user']}
               style={[pal.textLight, s.mr5]}
@@ -304,7 +326,7 @@ export const ProfileHeader = observer(function ProfileHeader({
           </View>
         ) : undefined}
         {view.isScene && view.myState.member ? (
-          <View style={styles.relationshipsLine}>
+          <View style={styles.detailLine}>
             <FontAwesomeIcon
               icon={['far', 'circle-check']}
               style={[pal.textLight, s.mr5]}
@@ -314,6 +336,17 @@ export const ProfileHeader = observer(function ProfileHeader({
             </Text>
           </View>
         ) : undefined}
+        {view.myState.muted ? (
+          <View style={[styles.detailLine, pal.btn, s.p5]}>
+            <FontAwesomeIcon
+              icon={['far', 'eye-slash']}
+              style={[pal.text, s.mr5]}
+            />
+            <Text type="body2" style={[s.mr2, pal.text]}>
+              Account muted.
+            </Text>
+          </View>
+        ) : undefined}
       </View>
       {view.isScene && view.creator === store.me.did ? (
         <View style={[styles.sceneAdminContainer, pal.border]}>
@@ -421,7 +454,7 @@ const styles = StyleSheet.create({
     marginBottom: 8,
   },
 
-  relationshipsLine: {
+  detailLine: {
     flexDirection: 'row',
     alignItems: 'center',
     marginBottom: 5,