diff --git a/src/pages/Dashboard/IconButtonWithDot.tsx b/src/pages/Dashboard/IconButtonWithDot.tsx index 271b7f96..db0acfb1 100644 --- a/src/pages/Dashboard/IconButtonWithDot.tsx +++ b/src/pages/Dashboard/IconButtonWithDot.tsx @@ -1,40 +1,47 @@ import { IconButton } from '@status-im/components' +import { useDispatch } from 'react-redux' import { Stack } from 'tamagui' +import { toggleButtonSelection } from '../../redux/Sidebars/slice' type IconButtonWithDotProps = { - iconEl: any - variant: 'ghost' | 'outline' - isDotOn: boolean - selected?: boolean - disabled?: boolean + iconEl: any + variant: 'ghost' | 'outline' + isDotOn: boolean + selected?: boolean + disabled?: boolean + id: string } const IconButtonWithDot = ({ - iconEl, - variant, - isDotOn, - selected, - disabled, + iconEl, + variant, + isDotOn, + selected, + disabled, + id }: IconButtonWithDotProps) => { - return ( - - - {isDotOn && ( - - )} - - ) + const dispatch = useDispatch() + const onClickHandler = (id) => { if (!disabled) dispatch(toggleButtonSelection(id)) } + + return ( + + onClickHandler(id)} /> + {isDotOn && ( + + )} + + ) } export default IconButtonWithDot