1 import React from 'react';
3 import { c } from 'ttag';
5 import { ButtonLike } from '@proton/atoms';
6 import { Header, MainLogo, UnAuthenticated, UnAuthenticatedAppsDropdown, useConfig } from '@proton/components';
7 import Footer from '@proton/components/components/footer/Footer';
8 import { getAppHref, getAppName } from '@proton/shared/lib/apps/helper';
9 import { APPS, DRIVE_SHORT_APP_NAME } from '@proton/shared/lib/constants';
10 import { DRIVE_PRICING_PAGE } from '@proton/shared/lib/drive/urls';
11 import clsx from '@proton/utils/clsx';
13 import { usePublicSessionUser } from '../../../store';
14 import { UserInfo } from './UserInfo';
16 import './Layout.scss';
19 FooterComponent?: React.ReactNode;
20 children: React.ReactNode;
22 partialView?: boolean;
25 export default function SharedPageLayout({ FooterComponent, children, className, partialView }: Props) {
26 const { APP_NAME } = useConfig();
28 const { user, localID } = usePublicSessionUser();
30 const containerClassname = clsx([
31 'shared-page-layout-bg flex flex-nowrap flex-column h-full overflow-auto relative',
37 <div className={containerClassname}>
39 <Header className="header--wrap shadow-norm *:min-size-auto items-center h-auto">
40 <h1 className="sr-only">{getAppName(APP_NAME)}</h1>
41 <div className="logo-container p-0 md:p-4 flex justify-space-between items-center flex-nowrap w-auto">
42 <MainLogo to="/" reloadDocument />
43 <div className="hidden md:block">
44 <UnAuthenticatedAppsDropdown reloadDocument />
48 <div className="flex justify-end flex-nowrap items-center flex-1 self-center my-auto">
52 className="w-auto mr-4"
56 href={getAppHref('/', APPS.PROTONDRIVE, localID)}
59 {c('Action').t`Go to ${DRIVE_SHORT_APP_NAME}`}
61 <UserInfo user={user} />
65 className="w-full md:w-auto"
69 href={DRIVE_PRICING_PAGE}
72 {c('Action').t`Create free account`}
80 'shared-page-layout-container w-full flex flex-nowrap flex-column md:flex-row flex-1 px-4',
81 partialView ? 'md:px-5' : 'md:px-10'
84 <div className="flex-1 mb-4 md:mb-0 flex flex-column flex-nowrap">{children}</div>
86 <Footer className="justify-space-between items-center p-0 mt-6 md:mt-0">{FooterComponent}</Footer>