From dbbbba1d32cbb96d9ab98eb871f3618df7f6e628 Mon Sep 17 00:00:00 2001
From: dan <dan.abramov@gmail.com>
Date: Fri, 30 Aug 2024 16:54:55 +0100
Subject: [Experiment] Suggest profiles in profile (#5030)

* Rename variable to disambiguate with parent scope

* More variables where they are used

* Inline variables

* Add suggestions in profile

* Gate it

* rm space

* Remove header suggestions under gate
---
 .../Profile/Header/ProfileHeaderStandard.tsx       | 44 ++++++++++++----------
 1 file changed, 24 insertions(+), 20 deletions(-)

(limited to 'src/screens/Profile/Header/ProfileHeaderStandard.tsx')

diff --git a/src/screens/Profile/Header/ProfileHeaderStandard.tsx b/src/screens/Profile/Header/ProfileHeaderStandard.tsx
index 2b6353b27..2036023c3 100644
--- a/src/screens/Profile/Header/ProfileHeaderStandard.tsx
+++ b/src/screens/Profile/Header/ProfileHeaderStandard.tsx
@@ -10,6 +10,7 @@ import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome'
 import {msg, Trans} from '@lingui/macro'
 import {useLingui} from '@lingui/react'
 
+import {useGate} from '#/lib/statsig/statsig'
 import {logger} from '#/logger'
 import {isIOS} from '#/platform/detection'
 import {Shadow} from '#/state/cache/types'
@@ -59,6 +60,7 @@ let ProfileHeaderStandard = ({
   const profile: Shadow<AppBskyActorDefs.ProfileViewDetailed> =
     useProfileShadow(profileUnshadowed)
   const t = useTheme()
+  const gate = useGate()
   const {currentAccount, hasSession} = useSession()
   const {_} = useLingui()
   const {openModal} = useModalControls()
@@ -203,27 +205,29 @@ let ProfileHeaderStandard = ({
               {hasSession && (
                 <>
                   <MessageProfileButton profile={profile} />
-                  <Button
-                    testID="suggestedFollowsBtn"
-                    size="small"
-                    color={showSuggestedFollows ? 'primary' : 'secondary'}
-                    variant="solid"
-                    shape="round"
-                    onPress={() =>
-                      setShowSuggestedFollows(!showSuggestedFollows)
-                    }
-                    label={_(msg`Show follows similar to ${profile.handle}`)}
-                    style={{width: 36, height: 36}}>
-                    <FontAwesomeIcon
-                      icon="user-plus"
-                      style={
-                        showSuggestedFollows
-                          ? {color: t.palette.white}
-                          : t.atoms.text
+                  {!gate('show_follow_suggestions_in_profile') && (
+                    <Button
+                      testID="suggestedFollowsBtn"
+                      size="small"
+                      color={showSuggestedFollows ? 'primary' : 'secondary'}
+                      variant="solid"
+                      shape="round"
+                      onPress={() =>
+                        setShowSuggestedFollows(!showSuggestedFollows)
                       }
-                      size={14}
-                    />
-                  </Button>
+                      label={_(msg`Show follows similar to ${profile.handle}`)}
+                      style={{width: 36, height: 36}}>
+                      <FontAwesomeIcon
+                        icon="user-plus"
+                        style={
+                          showSuggestedFollows
+                            ? {color: t.palette.white}
+                            : t.atoms.text
+                        }
+                        size={14}
+                      />
+                    </Button>
+                  )}
                 </>
               )}
 
-- 
cgit 1.4.1

