p5.js-web-editor/client/components/mobile/IconButton.jsx

26 lines
533 B
React
Raw Normal View History

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