From acd7211b357f2bfc74bf0828994e12f0c41d39d5 Mon Sep 17 00:00:00 2001 From: Alex Benzer Date: Tue, 26 Aug 2025 08:52:38 -0700 Subject: Adds signup CTA tests for logged-out visitors (#8906) --- src/components/LoggedOutCTA.tsx | 80 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 src/components/LoggedOutCTA.tsx (limited to 'src/components') diff --git a/src/components/LoggedOutCTA.tsx b/src/components/LoggedOutCTA.tsx new file mode 100644 index 000000000..7ec8c2264 --- /dev/null +++ b/src/components/LoggedOutCTA.tsx @@ -0,0 +1,80 @@ +import {View, type ViewStyle} from 'react-native' +import {Trans} from '@lingui/macro' + +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() + + // 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 ( + + + + + + + Join Bluesky + + + The open social network. + + + + + + + ) +} -- cgit 1.4.1