1 import { type FC, useState } from 'react';
3 import { c } from 'ttag';
5 import { Button } from '@proton/atoms';
6 import { ModalTwoHeader } from '@proton/components';
7 import PassLogo from '@proton/components/components/logo/PassLogo';
8 import { usePassCore } from '@proton/pass/components/Core/PassCoreProvider';
9 import { PASS_BLOG_TRIAL_URL } from '@proton/pass/constants';
10 import { PASS_APP_NAME } from '@proton/shared/lib/constants';
11 import clsx from '@proton/utils/clsx';
13 import './UpsellFloatingModal.scss';
15 type UpsellFloatingModalProps = {
22 export const UpsellFloatingModal: FC<UpsellFloatingModalProps> = ({ className, title, subtitle, badgeText }) => {
23 const { onLink } = usePassCore();
24 const [showModal, setShowModal] = useState(true);
29 'fixed bottom-custom right-custom rounded-xl overflow-hidden',
30 showModal ? className : 'hidden'
32 style={{ '--bottom-custom': '2rem', '--right-custom': '2rem' }}
34 <div className="w-custom" style={{ '--w-custom': '20rem' }}>
35 <header className="pass-upsell-floating-modal--header p-10">
37 closeButtonProps={{ pill: true, icon: true }}
38 className="absolute top-custom right-custom"
39 style={{ '--top-custom': '1rem', '--right-custom': '1rem' }}
40 onClick={() => setShowModal(false)}
45 style={{ '--logo-text-product-color': 'white', '--logo-text-proton-color': 'white' }}
48 <div className="pass-upsell-floating-modal--content text-left flex flex-column items-start gap-2 p-4 color-invert">
50 <span className="pass-upsell-floating-modal--label rounded-lg text-bold text-sm py-1 px-4">
55 <h1 className="text-lg text-bold">{title}</h1>
56 {subtitle && <span className="text-sm">{subtitle}</span>}
59 className="pass-upsell-floating-modal--button w-full mt-2"
63 onClick={() => onLink(PASS_BLOG_TRIAL_URL)}
65 {c('Action').t`Get ${PASS_APP_NAME}`}