Skip to content

Commit

Permalink
Add home utility route
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuuszzzzz committed Jan 3, 2024
1 parent 84fef78 commit 83c002e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ function getUrlWithBackToParam<TUrl extends string>(url: TUrl, backTo?: string):
}

const ROUTES = {
HOME: '',
HOME_ROOT: '',
// This is a utility route to allow navigating to the home screen explicitly
HOME: 'home',

ALL_SETTINGS: 'all-settings',

Expand Down
1 change: 1 addition & 0 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import DeepValueOf from './types/utils/DeepValueOf';

const PROTECTED_SCREENS = {
HOME: 'Home',
HOME_ROOT: 'HomeRoot',
CONCIERGE: 'Concierge',
REPORT_ATTACHMENTS: 'ReportAttachments',
} as const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ function BottomTabNavigator() {
<Tab.Screen
name={SCREENS.HOME}
component={SidebarScreen}
/>
<Tab.Screen
name={SCREENS.HOME_ROOT}
component={SidebarScreen}
/>
<Tab.Screen
name={SCREENS.ALL_SETTINGS}
Expand Down
1 change: 1 addition & 0 deletions src/libs/Navigation/linkingConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ const linkingConfig: LinkingOptions<RootStackParamList> = {
initialRouteName: SCREENS.HOME,
screens: {
[SCREENS.HOME]: ROUTES.HOME,
[SCREENS.HOME_ROOT]: ROUTES.HOME_ROOT,
[SCREENS.ALL_SETTINGS]: ROUTES.ALL_SETTINGS,
[SCREENS.WORKSPACE.INITIAL]: {
path: ROUTES.WORKSPACE_INITIAL.route,
Expand Down
1 change: 1 addition & 0 deletions src/libs/Navigation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ type FullScreenNavigatorParamList = {

type BottomTabNavigatorParamList = {
[SCREENS.HOME]: undefined;
[SCREENS.HOME_ROOT]: undefined;
[SCREENS.ALL_SETTINGS]: undefined;
[SCREENS.WORKSPACE.INITIAL]: undefined;
};
Expand Down

0 comments on commit 83c002e

Please sign in to comment.