-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
8964 add feature flag is page header v2 enabled (#8995)
Closes #8964
- Loading branch information
1 parent
228b738
commit d709876
Showing
9 changed files
with
160 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 29 additions & 11 deletions
40
...ty-front/src/modules/ui/layout/page-header/components/PageHeaderOpenCommandMenuButton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,38 @@ | ||
import { Button, IconDotsVertical } from 'twenty-ui'; | ||
import { Button, IconButton, IconDotsVertical } from 'twenty-ui'; | ||
|
||
import { useCommandMenu } from '@/command-menu/hooks/useCommandMenu'; | ||
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled'; | ||
|
||
export const PageHeaderOpenCommandMenuButton = () => { | ||
const { openCommandMenu } = useCommandMenu(); | ||
|
||
const isPageHeaderV2Enabled = useIsFeatureEnabled( | ||
'IS_PAGE_HEADER_V2_ENABLED', | ||
); | ||
|
||
return ( | ||
<Button | ||
Icon={IconDotsVertical} | ||
dataTestId="page-header-open-command-menu-button" | ||
size="small" | ||
variant="secondary" | ||
accent="default" | ||
shortcut="⌘K" | ||
ariaLabel="Open command menu" | ||
onClick={openCommandMenu} | ||
/> | ||
<> | ||
{isPageHeaderV2Enabled ? ( | ||
<Button | ||
Icon={IconDotsVertical} | ||
dataTestId="page-header-open-command-menu-button" | ||
size="small" | ||
variant="secondary" | ||
accent="default" | ||
shortcut="⌘K" | ||
ariaLabel="Open command menu" | ||
onClick={openCommandMenu} | ||
/> | ||
) : ( | ||
<IconButton | ||
Icon={IconDotsVertical} | ||
size="medium" | ||
dataTestId="more-showpage-button" | ||
accent="default" | ||
variant="secondary" | ||
onClick={openCommandMenu} | ||
/> | ||
)} | ||
</> | ||
); | ||
}; |
46 changes: 33 additions & 13 deletions
46
packages/twenty-front/src/modules/ui/layout/page/components/PageAddButton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,38 @@ | ||
import { Button, IconPlus } from 'twenty-ui'; | ||
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled'; | ||
import { Button, IconButton, IconPlus } from 'twenty-ui'; | ||
|
||
type PageAddButtonProps = { | ||
onClick?: () => void; | ||
}; | ||
|
||
export const PageAddButton = ({ onClick }: PageAddButtonProps) => ( | ||
<Button | ||
Icon={IconPlus} | ||
dataTestId="add-button" | ||
size="small" | ||
variant="secondary" | ||
accent="default" | ||
title="New record" | ||
onClick={onClick} | ||
ariaLabel="New record" | ||
/> | ||
); | ||
export const PageAddButton = ({ onClick }: PageAddButtonProps) => { | ||
const isPageHeaderV2Enabled = useIsFeatureEnabled( | ||
'IS_PAGE_HEADER_V2_ENABLED', | ||
); | ||
return ( | ||
<> | ||
{isPageHeaderV2Enabled ? ( | ||
<Button | ||
Icon={IconPlus} | ||
dataTestId="add-button" | ||
size="small" | ||
variant="secondary" | ||
accent="default" | ||
title="New record" | ||
onClick={onClick} | ||
ariaLabel="New record" | ||
/> | ||
) : ( | ||
<IconButton | ||
Icon={IconPlus} | ||
dataTestId="add-button" | ||
size="medium" | ||
variant="secondary" | ||
accent="default" | ||
ariaLabel="Add" | ||
onClick={onClick} | ||
/> | ||
)} | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters