mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
style
This commit is contained in:
parent
4c5db6483d
commit
85ba6bb05c
@ -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>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user