Skip to content

Commit

Permalink
fix(HQM-376): Update new navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
devkudasov committed May 6, 2024
1 parent be479fa commit b2a5765
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
4 changes: 1 addition & 3 deletions src/components/popup/dismiss-popup-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ export const DismissPopupButton = () => {
style={page.container}
testID="dismissPopupButton"
onPress={() => {
try {
navigation.pop();
} catch (e) {
if (navigation.canGoBack()) {
navigation.goBack();
}
}}>
Expand Down
14 changes: 8 additions & 6 deletions src/event-actions/on-push-notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,15 @@ export async function onPushNotification(message: RemoteMessage<Data>) {

VariablesBool.set('isNewNews', true);
}

navigator.navigate(NewsStackRoutes.NewsDetail, {
id: message.data.id,
navigator.navigate('homeNews', {
// @ts-ignore
openEvent: MarketingEvents.newsOpenPushItem,
linkEvent: MarketingEvents.newsOpenPushLink,
scrollEvent: MarketingEvents.newsScrolledPushItem,
screen: NewsStackRoutes.NewsDetail,
params: {
id: id,
openEvent: MarketingEvents.newsOpenPushItem,
linkEvent: MarketingEvents.newsOpenPushLink,
scrollEvent: MarketingEvents.newsScrolledPushItem,
},
});
break;
case PushNotificationTypes.raffle:
Expand Down
2 changes: 1 addition & 1 deletion src/route-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export enum NewsStackRoutes {
OurNews = 'ourNews',
}

export type NewsStackParamList = HomeStackParamList & {
export type NewsStackParamList = {
[NewsStackRoutes.News]: undefined;
[NewsStackRoutes.NewsDetail]: {
id: string;
Expand Down
8 changes: 8 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,14 @@ export type RootStackParamList = {
| 'browserEditBookmarksScreen'
| 'browserHomePage';
};
homeNews:
| undefined
| {
id: string;
openEvent: MarketingEvents;
linkEvent: MarketingEvents;
scrollEvent: MarketingEvents;
};
homeSettings:
| undefined
| {
Expand Down

0 comments on commit b2a5765

Please sign in to comment.