Update all non-major dependencies
[ProtonMail-WebClient.git] / applications / pass-desktop / src / app / Views / WelcomeScreen / WelcomeScreen.tsx
blobebe2dc56152ee0e17611abe9062a64dc47c28d19
1 import { type FC, useMemo } from 'react';
3 import { useAuthService } from 'proton-pass-web/app/Auth/AuthServiceProvider';
4 import { c } from 'ttag';
6 import { Button } from '@proton/atoms/Button/Button';
7 import onboarding1 from '@proton/pass/assets/desktop-onboarding/onboarding-1.png';
8 import onboarding2 from '@proton/pass/assets/desktop-onboarding/onboarding-2.png';
9 import onboarding3 from '@proton/pass/assets/desktop-onboarding/onboarding-3.png';
10 import onboarding4 from '@proton/pass/assets/desktop-onboarding/onboarding-4.png';
11 import onboarding5 from '@proton/pass/assets/desktop-onboarding/onboarding-5.png';
12 import onboarding6 from '@proton/pass/assets/desktop-onboarding/onboarding-6.png';
13 import onboarding7 from '@proton/pass/assets/desktop-onboarding/onboarding-7.png';
14 import { Carousel, type CarouselItem } from '@proton/pass/components/Carousel/Carousel';
15 import { useConnectivity } from '@proton/pass/components/Core/ConnectivityProvider';
16 import { PassTextLogo } from '@proton/pass/components/Layout/Logo/PassTextLogo';
17 import { usePassConfig } from '@proton/pass/hooks/usePassConfig';
18 import { ForkType } from '@proton/shared/lib/authentication/fork/constants';
19 import { APPS, BRAND_NAME, PASS_APP_NAME } from '@proton/shared/lib/constants';
20 import protonPassIcon from '@proton/styles/assets/img/pass/protonpass-icon.svg';
22 import { dismissFirstLaunch } from '../../firstLaunch';
24 import './WelcomeScreen.scss';
26 export const WelcomeScreen: FC = () => {
27     const authService = useAuthService();
28     const online = useConnectivity();
29     const { SSO_URL: host } = usePassConfig();
31     const onRegister = () => {
32         dismissFirstLaunch();
33         authService.requestFork({ host, app: APPS.PROTONPASS, forkType: ForkType.SIGNUP });
34     };
36     const onFork = () => {
37         dismissFirstLaunch();
38         authService.requestFork({ host, app: APPS.PROTONPASS, forkType: ForkType.SWITCH });
39     };
41     const steps = useMemo<CarouselItem[]>(
42         () => [
43             {
44                 image: onboarding1,
45                 title: c('Label').t`Free password manager with identity protection`,
46                 description: c('Label')
47                     .t`Securely store, share and auto-login your accounts with ${PASS_APP_NAME}, using end-to-end encryption trusted by millions`,
48             },
49             {
50                 image: onboarding2,
51                 title: c('Label').t`Sign in faster with ${PASS_APP_NAME}`,
52                 description: c('Label')
53                     .t`${PASS_APP_NAME} recognizes the websites and apps you use and autofills forms with your credentials for you on any browser or device. No need to copy and paste.`,
54             },
55             {
56                 image: onboarding3,
57                 title: c('Label').t`Hide-my-email aliases`,
58                 description: c('Label')
59                     .t`Besides storing your logins, ${PASS_APP_NAME} protects your identity with an integrated email alias feature. Whenever you sign up for a new online account, ${PASS_APP_NAME} can automatically create an alias to keep your actual email address protected. `,
60             },
61             {
62                 image: onboarding4,
63                 title: c('Label').t`Integrated 2FA authenticator`,
64                 description: c('Label')
65                     .t`Two-factor authentication (2FA) is one of the best ways to protect your accounts online. ${PASS_APP_NAME} makes 2FA easier with an integrated authenticator that stores your 2FA codes and automatically displays and autofills them.`,
66             },
67             {
68                 image: onboarding5,
69                 title: c('Label').t`Secure password sharing`,
70                 description: c('Label')
71                     .t`Easily share sensitive information with anyone, even if they don't use ${PASS_APP_NAME}. You can share a single password, note, or credit card, or multiple items in the same folder.`,
72             },
73             {
74                 image: onboarding6,
75                 title: c('Label').t`Dark Web Monitoring`,
76                 description: c('Label')
77                     .t`Receive immediate alerts if your personal information is leaked in a third-party data breach. You can monitor multiple email addresses or your own domain name.`,
78             },
79             {
80                 image: onboarding7,
81                 title: c('Label').t`Securely log in with passkeys`,
82                 description: c('Label')
83                     .t`Passkeys are an easy and secure alternative to traditional passwords that prevent phishing attacks and make your online experience smoother.  ${PASS_APP_NAME} supports passkeys on all platforms.`,
84             },
85         ],
86         []
87     );
89     return (
90         <div id="desktop-lobby" className="flex flex-column h-full items-center justify-center py-4 flex-nowrap">
91             <div className="flex items-center justify-center pb-7 w-full pointer-events-none">
92                 <img src={protonPassIcon} className="w-custom" style={{ '--w-custom': '1.75rem' }} alt="" />
93                 <PassTextLogo // we have margin on both sides because depending on the language this logo may be on the left or right
94                     className="h-custom shrink-0 mx-2"
95                     style={{ '--h-custom': '1.2rem', fill: 'var(--text-norm)' }}
96                     key="brand"
97                 />
98             </div>
100             <Carousel
101                 steps={steps}
102                 className="w-full max-w-custom"
103                 style={{ '--max-w-custom': '33.5rem' }}
104                 textClassName="h-custom"
105                 textStyle={{ '--h-custom': '5.5rem' }}
106             />
108             <div className="flex flex-column gap-2 mt-12 w-full max-w-custom" style={{ '--max-w-custom': '22.5rem' }}>
109                 <Button pill shape="solid" color="norm" onClick={onFork} disabled={!online}>
110                     {c('Action').t`Sign in with ${BRAND_NAME}`}
111                 </Button>
113                 <Button pill shape="ghost" color="norm" onClick={onRegister} disabled={!online}>
114                     {c('Action').t`Create a ${BRAND_NAME} account`}
115                 </Button>
116             </div>
117         </div>
118     );