1
0
mirror of https://github.com/yldio/copilot.git synced 2024-11-14 15:20:06 +02:00
copilot/ui/src/components/mini-metric/view.js

47 lines
861 B
JavaScript
Raw Normal View History

const constants = require('../../shared/constants');
2017-01-10 21:12:50 +02:00
const fns = require('../../shared/functions');
const React = require('react');
const Styled = require('styled-components');
const {
colors
} = constants;
2017-01-10 21:12:50 +02:00
const {
remcalc
} = fns;
const {
default: styled
} = Styled;
2017-01-10 21:12:50 +02:00
const Container = styled.div`
position: relative;
height: 100%;
width: 100%;
background-color: ${colors.miniBackground};
2017-01-10 21:12:50 +02:00
border: solid ${remcalc(1)} ${colors.borderSecondary};
`;
const Shadow = styled.div`
position: absolute;
height: 100%;
width: ${remcalc(9)};
left: 0;
top: 0;
background-image:
linear-gradient(to right, rgba(0, 0, 0, 0.1), rgba(216, 216, 216, 0));
`;
2017-01-10 21:12:50 +02:00
const View = (props) => (
<Container {...props}>
<Shadow />
{props.children}
</Container>
);
View.propTypes = {
children: React.PropTypes.node
};
module.exports = View;