2020-06-16 20:38:43 +00:00
|
|
|
import React from 'react';
|
2020-06-29 21:35:00 +00:00
|
|
|
import PropTypes from 'prop-types';
|
2020-06-16 20:38:43 +00:00
|
|
|
import styled from 'styled-components';
|
2020-06-29 21:35:00 +00:00
|
|
|
import Button from '../../common/Button';
|
2020-06-30 19:41:26 +00:00
|
|
|
import { remSize } from '../../theme';
|
2020-06-16 20:38:43 +00:00
|
|
|
|
2020-06-29 21:35:00 +00:00
|
|
|
const ButtonWrapper = styled(Button)`
|
2020-06-30 19:41:26 +00:00
|
|
|
width: ${remSize(48)};
|
2020-06-16 20:38:43 +00:00
|
|
|
> svg {
|
|
|
|
width: 100%;
|
2020-06-29 22:54:48 +00:00
|
|
|
height: 100%;
|
2020-06-16 20:38:43 +00:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2020-06-29 22:54:48 +00:00
|
|
|
const IconButton = props => (<ButtonWrapper
|
|
|
|
iconBefore={props.children}
|
2020-06-29 21:35:00 +00:00
|
|
|
kind={Button.kinds.inline}
|
2020-06-29 22:54:48 +00:00
|
|
|
{...{ ...props, children: null }}
|
2020-06-29 21:35:00 +00:00
|
|
|
/>);
|
|
|
|
|
|
|
|
IconButton.propTypes = {
|
|
|
|
children: PropTypes.element.isRequired
|
|
|
|
};
|
|
|
|
|
2020-06-16 20:38:43 +00:00
|
|
|
export default IconButton;
|