Skip to content

Commit

Permalink
refactor: remove WithWritableReportOrNotFoundOnyxProps and add report…
Browse files Browse the repository at this point in the history
… & reportDraft in WithWritableReportOrNotFoundProps
  • Loading branch information
abhinaybathina committed Sep 23, 2024
1 parent 7e43b4e commit cbd7c61
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/pages/iou/request/step/withWritableReportOrNotFound.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ import ONYXKEYS from '@src/ONYXKEYS';
import type SCREENS from '@src/SCREENS';
import type {Report} from '@src/types/onyx';

type WithWritableReportOrNotFoundOnyxProps = {
/** The report corresponding to the reportID in the route params */
report: OnyxEntry<Report>;

/** The draft report corresponding to the reportID in the route params */
reportDraft: OnyxEntry<Report>;
};

type MoneyRequestRouteName =
| typeof SCREENS.MONEY_REQUEST.STEP_WAYPOINT
| typeof SCREENS.MONEY_REQUEST.STEP_DESCRIPTION
Expand All @@ -44,7 +36,15 @@ type MoneyRequestRouteName =

type Route<T extends MoneyRequestRouteName> = RouteProp<MoneyRequestNavigatorParamList, T>;

type WithWritableReportOrNotFoundProps<T extends MoneyRequestRouteName> = WithWritableReportOrNotFoundOnyxProps & {route: Route<T>};
type WithWritableReportOrNotFoundProps<T extends MoneyRequestRouteName> = {
/** The report corresponding to the reportID in the route params */
report: OnyxEntry<Report>;

/** The draft report corresponding to the reportID in the route params */
reportDraft: OnyxEntry<Report>;

route: Route<T>
};

export default function <TProps extends WithWritableReportOrNotFoundProps<MoneyRequestRouteName>, TRef>(
WrappedComponent: ComponentType<TProps & RefAttributes<TRef>>,
Expand Down

0 comments on commit cbd7c61

Please sign in to comment.