Ship activation experiments (#9170)
* ship onboarding experiments * delete logged out cta * delete other loggedoutcta
This commit is contained in:
@@ -1,82 +0,0 @@
|
||||
import {View, type ViewStyle} from 'react-native'
|
||||
import {msg, Trans} from '@lingui/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
|
||||
import {type Gate} from '#/lib/statsig/gates'
|
||||
import {useGate} from '#/lib/statsig/statsig'
|
||||
import {isWeb} from '#/platform/detection'
|
||||
import {useSession} from '#/state/session'
|
||||
import {useLoggedOutViewControls} from '#/state/shell/logged-out'
|
||||
import {Logo} from '#/view/icons/Logo'
|
||||
import {atoms as a, useTheme} from '#/alf'
|
||||
import {Button, ButtonText} from '#/components/Button'
|
||||
import {Text} from '#/components/Typography'
|
||||
|
||||
interface LoggedOutCTAProps {
|
||||
style?: ViewStyle
|
||||
gateName: Gate
|
||||
}
|
||||
|
||||
export function LoggedOutCTA({style, gateName}: LoggedOutCTAProps) {
|
||||
const {hasSession} = useSession()
|
||||
const {requestSwitchToAccount} = useLoggedOutViewControls()
|
||||
const gate = useGate()
|
||||
const t = useTheme()
|
||||
const {_} = useLingui()
|
||||
|
||||
// Only show for logged-out users on web
|
||||
if (hasSession || !isWeb) {
|
||||
return null
|
||||
}
|
||||
|
||||
// Check gate at the last possible moment to avoid counting users as exposed when they won't see the element
|
||||
if (!gate(gateName)) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<View style={[a.pb_md, style]}>
|
||||
<View
|
||||
style={[
|
||||
a.flex_row,
|
||||
a.align_center,
|
||||
a.justify_between,
|
||||
a.px_lg,
|
||||
a.py_md,
|
||||
a.rounded_md,
|
||||
a.mb_xs,
|
||||
t.atoms.bg_contrast_25,
|
||||
]}>
|
||||
<View style={[a.flex_row, a.align_center, a.flex_1, a.pr_md]}>
|
||||
<Logo width={30} style={[a.mr_md]} />
|
||||
<View style={[a.flex_1]}>
|
||||
<Text style={[a.text_lg, a.font_semi_bold, a.leading_snug]}>
|
||||
<Trans>Join Bluesky</Trans>
|
||||
</Text>
|
||||
<Text
|
||||
style={[
|
||||
a.text_md,
|
||||
a.font_medium,
|
||||
a.leading_snug,
|
||||
t.atoms.text_contrast_medium,
|
||||
]}>
|
||||
<Trans>The open social network.</Trans>
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
<Button
|
||||
onPress={() => {
|
||||
requestSwitchToAccount({requestedAccount: 'new'})
|
||||
}}
|
||||
label={_(msg`Create account`)}
|
||||
size="small"
|
||||
variant="solid"
|
||||
color="primary">
|
||||
<ButtonText>
|
||||
<Trans>Create account</Trans>
|
||||
</ButtonText>
|
||||
</Button>
|
||||
</View>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
@@ -1,8 +1,6 @@
|
||||
export type Gate =
|
||||
// Keep this alphabetic please.
|
||||
| 'alt_share_icon'
|
||||
| 'cta_above_post_heading'
|
||||
| 'cta_above_post_replies'
|
||||
| 'debug_show_feedcontext'
|
||||
| 'debug_subscriptions'
|
||||
| 'disable_onboarding_policy_update_notice'
|
||||
@@ -10,8 +8,6 @@ export type Gate =
|
||||
| 'feed_reply_button_open_thread'
|
||||
| 'old_postonboarding'
|
||||
| 'onboarding_add_video_feed'
|
||||
| 'onboarding_suggested_accounts'
|
||||
| 'onboarding_value_prop'
|
||||
| 'post_follow_profile_suggested_accounts'
|
||||
| 'remove_show_latest_button'
|
||||
| 'test_gate_1'
|
||||
|
||||
@@ -2,7 +2,6 @@ import {useMemo, useReducer} from 'react'
|
||||
import {msg} from '@lingui/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
|
||||
import {useGate} from '#/lib/statsig/statsig'
|
||||
import {
|
||||
Layout,
|
||||
OnboardingControls,
|
||||
@@ -13,21 +12,19 @@ import {StepFinished} from '#/screens/Onboarding/StepFinished'
|
||||
import {StepInterests} from '#/screens/Onboarding/StepInterests'
|
||||
import {StepProfile} from '#/screens/Onboarding/StepProfile'
|
||||
import {Portal} from '#/components/Portal'
|
||||
import {ENV} from '#/env'
|
||||
import {StepSuggestedAccounts} from './StepSuggestedAccounts'
|
||||
|
||||
export function Onboarding() {
|
||||
const {_} = useLingui()
|
||||
const gate = useGate()
|
||||
const showValueProp = ENV !== 'e2e' && gate('onboarding_value_prop')
|
||||
const showSuggestedAccounts =
|
||||
ENV !== 'e2e' && gate('onboarding_suggested_accounts')
|
||||
|
||||
const [state, dispatch] = useReducer(reducer, {
|
||||
...initialState,
|
||||
totalSteps: showSuggestedAccounts ? 4 : 3,
|
||||
totalSteps: 4,
|
||||
experiments: {
|
||||
onboarding_suggested_accounts: showSuggestedAccounts,
|
||||
onboarding_value_prop: showValueProp,
|
||||
// let's leave this flag logic in for now to avoid rebase churn
|
||||
// TODO: remove this flag logic once we've finished with all experiments -sfn
|
||||
onboarding_suggested_accounts: true,
|
||||
onboarding_value_prop: true,
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
@@ -39,13 +39,12 @@ import {
|
||||
OUTER_SPACE,
|
||||
REPLY_LINE_WIDTH,
|
||||
} from '#/screens/PostThread/const'
|
||||
import {atoms as a, useBreakpoints, useTheme} from '#/alf'
|
||||
import {atoms as a, useTheme} from '#/alf'
|
||||
import {colors} from '#/components/Admonition'
|
||||
import {Button} from '#/components/Button'
|
||||
import {CalendarClock_Stroke2_Corner0_Rounded as CalendarClockIcon} from '#/components/icons/CalendarClock'
|
||||
import {Trash_Stroke2_Corner0_Rounded as TrashIcon} from '#/components/icons/Trash'
|
||||
import {InlineLinkText, Link} from '#/components/Link'
|
||||
import {LoggedOutCTA} from '#/components/LoggedOutCTA'
|
||||
import {ContentHider} from '#/components/moderation/ContentHider'
|
||||
import {LabelsOnMyPost} from '#/components/moderation/LabelsOnMe'
|
||||
import {PostAlerts} from '#/components/moderation/PostAlerts'
|
||||
@@ -180,7 +179,6 @@ const ThreadItemAnchorInner = memo(function ThreadItemAnchorInner({
|
||||
const {_} = useLingui()
|
||||
const {openComposer} = useOpenComposer()
|
||||
const {currentAccount, hasSession} = useSession()
|
||||
const {gtTablet} = useBreakpoints()
|
||||
const feedFeedback = useFeedFeedback(postSource?.feedSourceInfo, hasSession)
|
||||
const formatPostStatCount = useFormatPostStatCount()
|
||||
|
||||
@@ -315,8 +313,6 @@ const ThreadItemAnchorInner = memo(function ThreadItemAnchorInner({
|
||||
},
|
||||
isRoot && [a.pt_lg],
|
||||
]}>
|
||||
{/* Show CTA for logged-out visitors - hide on desktop and check gate */}
|
||||
{!gtTablet && <LoggedOutCTA gateName="cta_above_post_heading" />}
|
||||
<View style={[a.flex_row, a.gap_md, a.pb_md]}>
|
||||
<View collapsable={false}>
|
||||
<PreviewableUserAvatar
|
||||
|
||||
@@ -38,7 +38,6 @@ import {
|
||||
import {atoms as a, native, platform, useBreakpoints, web} from '#/alf'
|
||||
import * as Layout from '#/components/Layout'
|
||||
import {ListFooter} from '#/components/Lists'
|
||||
import {LoggedOutCTA} from '#/components/LoggedOutCTA'
|
||||
|
||||
const PARENT_CHUNK_SIZE = 5
|
||||
const CHILDREN_CHUNK_SIZE = 50
|
||||
@@ -410,8 +409,6 @@ export function PostThread({uri}: {uri: string}) {
|
||||
onPostSuccess={optimisticOnPostReply}
|
||||
postSource={anchorPostSource}
|
||||
/>
|
||||
{/* Show CTA for logged-out visitors */}
|
||||
<LoggedOutCTA style={a.px_lg} gateName="cta_above_post_replies" />
|
||||
</View>
|
||||
)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user