Skip to content

Commit 4bdb860

Browse files
committed
Add Commerce route and update navigation: define Commerce route in constants, add associated icon, and update URL handling in IterableAppProvider
1 parent 5478edc commit 4bdb860

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Route } from '../../constants';
22

33
export const routeIcon = {
4+
[Route.Commerce]: 'cash-outline',
45
[Route.Inbox]: 'mail-outline',
56
[Route.User]: 'person-outline',
67
};

example/src/constants/routes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export enum Route {
2+
Commerce = 'Commerce',
23
Inbox = 'Inbox',
34
Login = 'Login',
45
Main = 'Main',

example/src/hooks/useIterableApp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export const IterableAppProvider: FunctionComponent<
125125
config.inAppDisplayInterval = 1.0; // Min gap between in-apps. No need to set this in production.
126126

127127
config.urlHandler = (url: string) => {
128-
const routeNames = [Route.Inbox, Route.User];
128+
const routeNames = [Route.Commerce, Route.Inbox, Route.User];
129129
for (const route of routeNames) {
130130
if (url.includes(route.toLowerCase())) {
131131
// TODO: Figure out typing for this

example/src/types/navigation.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ import type { StackScreenProps } from '@react-navigation/stack';
88
import { Route } from '../constants/routes';
99

1010
export type MainScreenParamList = {
11+
[Route.Commerce]: undefined;
1112
[Route.Inbox]: undefined;
1213
[Route.User]: undefined;
1314
};
1415

1516
export type RootStackParamList = {
16-
[Route.Main]: NavigatorScreenParams<MainScreenParamList>;
1717
[Route.Login]: undefined;
18+
[Route.Main]: NavigatorScreenParams<MainScreenParamList>;
1819
};
1920

2021
export type MainScreenProps<T extends keyof MainScreenParamList> =

0 commit comments

Comments
 (0)