Skip to content

Commit

Permalink
routing doc update
Browse files Browse the repository at this point in the history
  • Loading branch information
manojleaton committed May 3, 2024
1 parent 8281475 commit a0133d1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
20 changes: 19 additions & 1 deletion login-workflow/docs/routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,25 @@ While this workflow library will work with different routing providers, we gener

Because this workflow package is router-agnostic, you will be required to set up your routing solution and configure which of the workflow screens will appear on each of your routes.

The Workflow support only Portrait mode in mobile devices and should be used only in Portrait mode
The Workflow support only Portrait mode in mobile devices and should be used only in Portrait mode. We have locked the workflow to support only in Portrait mode, because when soft keyboard gets open in Landscape mode text input is getting pushed under the header.

<img width="400" alt="Account Details" src="../media/landscape-mode.png">

We need to pass logic to `orientation` attribute which is present inside `screenOptions` prop of `Stack.Navigator`.

```tsx
<NavigationContainer ref={navigationRef}>
<Stack.Navigator
initialRouteName={'AuthProviderExample'}
screenOptions={{
headerShown: false,
orientation: width >= 768 && height >= 768 ? 'all' : 'portrait',
}}
>
<Stack.Screen name="AuthProviderExample" component={AuthRouter} />
</Stack.Navigator>
</NavigationContainer>
```

### Authentication

Expand Down
5 changes: 3 additions & 2 deletions login-workflow/example/src/navigation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
import i18nAppInstance from '../../translations/i18n';
import { NavigationDrawer } from './navigation-drawer';
import { createDrawerNavigator } from '@react-navigation/drawer';
import { createStackNavigator } from '@react-navigation/stack';
import { Dimensions, View } from 'react-native';

import { ProjectAuthUIActions } from '../actions/AuthUIActions';
Expand Down Expand Up @@ -48,6 +47,7 @@ const AuthRouter = (): any => {
const app = useApp();
const { email, rememberMe } = app.loginData;
const navigation = useNavigation<NativeStackNavigationProp<any>>();

return (
<>
<AuthContextProvider
Expand Down Expand Up @@ -146,7 +146,8 @@ const AuthRouter = (): any => {
const RegistrationRouter = (): any => {
const app = useApp();
const navigation = useNavigation<NativeStackNavigationProp<any>>();
const RegistrationStack = createStackNavigator();
const RegistrationStack = createNativeStackNavigator();

return (
<>
<RegistrationContextProvider
Expand Down
Binary file added login-workflow/media/landscape-mode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a0133d1

Please sign in to comment.