1
0
mirror of https://github.com/yldio/copilot.git synced 2024-09-22 14:23:50 +03:00
copilot/ui/src/components/close/index.js

45 lines
727 B
JavaScript
Raw Normal View History

2017-01-10 18:52:08 +02:00
const React = require('react');
const Styled = require('styled-components');
2017-01-10 19:00:23 +02:00
const closeIcon = require('../../shared/assets/close.png');
const fns = require('../../shared/functions');
2017-01-10 18:52:08 +02:00
const {
default: styled
} = Styled;
const {
remcalc
} = fns;
2017-01-10 19:00:23 +02:00
const StyledButton = styled.button`
background: none;
border: none;
position: absolute;
top: ${remcalc(16)};
right: ${remcalc(16)};
2017-01-10 19:00:23 +02:00
`;
2017-01-10 18:52:08 +02:00
const Close = ({
style,
onClick
}) => {
return (
<StyledButton
onClick={onClick}
2017-01-10 19:00:23 +02:00
style={style}
2017-01-10 18:52:08 +02:00
>
2017-01-10 19:00:23 +02:00
<img
alt="Close"
src={closeIcon}
/>
2017-01-10 18:52:08 +02:00
</StyledButton>
);
};
Close.propTypes = {
2017-01-10 19:00:23 +02:00
onClick: React.PropTypes.func,
style: React.PropTypes.object
2017-01-10 18:52:08 +02:00
};
module.exports = Close;