Skip to content

The open alternative to Salesforce, designed for AI.

Fix favorite button (#9001)

Raphaël Bosi90d47a8fcabc
diff --git a/packages/twenty-front/src/modules/favorites/components/PageFavoriteButton.tsx b/packages/twenty-front/src/modules/favorites/components/PageFavoriteButton.tsx
index a286b984c58..576de925ad9 100644
--- a/packages/twenty-front/src/modules/favorites/components/PageFavoriteButton.tsx
+++ b/packages/twenty-front/src/modules/favorites/components/PageFavoriteButton.tsx
@@ -1,5 +1,5 @@
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
-import { Button, IconButton, IconHeart } from 'twenty-ui';
+import { Button, IconButton, IconHeart, IconHeartOff } from 'twenty-ui';
type PageFavoriteButtonProps = {
isFavorite: boolean;
@@ -11,18 +11,20 @@ export const PageFavoriteButton = ({
onClick,
}: PageFavoriteButtonProps) => {
const title = isFavorite ? 'Remove from favorites' : 'Add to favorites';
+
const isPageHeaderV2Enabled = useIsFeatureEnabled(
'IS_PAGE_HEADER_V2_ENABLED',
);
+
return (
<>
{isPageHeaderV2Enabled ? (
<Button
- Icon={IconHeart}
+ Icon={isFavorite ? IconHeartOff : IconHeart}
dataTestId="favorite-button"
size="small"
variant="secondary"
- accent={isFavorite ? 'danger' : 'default'}
+ accent="default"
title={title}
onClick={onClick}
ariaLabel={title}