Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove native_pwi_disabled (#4896)

* Remove native_pwi_disabled

* Remove search button

authored by

Eric Bailey and committed by
GitHub
3ea8eb60 e7a0055a

+3 -57
-1
src/lib/statsig/gates.ts
··· 1 1 export type Gate = 2 2 // Keep this alphabetic please. 3 3 | 'debug_show_feedcontext' 4 - | 'native_pwi_disabled' 5 4 | 'new_user_guided_tour' 6 5 | 'onboarding_minimum_interests' 7 6 | 'session_withproxy_fix'
+2 -48
src/view/com/auth/LoggedOut.tsx
··· 1 1 import React from 'react' 2 2 import {Pressable, View} from 'react-native' 3 3 import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' 4 - import {msg, Trans} from '@lingui/macro' 4 + import {msg} from '@lingui/macro' 5 5 import {useLingui} from '@lingui/react' 6 - import {useNavigation} from '@react-navigation/native' 7 6 8 7 import {useAnalytics} from '#/lib/analytics/analytics' 9 8 import {usePalette} from '#/lib/hooks/usePalette' 10 9 import {logEvent} from '#/lib/statsig/statsig' 11 10 import {s} from '#/lib/styles' 12 - import {isIOS, isNative} from '#/platform/detection' 13 - import {useSession} from '#/state/session' 11 + import {isIOS} from '#/platform/detection' 14 12 import { 15 13 useLoggedOutView, 16 14 useLoggedOutViewControls, 17 15 } from '#/state/shell/logged-out' 18 16 import {useSetMinimalShellMode} from '#/state/shell/minimal-mode' 19 - import {NavigationProp} from 'lib/routes/types' 20 - import {useGate} from 'lib/statsig/statsig' 21 17 import {ErrorBoundary} from '#/view/com/util/ErrorBoundary' 22 - import {Text} from '#/view/com/util/text/Text' 23 18 import {Login} from '#/screens/Login' 24 19 import {Signup} from '#/screens/Signup' 25 20 import {LandingScreen} from '#/screens/StarterPack/StarterPackLandingScreen' ··· 34 29 export {ScreenState as LoggedOutScreenState} 35 30 36 31 export function LoggedOut({onDismiss}: {onDismiss?: () => void}) { 37 - const {hasSession} = useSession() 38 32 const {_} = useLingui() 39 33 const pal = usePalette('default') 40 34 const setMinimalShellMode = useSetMinimalShellMode() ··· 52 46 } 53 47 }) 54 48 const {clearRequestedAccount} = useLoggedOutViewControls() 55 - const navigation = useNavigation<NavigationProp>() 56 - const gate = useGate() 57 49 58 - const isFirstScreen = screenState === ScreenState.S_LoginOrCreateAccount 59 50 React.useEffect(() => { 60 51 screen('Login') 61 52 setMinimalShellMode(true) ··· 68 59 clearRequestedAccount() 69 60 }, [clearRequestedAccount, onDismiss]) 70 61 71 - const onPressSearch = React.useCallback(() => { 72 - navigation.navigate(`SearchTab`) 73 - }, [navigation]) 74 - 75 62 return ( 76 63 <View testID="noSessionView" style={[s.hContentRegion, pal.view]}> 77 64 <ErrorBoundary> ··· 95 82 size={12} 96 83 style={{ 97 84 color: String(pal.textInverted.color), 98 - }} 99 - /> 100 - </Pressable> 101 - ) : isNative && 102 - !hasSession && 103 - isFirstScreen && 104 - !gate('native_pwi_disabled') ? ( 105 - <Pressable 106 - accessibilityHint={_(msg`Search for users`)} 107 - accessibilityLabel={_(msg`Search for users`)} 108 - accessibilityRole="button" 109 - style={{ 110 - flexDirection: 'row', 111 - alignItems: 'center', 112 - gap: 4, 113 - position: 'absolute', 114 - top: 20, 115 - right: 20, 116 - paddingHorizontal: 16, 117 - paddingVertical: 8, 118 - zIndex: 100, 119 - backgroundColor: pal.btn.backgroundColor, 120 - borderRadius: 100, 121 - }} 122 - onPress={onPressSearch}> 123 - <Text type="lg-bold" style={[pal.text]}> 124 - <Trans>Search</Trans>{' '} 125 - </Text> 126 - <FontAwesomeIcon 127 - icon="search" 128 - size={16} 129 - style={{ 130 - color: String(pal.text.color), 131 85 }} 132 86 /> 133 87 </Pressable>
+1 -8
src/view/shell/createNativeStackNavigatorWithAuth.tsx
··· 29 29 useLoggedOutView, 30 30 useLoggedOutViewControls, 31 31 } from '#/state/shell/logged-out' 32 - import {useGate} from 'lib/statsig/statsig' 33 32 import {isNative, isWeb} from 'platform/detection' 34 33 import {Deactivated} from '#/screens/Deactivated' 35 34 import {Onboarding} from '#/screens/Onboarding' ··· 51 50 screenOptions, 52 51 ...rest 53 52 }: NativeStackNavigatorProps) { 54 - const gate = useGate() 55 53 // --- this is copy and pasted from the original native stack navigator --- 56 54 const {state, descriptors, navigation, NavigationContent} = 57 55 useNavigationBuilder< ··· 102 100 const {showLoggedOut} = useLoggedOutView() 103 101 const {setShowLoggedOut} = useLoggedOutViewControls() 104 102 const {isMobile, isTabletOrMobile} = useWebMediaQueries() 105 - if ( 106 - !hasSession && 107 - (!PWI_ENABLED || 108 - activeRouteRequiresAuth || 109 - (isNative && gate('native_pwi_disabled'))) 110 - ) { 103 + if (!hasSession && (!PWI_ENABLED || activeRouteRequiresAuth || isNative)) { 111 104 return <LoggedOut /> 112 105 } 113 106 if (hasSession && currentAccount?.signupQueued) {