Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TS Migration]: fix type while migrating GetAssistancePage to typescript #34715

Merged
merged 2 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/libs/Navigation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ type SettingsNavigatorParamList = {
policyID: string;
};
[SCREENS.GET_ASSISTANCE]: {
taskID: string;
backTo: Routes;
};
[SCREENS.SETTINGS.TWO_FACTOR_AUTH]: undefined;
[SCREENS.SETTINGS.REPORT_CARD_LOST_OR_DAMAGED]: undefined;
Expand Down
10 changes: 4 additions & 6 deletions src/pages/GetAssistancePage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type {RouteProp} from '@react-navigation/native';
import type {StackScreenProps} from '@react-navigation/stack';
import React from 'react';
import {ScrollView, View} from 'react-native';
import {withOnyx} from 'react-native-onyx';
Expand All @@ -13,23 +13,21 @@ import Text from '@components/Text';
import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
import Navigation from '@libs/Navigation/Navigation';
import type {SettingsNavigatorParamList} from '@libs/Navigation/types';
import * as Link from '@userActions/Link';
import * as Report from '@userActions/Report';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
import type {Route} from '@src/ROUTES';
import type SCREENS from '@src/SCREENS';
import type {Account} from '@src/types/onyx';

type GetAssistanceOnyxProps = {
/** The details about the account that the user is signing in with */
account: OnyxEntry<Account>;
};

type GetAssistancePageProps = GetAssistanceOnyxProps & {
/** Route object from navigation */
route: RouteProp<{params: {backTo: Route}}>;
};
type GetAssistancePageProps = GetAssistanceOnyxProps & StackScreenProps<SettingsNavigatorParamList, typeof SCREENS.GET_ASSISTANCE>;

function GetAssistancePage({route, account}: GetAssistancePageProps) {
const styles = useThemeStyles();
Expand Down
Loading