From eb433185a126ac5a43757bf37b5f014a35149657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20G=C3=B3is?= Date: Wed, 14 Dec 2022 08:51:41 +0000 Subject: [PATCH] fix: remove tooltip from favorites cell, some refactoring (#2687) https://linear.app/unleash/issue/2-510/favorite-cell-tooltips-is-buggy-when-pinned-remove-tooltips Tooltips were buggy when using the pinned feature, so I aligned with @NicolaeUnleash and decided to remove them for now: image Also includes a slight refactor on this component. --- .../FavoriteIconCell/FavoriteIconCell.tsx | 57 +++++++++---------- 1 file changed, 27 insertions(+), 30 deletions(-) diff --git a/frontend/src/component/common/Table/cells/FavoriteIconCell/FavoriteIconCell.tsx b/frontend/src/component/common/Table/cells/FavoriteIconCell/FavoriteIconCell.tsx index 537c9a84ee..ad28a4cd0a 100644 --- a/frontend/src/component/common/Table/cells/FavoriteIconCell/FavoriteIconCell.tsx +++ b/frontend/src/component/common/Table/cells/FavoriteIconCell/FavoriteIconCell.tsx @@ -5,49 +5,46 @@ import { StarBorder as StarBorderIcon, } from '@mui/icons-material'; import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; -import { TooltipResolver } from 'component/common/TooltipResolver/TooltipResolver'; + +const StyledCell = styled(Box)(({ theme }) => ({ + paddingLeft: theme.spacing(1.25), +})); + +const StyledIconButton = styled(IconButton)(({ theme }) => ({ + color: theme.palette.primary.main, + padding: theme.spacing(1.25), +})); + +const StyledIconButtonInactive = styled(StyledIconButton)({ + opacity: 0, +}); interface IFavoriteIconCellProps { value?: boolean; onClick?: () => void; } -const InactiveIconButton = styled(IconButton)(({ theme }) => ({ - color: theme.palette.primary.main, - opacity: 0, -})); - export const FavoriteIconCell: VFC = ({ - value = false, + value, onClick, }) => ( - + - - - - + + + } elseShow={ - - - - - + + + } /> - + );