Skip to content

Commit

Permalink
Resolve type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
eucool committed Mar 31, 2024
1 parent 61588d5 commit 2de7096
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
13 changes: 10 additions & 3 deletions src/pages/iou/request/step/IOURequestStepScan/index.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ import Text from '@components/Text';
import useLocalize from '@hooks/useLocalize';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import compose from '@libs/compose';
import * as FileUtils from '@libs/fileDownload/FileUtils';
import Log from '@libs/Log';
import Navigation from '@libs/Navigation/Navigation';
import StepScreenWrapper from '@pages/iou/request/step/StepScreenWrapper';
import withFullTransactionOrNotFound from '@pages/iou/request/step/withFullTransactionOrNotFound';
import type {WithWritableReportOrNotFoundProps} from '@pages/iou/request/step/withWritableReportOrNotFound';
import withWritableReportOrNotFound from '@pages/iou/request/step/withWritableReportOrNotFound';
import * as IOU from '@userActions/IOU';
import CONST from '@src/CONST';
Expand All @@ -33,13 +33,15 @@ import CameraPermission from './CameraPermission';
import NavigationAwareCamera from './NavigationAwareCamera';
import type IOURequestStepOnyxProps from './types';

type IOURequestStepScanProps = IOURequestStepOnyxProps & WithWritableReportOrNotFoundProps;

function IOURequestStepScan({
report,
route: {
params: {action, iouType, reportID, transactionID, backTo},
},
transaction: {isFromGlobalCreate},
}: IOURequestStepOnyxProps) {
}: IOURequestStepScanProps) {
const theme = useTheme();
const styles = useThemeStyles();
const device = useCameraDevice('back', {
Expand Down Expand Up @@ -364,4 +366,9 @@ function IOURequestStepScan({

IOURequestStepScan.displayName = 'IOURequestStepScan';

export default compose(withWritableReportOrNotFound, withFullTransactionOrNotFound)(IOURequestStepScan);
// eslint-disable-next-line rulesdir/no-negated-variables
const IOURequestStepScanWithWritableReportOrNotFound = withWritableReportOrNotFound(IOURequestStepScan);
// eslint-disable-next-line rulesdir/no-negated-variables
const IOURequestStepScanWithFullTransactionOrNotFound = withFullTransactionOrNotFound(IOURequestStepScanWithWritableReportOrNotFound);

export default IOURequestStepScanWithFullTransactionOrNotFound;
13 changes: 10 additions & 3 deletions src/pages/iou/request/step/IOURequestStepScan/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import useWindowDimensions from '@hooks/useWindowDimensions';
import * as Browser from '@libs/Browser';
import compose from '@libs/compose';
import * as FileUtils from '@libs/fileDownload/FileUtils';
import Navigation from '@libs/Navigation/Navigation';
import ReceiptDropUI from '@pages/iou/ReceiptDropUI';
import StepScreenDragAndDropWrapper from '@pages/iou/request/step/StepScreenDragAndDropWrapper';
import withFullTransactionOrNotFound from '@pages/iou/request/step/withFullTransactionOrNotFound';
import type {WithWritableReportOrNotFoundProps} from '@pages/iou/request/step/withWritableReportOrNotFound';
import withWritableReportOrNotFound from '@pages/iou/request/step/withWritableReportOrNotFound';
import * as IOU from '@userActions/IOU';
import CONST from '@src/CONST';
Expand All @@ -35,13 +35,15 @@ import {isEmptyObject} from '@src/types/utils/EmptyObject';
import NavigationAwareCamera from './NavigationAwareCamera';
import type IOURequestStepOnyxProps from './types';

type IOURequestStepScanProps = IOURequestStepOnyxProps & WithWritableReportOrNotFoundProps;

function IOURequestStepScan({
report,
route: {
params: {action, iouType, reportID, transactionID, backTo},
},
transaction: {isFromGlobalCreate},
}: IOURequestStepOnyxProps) {
}: IOURequestStepScanProps) {
const theme = useTheme();
const styles = useThemeStyles();

Expand Down Expand Up @@ -490,4 +492,9 @@ function IOURequestStepScan({

IOURequestStepScan.displayName = 'IOURequestStepScan';

export default compose(withWritableReportOrNotFound, withFullTransactionOrNotFound)(IOURequestStepScan);
// eslint-disable-next-line rulesdir/no-negated-variables
const IOURequestStepScanWithWritableReportOrNotFound = withWritableReportOrNotFound(IOURequestStepScan);
// eslint-disable-next-line rulesdir/no-negated-variables
const IOURequestStepScanWithFullTransactionOrNotFound = withFullTransactionOrNotFound(IOURequestStepScanWithWritableReportOrNotFound);

export default IOURequestStepScanWithFullTransactionOrNotFound;

0 comments on commit 2de7096

Please sign in to comment.