From bb4aafa1dfb1522d149e12b51c67ad18953db5f5 Mon Sep 17 00:00:00 2001 From: sylenien Date: Thu, 19 May 2022 11:56:59 +0200 Subject: [PATCH] fix(ui): code rvw --- .../DashboardMetricSelection.tsx | 13 +++++-------- .../dashboardMetricSelection.css | 11 ----------- .../components/WidgetWrapper/WidgetWrapper.tsx | 4 ++-- 3 files changed, 7 insertions(+), 21 deletions(-) delete mode 100644 frontend/app/components/Dashboard/components/DashboardMetricSelection/dashboardMetricSelection.css diff --git a/frontend/app/components/Dashboard/components/DashboardMetricSelection/DashboardMetricSelection.tsx b/frontend/app/components/Dashboard/components/DashboardMetricSelection/DashboardMetricSelection.tsx index a9858102c..c7dfff71f 100644 --- a/frontend/app/components/Dashboard/components/DashboardMetricSelection/DashboardMetricSelection.tsx +++ b/frontend/app/components/Dashboard/components/DashboardMetricSelection/DashboardMetricSelection.tsx @@ -3,8 +3,7 @@ import WidgetWrapper from '../WidgetWrapper'; import { useObserver } from 'mobx-react-lite'; import cn from 'classnames'; import { useStore } from 'App/mstore'; -import stl from 'App/components/Dashboard/components/WidgetWrapper/widgetWrapper.css'; -import ownStl from './dashboardMetricSelection.css'; +import stl from '../WidgetWrapper/widgetWrapper.css' function WidgetCategoryItem({ category, isSelected, onClick, selectedWidgetIds }) { const selectedCategoryWidgetsCount = useObserver(() => { @@ -50,7 +49,6 @@ function DashboardMetricSelection(props: IProps) { }; const toggleAllWidgets = ({ target: { checked }}) => { - // dashboardStore.toggleAllSelectedWidgets(checked); setSelectAllCheck(checked); if (checked) { dashboardStore.selectWidgetsByCategory(activeCategory.name); @@ -60,7 +58,7 @@ function DashboardMetricSelection(props: IProps) { } return useObserver(() => ( -
+
Categories
@@ -117,13 +115,12 @@ function DashboardMetricSelection(props: IProps) {
Create Metric diff --git a/frontend/app/components/Dashboard/components/DashboardMetricSelection/dashboardMetricSelection.css b/frontend/app/components/Dashboard/components/DashboardMetricSelection/dashboardMetricSelection.css deleted file mode 100644 index d134a7512..000000000 --- a/frontend/app/components/Dashboard/components/DashboardMetricSelection/dashboardMetricSelection.css +++ /dev/null @@ -1,11 +0,0 @@ -.addNew { - text-align: center; - color: $teal; - cursor: pointer; - background-color: white; - - &:hover { - background-color: $active-blue; - transition: all 0.2s; - } -} diff --git a/frontend/app/components/Dashboard/components/WidgetWrapper/WidgetWrapper.tsx b/frontend/app/components/Dashboard/components/WidgetWrapper/WidgetWrapper.tsx index 33025e687..27446db27 100644 --- a/frontend/app/components/Dashboard/components/WidgetWrapper/WidgetWrapper.tsx +++ b/frontend/app/components/Dashboard/components/WidgetWrapper/WidgetWrapper.tsx @@ -70,7 +70,7 @@ function WidgetWrapper(props: Props) { const ref: any = useRef(null) const dragDropRef: any = dragRef(dropRef(ref)) - const addOverlay = isTemplate || !isPredefined + const addOverlay = isTemplate || (!isPredefined && isWidget) return useObserver(() => (
Click to select} > - {isWidget && addOverlay && } + {addOverlay && }