about summary refs log tree commit diff
path: root/src/screens/Profile/Header/ProfileHeaderStandard.tsx
diff options
context:
space:
mode:
authordan <dan.abramov@gmail.com>2024-08-30 16:54:55 +0100
committerGitHub <noreply@github.com>2024-08-30 16:54:55 +0100
commitdbbbba1d32cbb96d9ab98eb871f3618df7f6e628 (patch)
treeef999f211aaa767d8d847c21b08b3cccf340ec2b /src/screens/Profile/Header/ProfileHeaderStandard.tsx
parent46b7193a2b8f1a9e804644016692da39e4519458 (diff)
downloadvoidsky-dbbbba1d32cbb96d9ab98eb871f3618df7f6e628.tar.zst
[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
Diffstat (limited to 'src/screens/Profile/Header/ProfileHeaderStandard.tsx')
-rw-r--r--src/screens/Profile/Header/ProfileHeaderStandard.tsx44
1 files changed, 24 insertions, 20 deletions
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>
+                  )}
                 </>
               )}