Closes #5899 <img width="1280" alt="Index - banner" src="https://github.com/twentyhq/twenty/assets/71827178/313cf20d-eb34-496a-8c7c-7589fbd55954"> --------- Co-authored-by: Charles Bochet <charles@twenty.com>
43 lines
1.1 KiB
TypeScript
43 lines
1.1 KiB
TypeScript
import styled from '@emotion/styled';
|
|
import { JSX } from 'react';
|
|
import { IconComponent } from 'twenty-ui';
|
|
|
|
import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';
|
|
|
|
import { InformationBanner } from '@/information-banner/InformationBanner';
|
|
import { PageBody } from './PageBody';
|
|
import { PageHeader } from './PageHeader';
|
|
|
|
type SubMenuTopBarContainerProps = {
|
|
children: JSX.Element | JSX.Element[];
|
|
title: string;
|
|
Icon: IconComponent;
|
|
className?: string;
|
|
};
|
|
|
|
const StyledContainer = styled.div<{ isMobile: boolean }>`
|
|
display: flex;
|
|
flex-direction: column;
|
|
padding-top: ${({ theme, isMobile }) => (!isMobile ? theme.spacing(3) : 0)};
|
|
width: 100%;
|
|
`;
|
|
|
|
export const SubMenuTopBarContainer = ({
|
|
children,
|
|
title,
|
|
Icon,
|
|
className,
|
|
}: SubMenuTopBarContainerProps) => {
|
|
const isMobile = useIsMobile();
|
|
|
|
return (
|
|
<StyledContainer isMobile={isMobile} className={className}>
|
|
{isMobile && <PageHeader title={title} Icon={Icon} />}
|
|
<PageBody>
|
|
<InformationBanner />
|
|
{children}
|
|
</PageBody>
|
|
</StyledContainer>
|
|
);
|
|
};
|