Skip to content
Snippets Groups Projects
Unverified Commit 9f2f7183 authored by Douglas Fabris's avatar Douglas Fabris Committed by GitHub
Browse files

chore: `ToolboxAction` pressed state (#29397)

parent d5a58932
No related branches found
No related tags found
No related merge requests found
......@@ -76,7 +76,6 @@ const ToolBox = ({ className }: ToolBoxProps): ReactElement => {
// }, [visibleActions.length, open]);
// TODO: Create helper for render Actions
// TODO: Add proper Vertical Divider Component
return (
<>
......@@ -87,7 +86,7 @@ const ToolBox = ({ className }: ToolBoxProps): ReactElement => {
title: t(title),
className,
index,
info: id === tab?.id,
pressed: id === tab?.id,
action,
key: id,
disabled,
......@@ -106,7 +105,7 @@ const ToolBox = ({ className }: ToolBoxProps): ReactElement => {
title: t(title),
className,
index,
info: id === tab?.id,
pressed: id === tab?.id,
action,
key: id,
disabled,
......
import { IconButton } from '@rocket.chat/fuselage';
import type { FC } from 'react';
import { forwardRef } from 'react';
const ToolBoxAction: FC<any> = forwardRef(function ToolBoxAction(
{ id, icon, color, action, className, index, title, 'data-tooltip': tooltip, ...props },
const ToolBoxAction = forwardRef<HTMLButtonElement, any>(function ToolBoxAction(
{ id, icon, action, index, title, 'data-tooltip': tooltip, ...props },
ref,
) {
return (
<IconButton
data-qa-id={`ToolBoxAction-${icon}`}
className={className}
ref={ref}
onClick={() => action(id)}
data-toolbox={index}
key={id}
icon={icon}
position='relative'
tiny
overflow='visible'
ref={ref}
color={!!color && color}
{...{ ...props, ...(tooltip ? { 'data-tooltip': tooltip, 'title': '' } : { title }) }}
{...(tooltip ? { 'data-tooltip': tooltip, 'title': '' } : { title })}
{...props}
/>
);
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment