From 86d4ad900c4c5ad22dedf579a5a324c91df73c71 Mon Sep 17 00:00:00 2001 From: sylenien Date: Wed, 14 Sep 2022 17:03:07 +0200 Subject: [PATCH] fix(ui): fix dashboard add button --- .../DashboardWidgetGrid/AddMetricContainer.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/app/components/Dashboard/components/DashboardWidgetGrid/AddMetricContainer.tsx b/frontend/app/components/Dashboard/components/DashboardWidgetGrid/AddMetricContainer.tsx index 1620dfca4..b1d84f54e 100644 --- a/frontend/app/components/Dashboard/components/DashboardWidgetGrid/AddMetricContainer.tsx +++ b/frontend/app/components/Dashboard/components/DashboardWidgetGrid/AddMetricContainer.tsx @@ -8,7 +8,7 @@ import AddPredefinedMetric from './AddPredefinedMetric'; import cn from 'classnames'; interface AddMetricButtonProps { - iconName: string; + iconName: "bar-pencil" | "grid-check"; title: string; description: string; isPremade?: boolean; @@ -49,8 +49,8 @@ function AddMetricButton({ iconName, title, description, onClick, isPremade, isP interface Props { siteId: string - isPopup: boolean - onAction: () => void + isPopup?: boolean + onAction?: () => void } function AddMetricContainer({ siteId, isPopup, onAction }: Props) { @@ -58,7 +58,7 @@ function AddMetricContainer({ siteId, isPopup, onAction }: Props) { const { dashboardStore } = useStore(); const onAddCustomMetrics = () => { - onAction() + onAction?.() dashboardStore.initDashboard(dashboardStore.selectedDashboard); showModal( { - onAction() + onAction?.() dashboardStore.initDashboard(dashboardStore.selectedDashboard); showModal(