Skip to content

Commit ee18a71

Browse files
committed
Change Static and Dynamic tabs to better match each other
1 parent 5c884b3 commit ee18a71

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

versioned_docs/version-7.x/auth-flow.md

+13-10
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@ const RootStack = createNativeStackNavigator({
8383
},
8484
},
8585
});
86-
// codeblock-focus-end
8786

8887
const Navigation = createStaticNavigation(RootStack);
8988

9089
export default function App() {
9190
return <Navigation />;
9291
}
92+
// codeblock-focus-end
9393

9494
function HomeScreen() {
9595
return <View />;
@@ -124,35 +124,38 @@ import { createNativeStackNavigator } from '@react-navigation/native-stack';
124124

125125
const Stack = createNativeStackNavigator();
126126

127-
const getIsSignedIn = () => {
128-
// custom logic
127+
const useIsSignedIn = () => {
129128
return true;
130129
};
131130

131+
const useIsSignedOut = () => {
132+
return false;
133+
};
134+
135+
// codeblock-focus-start
132136
export default function App() {
133-
const isSignedIn = getIsSignedIn();
137+
const isSignedIn = useIsSignedIn();
134138

135139
return (
136140
<NavigationContainer>
137141
<Stack.Navigator>
138-
// codeblock-focus-start
139142
{isSignedIn ? (
140-
<>
143+
<Stack.Group>
141144
<Stack.Screen name="Home" component={HomeScreen} />
142145
<Stack.Screen name="Profile" component={ProfileScreen} />
143146
<Stack.Screen name="Settings" component={SettingsScreen} />
144-
</>
147+
</Stack.Group>
145148
) : (
146-
<>
149+
<Stack.Group>
147150
<Stack.Screen name="SignIn" component={SignInScreen} />
148151
<Stack.Screen name="SignUp" component={SignUpScreen} />
149-
</>
152+
</Stack.Group>
150153
)}
151-
// codeblock-focus-end
152154
</Stack.Navigator>
153155
</NavigationContainer>
154156
);
155157
}
158+
// codeblock-focus-end
156159

157160
function HomeScreen() {
158161
return <View />;

0 commit comments

Comments
 (0)