Skip to content

Open enable payments URL in external browser on desktop app #47492

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

Merged
merged 3 commits into from
Aug 15, 2024
Merged
Changes from 2 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
6 changes: 3 additions & 3 deletions src/pages/EnablePayments/AddBankAccount/SetupMethod.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
import getPlaidDesktopMessage from '@libs/getPlaidDesktopMessage';
import * as BankAccounts from '@userActions/BankAccounts';
import CONFIG from '@src/CONFIG';
import * as Link from '@userActions/Link';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
import type {User} from '@src/types/onyx';
Expand All @@ -28,7 +28,7 @@ type SetupMethodOnyxProps = {
type SetupMethodProps = SetupMethodOnyxProps;

const plaidDesktopMessage = getPlaidDesktopMessage();
const enablePayments = `${CONFIG.EXPENSIFY.NEW_EXPENSIFY_URL}${ROUTES.SETTINGS_ENABLE_PAYMENTS}`;
const enablePaymentsRoute = `${ROUTES.SETTINGS_ENABLE_PAYMENTS}`;

function SetupMethod({isPlaidDisabled, user}: SetupMethodProps) {
const styles = useThemeStyles();
Expand All @@ -46,7 +46,7 @@ function SetupMethod({isPlaidDisabled, user}: SetupMethodProps) {
</View>
{!!plaidDesktopMessage && (
<View style={[styles.mv3, styles.flexRow, styles.justifyContentBetween]}>
<TextLink href={enablePayments}>{translate(plaidDesktopMessage)}</TextLink>
<TextLink onPress={() => Link.openExternalLinkWithToken(enablePaymentsRoute)}>{translate(plaidDesktopMessage)}</TextLink>
</View>
)}
<Button
Expand Down
Loading