From a15469698c2daf219e3c2eb99de153ca0d09fc9d Mon Sep 17 00:00:00 2001 From: Tagaishi Date: Tue, 25 Jul 2023 21:52:36 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20Tooltip=20background=20not=20use?= =?UTF-8?q?r=20selected=20anymore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Tiles/Widgets/WidgetsEditModal.tsx | 47 +++++++++++-------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/src/components/Dashboard/Tiles/Widgets/WidgetsEditModal.tsx b/src/components/Dashboard/Tiles/Widgets/WidgetsEditModal.tsx index aeadcf000..6dbbabda9 100644 --- a/src/components/Dashboard/Tiles/Widgets/WidgetsEditModal.tsx +++ b/src/components/Dashboard/Tiles/Widgets/WidgetsEditModal.tsx @@ -136,10 +136,11 @@ const WidgetOptionTypeSwitch: FC<{ handleChange: (key: string, value: IntegrationOptionsValueType) => void; }> = ({ option, widgetId, propName: key, value, handleChange }) => { const { t } = useTranslation([`modules/${widgetId}`, 'common']); - const { fn } = useMantineTheme(); + const { fn, colorScheme } = useMantineTheme(); switch (option.type) { case 'switch': + var info = option.info !== undefined ? option.info : false; return ( handleChange(key, ev.currentTarget.checked)} {...option.inputProps} /> - {option.info? - + {info? + : undefined } ); case 'text': + var info = option.info !== undefined ? option.info : false; return ( {t(`descriptor.settings.${key}.label`)} - {option.info? - + {info? + : undefined } @@ -174,12 +176,13 @@ const WidgetOptionTypeSwitch: FC<{ ); case 'multi-select': + var info = option.info !== undefined ? option.info : false; return ( {t(`descriptor.settings.${key}.label`)} - {option.info? - + {info? + : undefined } @@ -194,12 +197,13 @@ const WidgetOptionTypeSwitch: FC<{ ); case 'select': + var info = option.info !== undefined ? option.info : false; return ( {t(`descriptor.settings.${key}.label`)} - {option.info? - + {info? + : undefined } @@ -214,12 +218,13 @@ const WidgetOptionTypeSwitch: FC<{ ); case 'number': + var info = option.info !== undefined ? option.info : false; return ( {t(`descriptor.settings.${key}.label`)} - {option.info? - + {info? + : undefined } @@ -232,12 +237,13 @@ const WidgetOptionTypeSwitch: FC<{ ); case 'slider': + var info = option.info !== undefined ? option.info : false; return ( {t(`descriptor.settings.${key}.label`)} - {option.info? - + {info? + : undefined } @@ -264,6 +270,7 @@ const WidgetOptionTypeSwitch: FC<{ ); case 'draggable-list': + var info = option.info !== undefined ? option.info : false; /* eslint-disable no-case-declarations */ const typedVal = value as IDraggableListInputValue['defaultValue']; @@ -290,8 +297,8 @@ const WidgetOptionTypeSwitch: FC<{ {t(`descriptor.settings.${key}.label`)} - {option.info? - + {info? + : undefined } @@ -319,12 +326,13 @@ const WidgetOptionTypeSwitch: FC<{ ); case 'multiple-text': + var info = option.info !== undefined ? option.info : false; return ( {t(`descriptor.settings.${key}.label`)} - {option.info? - + {info? + : undefined } @@ -347,13 +355,14 @@ const WidgetOptionTypeSwitch: FC<{ ); case 'draggable-editable-list': + var info = option.info !== undefined ? option.info : false; const { t: translateDraggableList } = useTranslation('widgets/draggable-list'); return ( {t(`descriptor.settings.${key}.label`)} - {option.info? - + {info? + : undefined }