From d70987653b552aadf4422e65f5e81a4ef3742f0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Bosi?= <71827178+bosiraphael@users.noreply.github.com> Date: Tue, 10 Dec 2024 10:56:28 +0100 Subject: [PATCH] 8964 add feature flag is page header v2 enabled (#8995) Closes #8964 --- .../components/PageFavoriteButton.tsx | 39 +++++++++++----- .../components/RecordIndexPageHeader.tsx | 7 ++- .../PageHeaderOpenCommandMenuButton.tsx | 40 +++++++++++----- .../layout/page/components/PageAddButton.tsx | 46 +++++++++++++------ .../ui/layout/page/components/PageHeader.tsx | 25 +++++++++- .../components/ShowPageAddButton.tsx | 42 +++++++++++++---- .../modules/workspace/types/FeatureFlagKey.ts | 3 +- .../typeorm-seeds/core/feature-flags.ts | 5 ++ .../enums/feature-flag-key.enum.ts | 1 + 9 files changed, 160 insertions(+), 48 deletions(-) diff --git a/packages/twenty-front/src/modules/favorites/components/PageFavoriteButton.tsx b/packages/twenty-front/src/modules/favorites/components/PageFavoriteButton.tsx index d5c739df00..a286b984c5 100644 --- a/packages/twenty-front/src/modules/favorites/components/PageFavoriteButton.tsx +++ b/packages/twenty-front/src/modules/favorites/components/PageFavoriteButton.tsx @@ -1,4 +1,5 @@ -import { Button, IconHeart } from 'twenty-ui'; +import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled'; +import { Button, IconButton, IconHeart } from 'twenty-ui'; type PageFavoriteButtonProps = { isFavorite: boolean; @@ -10,16 +11,32 @@ export const PageFavoriteButton = ({ onClick, }: PageFavoriteButtonProps) => { const title = isFavorite ? 'Remove from favorites' : 'Add to favorites'; + const isPageHeaderV2Enabled = useIsFeatureEnabled( + 'IS_PAGE_HEADER_V2_ENABLED', + ); return ( -