8976 modify mobile page header (#9020)

Closes #8976
This commit is contained in:
Raphaël Bosi
2024-12-11 15:06:09 +01:00
committed by GitHub
parent 6067852c1c
commit ad04040ea6
5 changed files with 43 additions and 29 deletions

View File

@ -1,5 +1,5 @@
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
import { Button, IconButton, IconPlus } from 'twenty-ui';
import { Button, IconButton, IconPlus, useIsMobile } from 'twenty-ui';
type PageAddButtonProps = {
onClick?: () => void;
@ -9,16 +9,18 @@ export const PageAddButton = ({ onClick }: PageAddButtonProps) => {
const isPageHeaderV2Enabled = useIsFeatureEnabled(
'IS_PAGE_HEADER_V2_ENABLED',
);
const isMobile = useIsMobile();
return (
<>
{isPageHeaderV2Enabled ? (
<Button
Icon={IconPlus}
dataTestId="add-button"
size="small"
size={isMobile ? 'medium' : 'small'}
variant="secondary"
accent="default"
title="New record"
title={isMobile ? '' : 'New record'}
onClick={onClick}
ariaLabel="New record"
/>