This commit is contained in:
Jan Prochazka 2020-04-26 08:56:01 +02:00
parent 4c5db6483d
commit 85ba6bb05c

View File

@ -35,6 +35,11 @@ const StyledIconSpan = styled.span`
color: ${(props) => (props.disabled ? 'gray' : 'blue')};
`;
const ButtonDivInner = styled.div`
position: relative;
top: 2px;
`;
export default function ToolbarButton({ children, onClick, icon = undefined, disabled = undefined }) {
const Icon = icon;
return (
@ -44,12 +49,14 @@ export default function ToolbarButton({ children, onClick, icon = undefined, dis
}}
disabled={disabled}
>
<ButtonDivInner>
{Icon && (
<StyledIconSpan disabled={disabled}>
<i className={icon} />
</StyledIconSpan>
)}
{children}
</ButtonDivInner>
</ButtonDiv>
);
}