1 import { useHistory, useLocation } from 'react-router-dom';
3 import { c } from 'ttag';
5 import { Button, ButtonLike, Href } from '@proton/atoms';
6 import Copy from '@proton/components/components/button/Copy';
7 import DropdownMenuLink from '@proton/components/components/dropdown/DropdownMenuLink';
8 import type { ModalProps } from '@proton/components/components/modalTwo/Modal';
9 import ModalTwo from '@proton/components/components/modalTwo/Modal';
10 import ModalTwoContent from '@proton/components/components/modalTwo/ModalContent';
11 import SettingsParagraph from '@proton/components/containers/account/SettingsParagraph';
12 import SettingsSectionWide from '@proton/components/containers/account/SettingsSectionWide';
13 import { getWelcomeToText } from '@proton/shared/lib/apps/text';
14 import { VPN_APP_NAME } from '@proton/shared/lib/constants';
15 import onboardingVPNWelcome from '@proton/styles/assets/img/onboarding/vpn-welcome.svg';
17 import DownloadClientCard from '../../../components/downloadClientCard/DownloadClientCard';
18 import { useNotifications, useWelcomeFlags } from '../../../hooks';
19 import OnboardingContent from '../../onboarding/OnboardingContent';
21 interface DownloadModalProps extends ModalProps {
25 const DownloadModal = ({ downloadUrl, ...rest }: DownloadModalProps) => {
27 <ModalTwo {...rest} size="small">
28 <ModalTwoContent className="m-8 text-center">
30 img={<img src={onboardingVPNWelcome} alt={getWelcomeToText(VPN_APP_NAME)} />}
31 title={c('Title').t`Download ${VPN_APP_NAME}`}
32 description={c('Info').t`The securest way to browse, stream, and be online.`}
45 >{c('Action').t`Download`}</ButtonLike>
46 <Button color="norm" size="large" fullWidth shape="ghost" onClick={rest.onClose}>
47 {c('Action').t`Close`}
54 const ProtonVPNClientsSection = () => {
55 const history = useHistory();
56 const location = useLocation();
57 const [, setDone] = useWelcomeFlags();
58 const { createNotification } = useNotifications();
60 const androidLinks = [
62 href: 'https://protonvpn.com/download/ProtonVPN.apk',
66 href: 'https://github.com/ProtonVPN/android-app/releases',
70 href: 'https://f-droid.org/en/packages/ch.protonvpn.android/',
73 ].map(({ href, children }) => {
75 <div className="flex items-center overflow-hidden" key={children}>
76 <DropdownMenuLink className="flex-1" href={href}>
82 className="shrink-0 mr-2"
85 text: c('Success').t`Link copied to clipboard`,
96 downloadUrl="https://protonvpn.com/download"
97 open={location.search.includes('prompt')}
99 history.replace({ ...location, search: '' });
105 .t`To secure your internet connection, download and install the ${VPN_APP_NAME} application for your device and connect to a server.`}
107 <div className="flex gap-4 flex-column md:flex-row">
109 title={c('VPNClient').t`Android`}
111 link="https://play.google.com/store/apps/details?id=ch.protonvpn.android&utm_campaign=ww-all-2a-vpn-int_webapp-g_eng-apps_links_dashboard&utm_source=account.protonvpn.com&utm_medium=link&utm_content=dashboard&utm_term=android"
115 title={c('VPNClient').t`iOS`}
117 link="https://apps.apple.com/app/apple-store/id1437005085?pt=106513916&ct=protonvpn.com-dashboard&mt=8"
120 title={c('VPNClient').t`Windows`}
122 link="https://protonvpn.com/download-windows/"
125 title={c('VPNClient').t`macOS`}
127 link="https://protonvpn.com/download-macos/"
130 title={c('VPNClient').t`GNU/Linux`}
132 link="https://protonvpn.com/download-linux/"
135 title={c('VPNClient').t`Chromebook`}
137 link="https://play.google.com/store/apps/details?id=ch.protonvpn.android&utm_campaign=ww-all-2a-vpn-int_webapp-g_eng-apps_links_dashboard&utm_source=account.protonvpn.com&utm_medium=link&utm_content=dashboard&utm_term=chromebook"
141 title={c('VPNClient').t`Android TV`}
143 link="https://play.google.com/store/apps/details?id=ch.protonvpn.android&utm_campaign=ww-all-2a-vpn-int_webapp-g_eng-apps_links_dashboard&utm_source=account.protonvpn.com&utm_medium=link&utm_content=dashboard&utm_term=androidtv"
147 </SettingsSectionWide>
151 export default ProtonVPNClientsSection;