index int64 0 0 | repo_id stringlengths 16 181 | file_path stringlengths 28 270 | content stringlengths 1 11.6M | __index_level_0__ int64 0 10k |
|---|---|---|---|---|
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/CreditsSection.test.tsx | import { render } from '@testing-library/react';
import { mockSubscriptionCache, mockUserCache, userDefaultResponse } from '@proton/components/hooks/helpers/test';
import { PLANS } from '@proton/shared/lib/constants';
import { External, Subscription, SubscriptionModel } from '@proton/shared/lib/interfaces';
import { f... | 6,700 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/CreditsSection.tsx | import { c } from 'ttag';
import { Button } from '@proton/atoms';
import { isFreeSubscription } from '@proton/shared/lib/constants';
import { getHasVpnB2BPlan, isManagedExternally } from '@proton/shared/lib/helpers/subscription';
import { External } from '@proton/shared/lib/interfaces';
import noop from '@proton/utils... | 6,701 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/CurrencySelector.tsx | import { c } from 'ttag';
import { Button } from '@proton/atoms';
import { Props as SelectProps } from '@proton/components/components/selectTwo/SelectTwo';
import { CURRENCIES, DEFAULT_CURRENCY } from '@proton/shared/lib/constants';
import { Currency } from '@proton/shared/lib/interfaces';
import clsx from '@proton/ut... | 6,702 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/CycleSelector.tsx | import { c } from 'ttag';
import { Button } from '@proton/atoms';
import { CYCLE, DEFAULT_CYCLE } from '@proton/shared/lib/constants';
import { omit } from '@proton/shared/lib/helpers/object';
import { Cycle } from '@proton/shared/lib/interfaces';
import clsx from '@proton/utils/clsx';
import ButtonGroup, { Props as ... | 6,703 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/DowngradeModal.tsx | import { c } from 'ttag';
import { Button } from '@proton/atoms';
import { MAIL_APP_NAME, VPN_APP_NAME } from '@proton/shared/lib/constants';
import { Alert, ModalProps, Prompt } from '../../components';
interface Props extends ModalProps {
hasMail: boolean;
hasVpn: boolean;
onConfirm: () => void;
}
con... | 6,704 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/EditCardModal.test.tsx | import { fireEvent, render, waitFor } from '@testing-library/react';
import { Autopay, CardModel } from '@proton/components/payments/core';
import { updatePaymentMethod } from '@proton/shared/lib/api/payments';
import {
apiMock,
applyHOCs,
withApi,
withCache,
withDeprecatedModals,
withEventMana... | 6,705 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/EditCardModal.tsx | import { FormEvent } from 'react';
import { c } from 'ttag';
import { Button } from '@proton/atoms';
import { getDefaultVerifyPayment } from '@proton/components/payments/client-extensions/validators/validators';
import { Autopay, isTokenPayment } from '@proton/components/payments/core';
import { useCard } from '@prot... | 6,706 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/GiftCodeSection.tsx | import { ChangeEvent, useState } from 'react';
import { c } from 'ttag';
import { Button } from '@proton/atoms';
import { useLoading } from '@proton/hooks';
import { buyCredit, validateCredit } from '@proton/shared/lib/api/payments';
import { requiredValidator } from '@proton/shared/lib/helpers/formValidators';
impo... | 6,707 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/LossLoyaltyModal.tsx | import { c, msgid } from 'ttag';
import { Button } from '@proton/atoms';
import { BRAND_NAME, VPN_APP_NAME } from '@proton/shared/lib/constants';
import humanSize from '@proton/shared/lib/helpers/humanSize';
import { Organization } from '@proton/shared/lib/interfaces';
import { ModalProps, Prompt } from '../../compon... | 6,708 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/MemberDowngradeModal.tsx | import { FormEvent, useState } from 'react';
import { c } from 'ttag';
import { Button, Card } from '@proton/atoms';
import { BRAND_NAME } from '@proton/shared/lib/constants';
import { requiredValidator } from '@proton/shared/lib/helpers/formValidators';
import { hasFamily } from '@proton/shared/lib/helpers/subscript... | 6,709 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/PayPalButton.tsx | import { c } from 'ttag';
import { Button, ButtonProps } from '@proton/atoms';
import { PaypalProcessorHook } from '@proton/components/payments/react-extensions/usePaypal';
import { Currency } from '@proton/shared/lib/interfaces';
import { PaymentMethodFlows } from '../paymentMethods/interface';
export type PayPalBu... | 6,710 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/PayPalInfoMessage.tsx | import { c } from 'ttag';
const PayPalInfoMessage = () => {
const payPalInfoMessage = c('Info')
.t`We will redirect you to PayPal in a new browser tab to complete this transaction. If you use any pop-up blockers, please disable them to continue.`;
return <div className="mb-4">{payPalInfoMessage}</div>... | 6,711 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/PayPalModal.tsx | import { useEffect, useRef } from 'react';
import { c } from 'ttag';
import { Button } from '@proton/atoms';
import { ensureTokenChargeable } from '@proton/components/payments/client-extensions';
import { PAYMENT_METHOD_TYPES } from '@proton/components/payments/core';
import { useLoading } from '@proton/hooks';
impor... | 6,712 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/PayPalView.test.tsx | import { render } from '@testing-library/react';
import { renderHook } from '@testing-library/react-hooks';
import { usePaypal } from '@proton/components/payments/react-extensions/usePaypal';
import { Currency } from '@proton/shared/lib/interfaces';
import { apiMock, mockVerifyPayment } from '@proton/testing';
import... | 6,713 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/PayPalView.tsx | import { c } from 'ttag';
import { PaypalProcessorHook } from '@proton/components/payments/react-extensions/usePaypal';
import { MAX_PAYPAL_AMOUNT, MIN_PAYPAL_AMOUNT } from '@proton/shared/lib/constants';
import { Currency } from '@proton/shared/lib/interfaces';
import { Alert, Price } from '../../components';
import... | 6,714 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/Payment.spec.tsx | import { render, waitFor } from '@testing-library/react';
import { ViewPaymentMethod } from '@proton/components/payments/client-extensions';
import { CardModel, PAYMENT_METHOD_TYPES, SavedPaymentMethod } from '@proton/components/payments/core';
import { CardFieldStatus } from '@proton/components/payments/react-extensi... | 6,715 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/Payment.tsx | import { ReactNode, Ref, useEffect } from 'react';
import { c } from 'ttag';
import { ViewPaymentMethod } from '@proton/components/payments/client-extensions';
import {
PAYMENT_METHOD_TYPES,
PaymentMethodStatus,
PaymentMethodType,
SavedPaymentMethod,
} from '@proton/components/payments/core';
import {... | 6,716 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/PaymentGiftCode.tsx | import { RefObject, useEffect, useState } from 'react';
import { c } from 'ttag';
import { Button, Input } from '@proton/atoms';
import { Icon, Info, UnderlineButton } from '../../components';
import { useToggle } from '../../hooks';
interface Props {
loading?: boolean;
giftCode?: string;
onApply: (valu... | 6,717 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/PaymentInfo.tsx | import { c } from 'ttag';
import { PAYMENT_METHOD_TYPES, PlainPaymentMethodType, methodMatches } from '@proton/components/payments/core';
interface Props {
paymentMethodType?: PlainPaymentMethodType;
}
const PaymentInfo = ({ paymentMethodType }: Props) => {
if (methodMatches(paymentMethodType, [PAYMENT_METHO... | 6,718 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/PaymentSelector.tsx | import { useState } from 'react';
import { c } from 'ttag';
import { isNumber } from '@proton/shared/lib/helpers/validators';
import { Currency } from '@proton/shared/lib/interfaces';
import { Input, Label } from '../../components';
import AmountButton from './AmountButton';
import CurrencySelector from './CurrencyS... | 6,719 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/PaymentVerificationImage.spec.tsx | import { render } from '@testing-library/react';
import { PAYMENT_METHOD_TYPES } from '@proton/components/payments/core';
import { CardPayment, PaypalPayment } from '../../payments/core/interface';
import PaymentVerificationImage from './PaymentVerificationImage';
describe('PaymentVerificationImage', () => {
it.... | 6,720 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/PaymentVerificationImage.tsx | import creditCardType from 'credit-card-type';
import { PAYMENT_METHOD_TYPES } from '@proton/components/payments/core';
import treeDSecureSvg from '@proton/styles/assets/img/bank-icons/3d-secure.svg';
import americanExpressSafekeySvg from '@proton/styles/assets/img/bank-icons/amex-safekey.svg';
import discoverProtectB... | 6,721 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/PaymentWrapper.tsx | import { usePaymentFacade } from '@proton/components/payments/client-extensions';
import { PAYMENT_METHOD_TYPES } from '@proton/components/payments/core';
import { useAuthentication } from '../..';
import { Props as PaymentProps, PaymentsNoApi } from './Payment';
export type Props = ReturnType<typeof usePaymentFacade... | 6,722 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/PlansSection.tsx | import { useEffect, useState } from 'react';
import { useLocation } from 'react-router-dom';
import { c } from 'ttag';
import { Button } from '@proton/atoms';
import { useLoading } from '@proton/hooks';
import { checkSubscription } from '@proton/shared/lib/api/payments';
import { APPS, APP_NAMES, DEFAULT_CYCLE, PLANS... | 6,723 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/ProtonPlanCustomizer.tsx | import { ComponentPropsWithoutRef, ReactElement, ReactNode, useState } from 'react';
import { c, msgid } from 'ttag';
import {
ADDON_NAMES,
BRAND_NAME,
GIGA,
MAX_ADDRESS_ADDON,
MAX_DOMAIN_PRO_ADDON,
MAX_IPS_ADDON,
MAX_MEMBER_ADDON,
MAX_MEMBER_VPN_B2B_ADDON,
MAX_SPACE_ADDON,
MAX... | 6,724 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/RenewToggle.test.tsx | import { fireEvent, render, waitFor } from '@testing-library/react';
import { renderHook } from '@testing-library/react-hooks';
import { mockSubscriptionCache } from '@proton/components/hooks/helpers/test';
import { Autopay } from '@proton/components/payments/core';
import { applyHOCs, hookWrapper, withCache } from '@... | 6,725 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/RenewToggle.tsx | import { useState } from 'react';
import { c } from 'ttag';
import { Button } from '@proton/atoms/Button';
import { Autopay } from '@proton/components/payments/core';
import { ADDON_NAMES, PLANS } from '@proton/shared/lib/constants';
import { PrimaryButton } from '../../components/button';
import { ModalProps } from... | 6,726 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/RenewalNotice.test.tsx | import { render } from '@testing-library/react';
import { getRenewalNoticeText } from './RenewalNotice';
const RenewalNotice = (...props: Parameters<typeof getRenewalNoticeText>) => {
return <div>{getRenewalNoticeText(...props)}</div>;
};
describe('<RenewalNotice />', () => {
beforeEach(() => {
jest.... | 6,727 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/RenewalNotice.tsx | import { addMonths } from 'date-fns';
import { c, msgid } from 'ttag';
import { CYCLE } from '@proton/shared/lib/constants';
import { getPlanFromPlanIDs } from '@proton/shared/lib/helpers/planIDs';
import { getNormalCycleFromCustomCycle } from '@proton/shared/lib/helpers/subscription';
import { Currency, PlanIDs, Plan... | 6,728 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/StartDateCheckoutRow.tsx | import { c } from 'ttag';
import { Info, Time } from '../../components';
export interface Props {
nextSubscriptionStart: number;
}
const StartDateCheckoutRow = ({ nextSubscriptionStart }: Props) => {
const formattedTime = <Time key="time-text">{nextSubscriptionStart}</Time>;
return (
<div classN... | 6,729 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/StyledPayPalButton.scss | .button.paypal-button {
// The Design team wants the button to be branded as PayPal yellow for every theme
--button-default-background-color: #ffc439;
--button-hover-background-color: #f3ba37;
--button-active-background-color: #e5b034;
--button-default-text-color: black;
--button-hover-text-color: black;
--butto... | 6,730 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/StyledPayPalButton.tsx | import paypalSvg from '@proton/styles/assets/img/bank-icons/paypal-color.svg';
import clsx from '@proton/utils/clsx';
import PayPalButton, { PayPalButtonProps } from './PayPalButton';
import './StyledPayPalButton.scss';
type Omitted = 'children' | 'shape' | 'color' | 'icon';
type Props = Omit<PayPalButtonProps, Omit... | 6,731 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/SubscriptionsSection.test.tsx | import { render } from '@testing-library/react';
import { mockPlansCache, mockSubscriptionCache, mockUserCache } from '@proton/components/hooks/helpers/test';
import { changeRenewState } from '@proton/shared/lib/api/payments';
import { PLANS } from '@proton/shared/lib/constants';
import { Renew, Subscription, Subscrip... | 6,732 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/SubscriptionsSection.tsx | import { c, msgid } from 'ttag';
import { DropdownActionProps } from '@proton/components/components/dropdown/DropdownActions';
import { useLoading } from '@proton/hooks';
import { changeRenewState } from '@proton/shared/lib/api/payments';
import { COUPON_CODES, PLANS } from '@proton/shared/lib/constants';
import {
... | 6,733 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/helper.ts | import { c, msgid } from 'ttag';
import { Cycle } from '@proton/shared/lib/interfaces';
export const getTotalBillingText = (cycle: Cycle) => {
const n = cycle;
return c('Checkout row').ngettext(msgid`Total for ${n} month`, `Total for ${n} months`, n);
};
export const getShortBillingText = (n: number) => {
... | 6,734 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/index.ts | export { default as Alert3ds } from './Alert3ds';
export { default as AmountButton } from './AmountButton';
export { default as AmountRow } from './AmountRow';
export { default as Bitcoin } from './Bitcoin';
export { default as BitcoinDetails } from './BitcoinDetails';
export { default as BitcoinQRCode } from './Bitcoi... | 6,735 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/useBitcoin.test.tsx | import { renderHook } from '@testing-library/react-hooks';
import { AmountAndCurrency, PAYMENT_TOKEN_STATUS } from '@proton/components/payments/core';
import { createToken, getTokenStatus } from '@proton/shared/lib/api/payments';
import { MAX_BITCOIN_AMOUNT } from '@proton/shared/lib/constants';
import { addApiMock, a... | 6,736 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/useBitcoin.ts | import { useEffect, useState } from 'react';
import { useLoading } from '@proton/hooks';
import { getSilentApi } from '@proton/shared/lib/api/helpers/customConfig';
import { CreateBitcoinTokenData, createToken, getTokenStatus } from '@proton/shared/lib/api/payments';
import { MAX_BITCOIN_AMOUNT, MIN_BITCOIN_AMOUNT } f... | 6,737 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/__mocks__/RenewToggle.tsx | export default () => <>RenewToggle</>;
| 6,738 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/features/b2b.ts | import { c } from 'ttag';
import { BRAND_NAME, PLANS } from '@proton/shared/lib/constants';
import { Audience } from '@proton/shared/lib/interfaces';
import { PlanCardFeature, PlanCardFeatureDefinition } from './interface';
export const getTwoFA = (): PlanCardFeatureDefinition => {
return {
text: c('new_... | 6,739 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/features/calendar.ts | import { c, msgid } from 'ttag';
import { MAX_CALENDARS_FAMILY, MAX_CALENDARS_FREE, MAX_CALENDARS_PAID } from '@proton/shared/lib/calendar/constants';
import { CALENDAR_APP_NAME, FAMILY_MAX_USERS, PLANS, PLAN_SERVICES } from '@proton/shared/lib/constants';
import { hasBit } from '@proton/shared/lib/helpers/bitset';
im... | 6,740 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/features/drive.tsx | import { c } from 'ttag';
import { CALENDAR_APP_NAME, DRIVE_APP_NAME, MAIL_APP_NAME, PLANS } from '@proton/shared/lib/constants';
import humanSize, { getSizeFormat } from '@proton/shared/lib/helpers/humanSize';
import { Audience, PlansMap } from '@proton/shared/lib/interfaces';
import { PlanCardFeature, PlanCardFeatu... | 6,741 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/features/highlights.ts | import { c } from 'ttag';
import { FAMILY_MAX_USERS, PLANS, PROTON_SENTINEL_NAME } from '@proton/shared/lib/constants';
import { Audience, PlansMap } from '@proton/shared/lib/interfaces';
import { getStorage } from './drive';
import { PlanCardFeature, PlanCardFeatureDefinition } from './interface';
const getUsers = ... | 6,742 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/features/index.ts | import { PLANS } from '@proton/shared/lib/constants';
import { Audience, PlansMap, VPNServersCountData } from '@proton/shared/lib/interfaces';
import isTruthy from '@proton/utils/isTruthy';
import { getSupportFeatures, getTeamManagementFeatures } from './b2b';
import { getCalendarFeatures } from './calendar';
import {... | 6,743 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/features/interface.ts | import { PLANS } from '@proton/shared/lib/constants';
import { Audience } from '@proton/shared/lib/interfaces';
import { IconName } from '../../../components';
export interface PlanCardFeatureDefinition {
text: string | string[];
included: boolean;
hideInDowngrade?: boolean;
status?: 'available' | 'co... | 6,744 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/features/mail.ts | import { c, msgid } from 'ttag';
import { BRAND_NAME, MAIL_APP_NAME, PLANS } from '@proton/shared/lib/constants';
import humanSize from '@proton/shared/lib/helpers/humanSize';
import { getKnowledgeBaseUrl } from '@proton/shared/lib/helpers/url';
import { Audience, PlansMap } from '@proton/shared/lib/interfaces';
impo... | 6,745 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/features/pass.tsx | import { c, msgid } from 'ttag';
import { BRAND_NAME, PASS_APP_NAME, PLANS } from '@proton/shared/lib/constants';
import { PlanCardFeature, PlanCardFeatureDefinition } from './interface';
export const getPassAppFeature = (): PlanCardFeatureDefinition => {
return {
text: PASS_APP_NAME,
included: t... | 6,746 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/features/plan.ts | import { c } from 'ttag';
import { MAX_CALENDARS_FREE } from '@proton/shared/lib/calendar/constants';
import { BRAND_NAME, FAMILY_MAX_USERS, PLANS, PLAN_NAMES, VPN_CONNECTIONS } from '@proton/shared/lib/constants';
import { Plan, PlansMap, VPNServersCountData } from '@proton/shared/lib/interfaces';
import { getFreeSer... | 6,747 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/features/vpn.ts | import { c, msgid } from 'ttag';
import {
BRAND_NAME,
CALENDAR_SHORT_APP_NAME,
DRIVE_SHORT_APP_NAME,
FREE_VPN_CONNECTIONS,
MAIL_SHORT_APP_NAME,
PLANS,
VPN_APP_NAME,
VPN_CONNECTIONS,
} from '@proton/shared/lib/constants';
import { Audience, VPNServersCountData } from '@proton/shared/lib/... | 6,748 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/AutomaticSubscriptionModal.tsx | import { useEffect, useRef } from 'react';
import { useHistory, useLocation } from 'react-router-dom';
import { c } from 'ttag';
import { Button } from '@proton/atoms/Button';
import {
ModalProps,
OpenCallbackProps,
Prompt,
useConfig,
useLastSubscriptionEnd,
useLoad,
useModalState,
use... | 6,749 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/CalendarDowngradeModal.tsx | import { c, msgid } from 'ttag';
import { Button } from '@proton/atoms';
import { MAX_CALENDARS_FREE } from '@proton/shared/lib/calendar/constants';
import { getCalendarsSettingsPath } from '@proton/shared/lib/calendar/settingsRoutes';
import { APPS, BRAND_NAME, CALENDAR_APP_NAME, MAIL_SHORT_APP_NAME } from '@proton/s... | 6,750 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/DowngradeSubscriptionSection.tsx | import { c } from 'ttag';
import { SettingsParagraph, SettingsSection } from '../../account';
import UnsubscribeButton from './UnsubscribeButton';
const DowngradeSubscriptionSection = () => {
return (
<SettingsSection>
<SettingsParagraph>
{c('Info')
.t`This ... | 6,751 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/FeedbackDowngradeModal.tsx | import { Fragment, ReactNode, useState } from 'react';
import { c } from 'ttag';
import { Button } from '@proton/atoms';
import { ModalTwoPromiseHandlers } from '@proton/components/components/modalTwo/useModalTwo';
import { BRAND_NAME, SUBSCRIPTION_CANCELLATION_REASONS } from '@proton/shared/lib/constants';
import { ... | 6,752 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/HighlightPlanDowngradeModal.tsx | import { c, msgid } from 'ttag';
import { Button } from '@proton/atoms';
import { BRAND_NAME } from '@proton/shared/lib/constants';
import { getDifferenceInDays } from '@proton/shared/lib/date/date';
import {
Alert,
Form,
ModalTwo as Modal,
ModalTwoContent as ModalContent,
ModalTwoFooter as ModalF... | 6,753 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/InAppPurchaseModal.test.tsx | import { act, fireEvent, render } from '@testing-library/react';
import { External } from '@proton/shared/lib/interfaces';
import InAppPurchaseModal from './InAppPurchaseModal';
jest.mock('@proton/components/components/portal/Portal');
it('should render', () => {
const { container } = render(
<InAppPurc... | 6,754 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/InAppPurchaseModal.tsx | import { c } from 'ttag';
import { Button } from '@proton/atoms/Button';
import { ModalProps, ModalTwo, ModalTwoContent, ModalTwoFooter, ModalTwoHeader } from '@proton/components/components';
import { External, Subscription } from '@proton/shared/lib/interfaces';
interface Props extends ModalProps {
subscription:... | 6,755 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/PendingInvitationModal.tsx | import { c } from 'ttag';
import { Button } from '@proton/atoms/Button';
import {
ModalStateProps,
ModalTwo,
ModalTwoContent,
ModalTwoFooter,
ModalTwoHeader,
useSettingsLink,
} from '@proton/components/components';
import { useApi, useCache, useConfig, useEventManager, useNotifications } from '... | 6,756 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/PendingInvitationModalErrors.tsx | import { c } from 'ttag';
import { Button } from '@proton/atoms/Button';
import { SettingsLink, useModalState } from '@proton/components/components';
import { BugModal, useUser } from '@proton/components/index';
import { APPS, BRAND_NAME } from '@proton/shared/lib/constants';
import humanSize from '@proton/shared/lib/... | 6,757 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/PlanCard.tsx | import { ReactNode } from 'react';
import { c } from 'ttag';
import { PLANS } from '@proton/shared/lib/constants';
import { Currency, Cycle } from '@proton/shared/lib/interfaces';
import clsx from '@proton/utils/clsx';
import { Icon, Price, PrimaryButton } from '../../../components';
interface Base {
planName: ... | 6,758 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/PlanCardFeatures.tsx | import React from 'react';
import { c } from 'ttag';
import { PLANS } from '@proton/shared/lib/constants';
import { Audience } from '@proton/shared/lib/interfaces';
import clsx from '@proton/utils/clsx';
import { CalendarLogo, DriveLogo, Icon, IconSize, Info, MailLogo, PassLogo, VpnLogo } from '../../../components';... | 6,759 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/PlanCustomization.tsx | import { PLANS, PLAN_TYPES } from '@proton/shared/lib/constants';
import { Currency, Cycle, Organization, PlanIDs, PlansMap, Subscription } from '@proton/shared/lib/interfaces';
import ProtonPlanCustomizer, { CustomiserMode } from '../ProtonPlanCustomizer';
interface Props {
loading: boolean;
cycle: Cycle;
... | 6,760 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/PlanLossWarningModal.tsx | import { c } from 'ttag';
import { Button, Href } from '@proton/atoms';
import { BRAND_NAME } from '@proton/shared/lib/constants';
import { getKnowledgeBaseUrl } from '@proton/shared/lib/helpers/url';
import { Prompt, PromptProps } from '../../../components';
interface Props extends Omit<PromptProps, 'children' | 't... | 6,761 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/PlanSelection.scss | @import '~@proton/styles/scss/lib';
/*
* cycle selector
*/
@include media('<=#{em(1100, 16)}') {
.cycle-currency-selectors {
&.flex-nowrap {
flex-wrap: wrap;
> .flex-item-fluid {
min-inline-size: 100%;
margin-inline-start: 0;
margin-block-end: 0.25em;
}
}
}
}
.plan-selection {
display: g... | 6,762 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/PlanSelection.test.tsx | import { ADDON_NAMES, CYCLE, PLANS } from '@proton/shared/lib/constants';
import { Plan } from '@proton/shared/lib/interfaces';
import { PLANS_MAP } from '@proton/testing/data';
import { getPrice } from './PlanSelection';
describe('getPrice', () => {
it('should return null if the current plan does not have pricin... | 6,763 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/PlanSelection.tsx | import { ReactElement } from 'react';
import { c } from 'ttag';
import { ProductParam } from '@proton/shared/lib/apps/product';
import { ADDON_NAMES, APPS, CYCLE, PLANS, PLAN_TYPES } from '@proton/shared/lib/constants';
import { switchPlan } from '@proton/shared/lib/helpers/planIDs';
import { getIpPricePerMonth } fro... | 6,764 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/SubscriptionCancelPlan.scss | @import '~@proton/styles/scss/lib';
.subscription-cancel-plan {
&-info {
min-block-size: 4em;
@include media('<=small') {
min-block-size: unset;
}
}
}
| 6,765 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/SubscriptionCancelPlan.tsx | import clsx from '@proton/utils/clsx';
import { Icon, Info } from '../../../components';
import { PlanCardFeatureDefinition } from '../features/interface';
import './SubscriptionCancelPlan.scss';
interface Props {
name: string;
info: string;
features: PlanCardFeatureDefinition[];
downgrade?: boolean;... | 6,766 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/SubscriptionContainer.scss | @import '~@proton/styles/scss/lib';
.subscription-modal {
&--large-width {
--size: #{rem(1200)};
--margin: #{rem(32)};
}
&--medium-width {
--size: #{rem(900)};
--margin: #{rem(24)};
}
}
@include media('>medium') {
// Set height to avoid it switching between steps
.subscription-modal--fixed-height {
b... | 6,767 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/SubscriptionContainer.test.tsx | import { fireEvent, render, waitFor } from '@testing-library/react';
import {
defaultSubscriptionCache,
mockOrganizationApi,
mockPlansCache,
mockSubscriptionCache,
mockUserCache,
mockUserVPNServersCountApi,
organizationDefaultResponse,
plansDefaultResponse,
} from '@proton/components/ho... | 6,768 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/SubscriptionContainer.tsx | import { FormEvent, ReactNode, RefObject, useEffect, useMemo, useRef, useState } from 'react';
import { c } from 'ttag';
import { Button } from '@proton/atoms';
import { getSimplePriceString } from '@proton/components/components/price/helper';
import { FeatureCode, useFlag } from '@proton/components/containers';
impo... | 6,769 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/SubscriptionCycleSelector.test.tsx | import { render } from '@testing-library/react';
import { CYCLE, PLANS } from '@proton/shared/lib/constants';
import SubscriptionCycleSelector, { Props } from './SubscriptionCycleSelector';
let props: Props;
beforeEach(() => {
props = {
onChangeCycle: jest.fn(),
mode: 'buttons',
currency... | 6,770 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/SubscriptionCycleSelector.tsx | import { ReactNode } from 'react';
import { c } from 'ttag';
import { CYCLE, DEFAULT_CURRENCY, MEMBER_ADDON_PREFIX } from '@proton/shared/lib/constants';
import { getCheckout } from '@proton/shared/lib/helpers/checkout';
import { getSupportedAddons } from '@proton/shared/lib/helpers/planIDs';
import {
TotalPricin... | 6,771 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/SubscriptionModalDisabled.tsx | import { c } from 'ttag';
import { Button, Href } from '@proton/atoms';
import { getKnowledgeBaseUrl } from '@proton/shared/lib/helpers/url';
import { Prompt, PromptProps } from '../../../components';
const SubscriptionModalDisabled = (props: Omit<PromptProps, 'title' | 'buttons' | 'children'>) => {
const learnM... | 6,772 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/SubscriptionModalProvider.test.tsx | import { render, waitFor } from '@testing-library/react';
import cloneDeep from 'lodash/cloneDeep';
import {
mockOrganizationApi,
mockPlansApi,
mockSubscriptionApi,
mockUserCache,
subscriptionDefaultResponse,
} from '@proton/components/hooks/helpers/test';
import { PLANS } from '@proton/shared/lib/... | 6,773 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/SubscriptionModalProvider.tsx | import { ReactNode, createContext, useContext, useRef } from 'react';
import { APP_NAMES } from '@proton/shared/lib/constants';
import { getHasLegacyPlans, isManagedExternally } from '@proton/shared/lib/helpers/subscription';
import { Nullable } from '@proton/shared/lib/interfaces';
import clsx from '@proton/utils/cls... | 6,774 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/SubscriptionPanelManageUserButton.tsx | import { c } from 'ttag';
import { Button, ButtonLike } from '@proton/atoms/Button';
import { AppLink, SettingsLink } from '@proton/components/components';
import { useConfig, useOrganization, useSubscription, useUser } from '@proton/components/hooks';
import { APPS } from '@proton/shared/lib/constants';
import { hasO... | 6,775 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/SubscriptionSubmitButton.tsx | import { c } from 'ttag';
import { PAYMENT_METHOD_TYPES, PaymentMethodType } from '@proton/components/payments/core';
import { PaypalProcessorHook } from '@proton/components/payments/react-extensions/usePaypal';
import { Currency, SubscriptionCheckResponse } from '@proton/shared/lib/interfaces';
import { Price, Prima... | 6,776 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/UnsubscribeButton.test.tsx | import { act, fireEvent, render, waitFor } from '@testing-library/react';
import cloneDeep from 'lodash/cloneDeep';
import { useModals } from '@proton/components/hooks';
import {
mockOrganizationApi,
mockPlansApi,
mockSubscriptionApi,
mockUserCache,
mockUserVPNServersCountApi,
subscriptionDefau... | 6,777 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/UnsubscribeButton.tsx | import { ReactNode } from 'react';
import { c } from 'ttag';
import { Button, ButtonProps } from '@proton/atoms';
import { useLoading } from '@proton/hooks';
import { deleteSubscription } from '@proton/shared/lib/api/payments';
import { getShouldCalendarPreventSubscripitionChange } from '@proton/shared/lib/calendar/p... | 6,778 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/UpgradeVpnSection.tsx | import { APP_NAMES } from '@proton/shared/lib/constants';
import { pick } from '@proton/shared/lib/helpers/object';
import { Loader } from '../../../components';
import { useLoad, usePlans, useSubscription, useUser, useVPNServersCount } from '../../../hooks';
import { SettingsSectionWide } from '../../account';
import... | 6,779 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/VPNPassPromotionButton.tsx | import { c } from 'ttag';
import { Button } from '@proton/atoms/Button';
import { CYCLE, PASS_APP_NAME } from '@proton/shared/lib/constants';
import { Currency } from '@proton/shared/lib/interfaces';
import Logo from '../../../components/logo/Logo';
import { getSimplePriceString } from '../../../components/price/help... | 6,780 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/YourPlanSection.scss | @import '~@proton/styles/scss/lib';
.your-plan-section-container {
display: grid;
& > div {
block-size: fit-content;
}
@include media('<=medium') {
grid-template-columns: repeat(1, 1fr);
}
}
.grid-column-3 {
grid-template-columns: repeat(3, 1fr);
@include media('<=large') {
grid-template-columns: repe... | 6,781 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/YourPlanSection.test.tsx | import { fireEvent, render, waitFor, within } from '@testing-library/react';
import {
useAddresses,
useCache,
useCalendars,
useConfig,
useFeature,
useOrganization,
usePlans,
useSubscription,
useUser,
useVPNServersCount,
} from '@proton/components/hooks';
import usePendingUserInv... | 6,782 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/YourPlanSection.tsx | import usePendingUserInvitations from '@proton/components/hooks/usePendingUserInvitations';
import { APP_NAMES } from '@proton/shared/lib/constants';
import { pick } from '@proton/shared/lib/helpers/object';
import { getHasVpnB2BPlan } from '@proton/shared/lib/helpers/subscription';
import clsx from '@proton/utils/clsx... | 6,783 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/constants.ts | export enum SUBSCRIPTION_STEPS {
NETWORK_ERROR,
PLAN_SELECTION,
CUSTOMIZATION,
CHECKOUT,
CHECKOUT_WITH_CUSTOMIZATION,
UPGRADE,
THANKS,
}
export const subscriptionModalClassName = 'subscription-modal';
| 6,784 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/index.ts | export { default as AutomaticSubscriptionModal } from './AutomaticSubscriptionModal';
export { default as DowngradeSubscriptionSection } from './DowngradeSubscriptionSection';
export { default as PlanCustomization } from './PlanCustomization';
export { default as PlanSelection } from './PlanSelection';
export { Subscri... | 6,785 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/subscriptionEligbility.ts | import { ADDON_NAMES, COUPON_CODES, CYCLE, PLANS, isFreeSubscription } from '@proton/shared/lib/constants';
import { getPlan } from '@proton/shared/lib/helpers/subscription';
import type { Plan, PlansMap, SubscriptionModel, UserModel } from '@proton/shared/lib/interfaces';
import type { OfferConfig } from '../../offer... | 6,786 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/useCheckoutModifiers.test.tsx | import { renderHook } from '@testing-library/react-hooks';
import { COUPON_CODES, CYCLE, PLANS } from '@proton/shared/lib/constants';
import { PlansMap, Renew, SubscriptionCheckResponse, SubscriptionModel } from '@proton/shared/lib/interfaces';
import { Model } from './SubscriptionContainer';
import { SUBSCRIPTION_ST... | 6,787 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/useCheckoutModifiers.tsx | import { useMemo } from 'react';
import { getCheckout } from '@proton/shared/lib/helpers/checkout';
import { getPlanIDs, isTrial } from '@proton/shared/lib/helpers/subscription';
import { PlansMap, SubscriptionCheckResponse, SubscriptionModel } from '@proton/shared/lib/interfaces';
import { Model } from './Subscripti... | 6,788 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/__mocks__/SubscriptionContainer.tsx | const SubscriptionContainer = jest.fn().mockImplementation(() => <>SubscriptionContainer</>);
export default SubscriptionContainer;
| 6,789 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/__mocks__/data.ts | import { PLANS, PLAN_TYPES } from '@proton/shared/lib/constants';
import {
Organization,
PendingInvitation,
Plan,
Subscription,
User,
VPNServersCountData,
} from '@proton/shared/lib/interfaces';
import { PLANS_MAP } from '@proton/testing/data';
import { UpsellCta } from '../helpers';
export co... | 6,790 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/cancelB2bSubscription/CancelB2bSubscriptionModal.tsx | import { useState } from 'react';
import { c } from 'ttag';
import { Button } from '@proton/atoms';
import {
Form,
InputFieldTwo,
ModalTwo as Modal,
ModalTwoContent as ModalContent,
ModalTwoFooter as ModalFooter,
ModalTwoHeader as ModalHeader,
ModalProps,
Option,
Prompt,
Select... | 6,791 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/cancelB2bSubscription/CancelB2bSubscriptionSection.tsx | import { c } from 'ttag';
import { Button } from '@proton/atoms/Button';
import { useModalState } from '@proton/components/components';
import { SettingsParagraph, SettingsSection } from '@proton/components/containers';
import { useSubscription } from '@proton/components/hooks';
import CancelB2bSubscriptionModal from... | 6,792 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/cancelSubscription/CancelSubscriptionModal.test.tsx | import { render } from '@testing-library/react';
import { subscriptionMock, upcomingSubscriptionMock } from '@proton/testing/data';
import { CancelSubscriptionModal } from './CancelSubscriptionModal';
jest.mock('@proton/components/components/portal/Portal');
const onResolve = jest.fn();
const onReject = jest.fn();
... | 6,793 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/cancelSubscription/CancelSubscriptionModal.tsx | import { c } from 'ttag';
import { Button } from '@proton/atoms';
import { getPlanTitle, hasVPN, hasVPNPassBundle } from '@proton/shared/lib/helpers/subscription';
import { SubscriptionModel } from '@proton/shared/lib/interfaces';
import { ModalProps, Prompt, Time } from '../../../../components';
import { ModalTwoPro... | 6,794 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/cancelSubscription/CancelSubscriptionSection.test.tsx | import { render } from '@testing-library/react';
import { mockSubscriptionCache, mockUserCache } from '@proton/components/hooks/helpers/test';
import { applyHOCs, withApi, withCache, withEventManager, withNotifications } from '@proton/testing/index';
import { CancelSubscriptionSection } from './CancelSubscriptionSect... | 6,795 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/cancelSubscription/CancelSubscriptionSection.tsx | import { c } from 'ttag';
import { Button } from '@proton/atoms/Button';
import { useSubscription, useUser } from '../../../../hooks';
import { SettingsParagraph, SettingsSection } from '../../../account';
import { useCancelSubscriptionFlow } from './useCancelSubscriptionFlow';
export const CancelSubscriptionSection... | 6,796 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/cancelSubscription/index.ts | export * from './CancelSubscriptionModal';
export * from './CancelSubscriptionSection';
export * from './types';
export * from './useCancelSubscriptionFlow';
| 6,797 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/cancelSubscription/types.tsx | export type CancelSubscriptionResult =
| {
status: 'kept';
}
| {
status: 'cancelled';
};
| 6,798 |
0 | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription | petrpan-code/ProtonMail/WebClients/packages/components/containers/payments/subscription/cancelSubscription/useCancelSubscriptionFlow.test.tsx | import { render } from '@testing-library/react';
import { renderHook } from '@testing-library/react-hooks';
import userEvent from '@testing-library/user-event';
import { changeRenewState } from '@proton/shared/lib/api/payments';
import { wait } from '@proton/shared/lib/helpers/promise';
import { Renew, SubscriptionMod... | 6,799 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.