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

feat: update trips empty state view #48060

Merged
merged 27 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
fix: lint
  • Loading branch information
daledah committed Sep 24, 2024
commit ab88894d065cedc52db1a1c01ff0d36b49a40605
10 changes: 5 additions & 5 deletions src/libs/TripReservationUtils.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {OnyxEntry} from 'react-native-onyx';
import {LocaleContextProps} from '@components/LocaleContextProvider';
import {Dispatch, SetStateAction} from 'react';

Check failure on line 1 in src/libs/TripReservationUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

All imports in the declaration are only used as types. Use `import type`

Check failure on line 1 in src/libs/TripReservationUtils.ts

View workflow job for this annotation

GitHub Actions / ESLint check

All imports in the declaration are only used as types. Use `import type`
import type {OnyxEntry} from 'react-native-onyx';
import type {LocaleContextProps} from '@components/LocaleContextProvider';
import * as Link from '@userActions/Link';

Check warning on line 4 in src/libs/TripReservationUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Unexpected subpath import via alias '@userActions/Link'. Use './actions/Link' instead

Check warning on line 4 in src/libs/TripReservationUtils.ts

View workflow job for this annotation

GitHub Actions / ESLint check

Unexpected subpath import via alias '@userActions/Link'. Use './actions/Link' instead
import * as Expensicons from '@src/components/Icon/Expensicons';
import CONST from '@src/CONST';
import * as PolicyUtils from '@src/libs/PolicyUtils';
import ROUTES from '@src/ROUTES';
import {TravelSettings} from '@src/types/onyx';

Check failure on line 8 in src/libs/TripReservationUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

All imports in the declaration are only used as types. Use `import type`

Check failure on line 8 in src/libs/TripReservationUtils.ts

View workflow job for this annotation

GitHub Actions / ESLint check

All imports in the declaration are only used as types. Use `import type`
import type {Reservation, ReservationType} from '@src/types/onyx/Transaction';
import type Transaction from '@src/types/onyx/Transaction';
import {isEmptyObject} from '@src/types/utils/EmptyObject';
Expand Down Expand Up @@ -49,9 +49,9 @@
function bookATrip(
translate: LocaleContextProps['translate'],
travelSettings: OnyxEntry<TravelSettings>,
activePolicyID?: string,
activePolicyID: string,
ctaErrorMessage = '',

Check failure on line 53 in src/libs/TripReservationUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Default parameters should be last

Check failure on line 53 in src/libs/TripReservationUtils.ts

View workflow job for this annotation

GitHub Actions / ESLint check

Default parameters should be last
setCtaErrorMessage = (_: string) => {},
setCtaErrorMessage: Dispatch<SetStateAction<string>>,
): void {
if (isEmptyObject(travelSettings)) {
Navigation.navigate(ROUTES.WORKSPACE_PROFILE_ADDRESS.getRoute(activePolicyID ?? '-1', Navigation.getActiveRoute()));
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Search/EmptySearchView.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Str} from 'expensify-common';
import React, {useCallback, useMemo, useState} from 'react';
import React, {useMemo, useState} from 'react';
import {Linking, View} from 'react-native';
import {useOnyx} from 'react-native-onyx';
import DotIndicatorMessage from '@components/DotIndicatorMessage';
Expand Down Expand Up @@ -108,7 +108,7 @@
setCtaErrorMessage(translate('travel.phoneError'));
return;
}
TripsResevationUtils.bookATrip(translate, travelSettings, activePolicyID, ctaErrorMessage, setCtaErrorMessage);
TripsResevationUtils.bookATrip(translate, travelSettings, activePolicyID ?? '', ctaErrorMessage, setCtaErrorMessage);
},
canEmptyViewBeScrolled: true,
};
Expand All @@ -126,7 +126,7 @@
headerContentStyles: styles.emptyStateFolderWebStyles,
};
}
}, [type, StyleUtils, translate, theme, styles, subtitleComponent]);

Check warning on line 129 in src/pages/Search/EmptySearchView.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

React Hook useMemo has missing dependencies: 'activePolicyID', 'ctaErrorMessage', 'primaryLogin', and 'travelSettings'. Either include them or remove the dependency array

Check warning on line 129 in src/pages/Search/EmptySearchView.tsx

View workflow job for this annotation

GitHub Actions / ESLint check

React Hook useMemo has missing dependencies: 'activePolicyID', 'ctaErrorMessage', 'primaryLogin', and 'travelSettings'. Either include them or remove the dependency array

return (
<EmptyStateComponent
Expand Down
Loading