1 import { useHistory, useLocation } from 'react-router-dom';
3 import { c } from 'ttag';
5 import { useWelcomeFlags } from '@proton/account';
6 import { Button, ButtonLike, Href } from '@proton/atoms';
7 import Copy from '@proton/components/components/button/Copy';
8 import DropdownMenuLink from '@proton/components/components/dropdown/DropdownMenuLink';
9 import type { ModalProps } from '@proton/components/components/modalTwo/Modal';
10 import ModalTwo from '@proton/components/components/modalTwo/Modal';
11 import ModalTwoContent from '@proton/components/components/modalTwo/ModalContent';
12 import SettingsParagraph from '@proton/components/containers/account/SettingsParagraph';
13 import SettingsSectionWide from '@proton/components/containers/account/SettingsSectionWide';
14 import useNotifications from '@proton/components/hooks/useNotifications';
15 import { getWelcomeToText } from '@proton/shared/lib/apps/text';
16 import { VPN_APP_NAME } from '@proton/shared/lib/constants';
17 import onboardingVPNWelcome from '@proton/styles/assets/img/onboarding/vpn-welcome.svg';
19 import DownloadClientCard from '../../../components/downloadClientCard/DownloadClientCard';
20 import OnboardingContent from '../../onboarding/OnboardingContent';
22 interface DownloadModalProps extends ModalProps {
26 const DownloadModal = ({ downloadUrl, ...rest }: DownloadModalProps) => {
28 <ModalTwo {...rest} size="small">
29 <ModalTwoContent className="m-8 text-center">
31 img={<img src={onboardingVPNWelcome} alt={getWelcomeToText(VPN_APP_NAME)} />}
32 title={c('Title').t`Download ${VPN_APP_NAME}`}
33 description={c('Info').t`The securest way to browse, stream, and be online.`}
46 >{c('Action').t`Download`}</ButtonLike>
47 <Button color="norm" size="large" fullWidth shape="ghost" onClick={rest.onClose}>
48 {c('Action').t`Close`}
55 const ProtonVPNClientsSection = () => {
56 const history = useHistory();
57 const location = useLocation();
58 const { setDone } = useWelcomeFlags();
59 const { createNotification } = useNotifications();
61 const androidLinks = [
63 href: 'https://protonvpn.com/download/ProtonVPN.apk',
67 href: 'https://github.com/ProtonVPN/android-app/releases',
71 href: 'https://f-droid.org/en/packages/ch.protonvpn.android/',
74 ].map(({ href, children }) => {
76 <div className="flex items-center overflow-hidden" key={children}>
77 <DropdownMenuLink className="flex-1" href={href}>
83 className="shrink-0 mr-2"
86 text: c('Success').t`Link copied to clipboard`,
97 downloadUrl="https://protonvpn.com/download"
98 open={location.search.includes('prompt')}
100 history.replace({ ...location, search: '' });
106 .t`To secure your internet connection, download and install the ${VPN_APP_NAME} application for your device and connect to a server.`}
108 <div className="flex gap-4 flex-column md:flex-row">
110 title={c('VPNClient').t`Android`}
112 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"
116 title={c('VPNClient').t`iOS`}
118 link="https://apps.apple.com/app/apple-store/id1437005085?pt=106513916&ct=protonvpn.com-dashboard&mt=8"
121 title={c('VPNClient').t`Windows`}
123 link="https://protonvpn.com/download-windows/"
126 title={c('VPNClient').t`macOS`}
128 link="https://protonvpn.com/download-macos/"
131 title={c('VPNClient').t`GNU/Linux`}
133 link="https://protonvpn.com/download-linux/"
136 title={c('VPNClient').t`Chromebook`}
138 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"
142 title={c('VPNClient').t`Android TV`}
144 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"
148 </SettingsSectionWide>
152 export default ProtonVPNClientsSection;