fix: remove button nesting (#3100)

This commit is contained in:
Opender Singh 2021-02-23 09:16:56 +13:00 committed by GitHub
parent eb4ae99f84
commit 958ba79256
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -3,7 +3,10 @@ import PropTypes from 'prop-types';
class DropdownButton extends PureComponent {
render() {
const { children, ...props } = this.props;
const { children, noWrap, ...props } = this.props;
if (noWrap) {
return <>{children}</>;
}
return (
<button type="button" {...props}>
{children}
@ -14,6 +17,7 @@ class DropdownButton extends PureComponent {
DropdownButton.propTypes = {
children: PropTypes.node,
noWrap: PropTypes.bool,
};
export default DropdownButton;

View File

@ -27,7 +27,7 @@ const StyledIconContainer = styled.div`
const AccountDropdown = ({ className }: Props) => (
<div className={className}>
<Dropdown>
<DropdownButton>
<DropdownButton noWrap>
<Tooltip delay={1000} position="bottom" message="Account">
<CircleButton>
<SvgIcon icon="user" />