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