connect line chart to backend (#15657)
https://github.com/user-attachments/assets/b797c5a8-32a8-4d3e-9fb1-7541d107a19f optimizations: before: https://github.com/user-attachments/assets/bf45a3f1-5f89-40c1-9ce4-c2d912b77d63 after: https://github.com/user-attachments/assets/61bfd603-7b63-4695-8ae8-68fe7d3bfea0
This commit is contained in:
+1
-1
@@ -58,7 +58,7 @@ export const WidgetPlaceholder = () => {
|
||||
onClick={handleClick}
|
||||
>
|
||||
<WidgetCardHeader
|
||||
isWidgetCardHovered={false}
|
||||
widgetId="widget-placeholder"
|
||||
isInEditMode={isPageLayoutInEditMode}
|
||||
isResizing={false}
|
||||
title={t`Add Widget`}
|
||||
|
||||
@@ -14,8 +14,10 @@ import { WidgetCard } from '@/page-layout/widgets/widget-card/components/WidgetC
|
||||
import { WidgetCardContent } from '@/page-layout/widgets/widget-card/components/WidgetCardContent';
|
||||
import { WidgetCardHeader } from '@/page-layout/widgets/widget-card/components/WidgetCardHeader';
|
||||
import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';
|
||||
import { useSetRecoilComponentFamilyState } from '@/ui/utilities/state/component-state/hooks/useSetRecoilComponentFamilyState';
|
||||
import { widgetCardHoveredComponentFamilyState } from '@/page-layout/widgets/states/widgetCardHoveredComponentFamilyState';
|
||||
import { useTheme } from '@emotion/react';
|
||||
import { useState, type MouseEvent } from 'react';
|
||||
import { type MouseEvent } from 'react';
|
||||
import { IconLock } from 'twenty-ui/display';
|
||||
import { PageLayoutType, type PageLayoutWidget } from '~/generated/graphql';
|
||||
|
||||
@@ -71,7 +73,10 @@ export const WidgetRenderer = ({ widget }: WidgetRendererProps) => {
|
||||
deletePageLayoutWidget(widget.id);
|
||||
};
|
||||
|
||||
const [isHovered, setIsHovered] = useState(false);
|
||||
const setIsHovered = useSetRecoilComponentFamilyState(
|
||||
widgetCardHoveredComponentFamilyState,
|
||||
widget.id,
|
||||
);
|
||||
|
||||
const handleMouseEnter = () => {
|
||||
setIsHovered(true);
|
||||
@@ -95,7 +100,7 @@ export const WidgetRenderer = ({ widget }: WidgetRendererProps) => {
|
||||
>
|
||||
{showHeader && (
|
||||
<WidgetCardHeader
|
||||
isWidgetCardHovered={isHovered}
|
||||
widgetId={widget.id}
|
||||
isInEditMode={isPageLayoutInEditMode}
|
||||
isResizing={isResizing}
|
||||
title={widget.title}
|
||||
|
||||
Reference in New Issue
Block a user