feat: add back button in company details top bar (#729)

* feat: add back button in company details top bar

Closes #636

* Add back button on person page

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Thaïs
2023-07-18 18:33:37 +02:00
committed by GitHub
parent 434ea605a8
commit fdb2011a96
4 changed files with 33 additions and 4 deletions

View File

@ -9,6 +9,7 @@ import { RightDrawerContainer } from './RightDrawerContainer';
type OwnProps = {
children: JSX.Element | JSX.Element[];
title: string;
hasBackButton?: boolean;
icon: ReactNode;
onAddButtonClick?: () => void;
};
@ -22,13 +23,19 @@ const StyledContainer = styled.div`
export function WithTopBarContainer({
children,
title,
hasBackButton,
icon,
onAddButtonClick,
}: OwnProps) {
return (
<StyledContainer>
<TopBarHotkeys onAddButtonClick={onAddButtonClick} />
<TopBar title={title} icon={icon} onAddButtonClick={onAddButtonClick} />
<TopBar
title={title}
hasBackButton={hasBackButton}
icon={icon}
onAddButtonClick={onAddButtonClick}
/>
<RightDrawerContainer topMargin={TOP_BAR_MIN_HEIGHT + 16 + 16}>
{children}
</RightDrawerContainer>