Remove payments API routing initialization
[ProtonMail-WebClient.git] / packages / components / containers / desktop / openExternalLink.ts
blob0213641bae5f0f9f46056e0923fb2a6a95f4b424
1 import { type PLANS } from '@proton/payments';
2 import { getAppHref } from '@proton/shared/lib/apps/helper';
3 import type { CYCLE } from '@proton/shared/lib/constants';
4 import { APPS } from '@proton/shared/lib/constants';
5 import { invokeInboxDesktopIPC } from '@proton/shared/lib/desktop/ipcHelpers';
6 import { addUpsellPath, getUpgradePath } from '@proton/shared/lib/helpers/upsell';
8 export const freeTrialUpgradeClick = (upsellRef: string) => {
9     invokeInboxDesktopIPC({
10         type: 'openExternal',
11         payload: getAppHref(addUpsellPath(getUpgradePath({}), upsellRef), APPS.PROTONACCOUNT),
12     });
15 export const upgradeButtonClick = (cycle: CYCLE, plan?: PLANS) => {
16     invokeInboxDesktopIPC({
17         type: 'openExternal',
18         payload: getAppHref(`/dashboard?plan=${plan}&cycle=${cycle}&step=1`, APPS.PROTONACCOUNT),
19     });
22 export const openLinkInBrowser = (url: string) => {
23     invokeInboxDesktopIPC({ type: 'openExternal', payload: url });