2017-01-10 20:06:01 +02:00
|
|
|
const constants = require('../../shared/constants');
|
2017-01-10 21:12:50 +02:00
|
|
|
const fns = require('../../shared/functions');
|
|
|
|
const React = require('react');
|
2017-01-10 20:06:01 +02:00
|
|
|
const Styled = require('styled-components');
|
|
|
|
|
|
|
|
const {
|
|
|
|
colors
|
|
|
|
} = constants;
|
|
|
|
|
2017-01-10 21:12:50 +02:00
|
|
|
const {
|
|
|
|
remcalc
|
|
|
|
} = fns;
|
|
|
|
|
2017-01-10 20:06:01 +02:00
|
|
|
const {
|
|
|
|
default: styled
|
|
|
|
} = Styled;
|
|
|
|
|
2017-01-11 16:14:26 +02:00
|
|
|
const border = (props) => !props.borderless
|
|
|
|
? `solid ${remcalc(1)} ${colors.borderSecondary}`
|
|
|
|
: 'none';
|
|
|
|
|
2017-01-10 21:12:50 +02:00
|
|
|
const Container = styled.div`
|
|
|
|
position: relative;
|
|
|
|
height: 100%;
|
|
|
|
width: 100%;
|
2017-01-10 20:06:01 +02:00
|
|
|
background-color: ${colors.miniBackground};
|
2017-01-11 16:14:26 +02:00
|
|
|
border: ${border};
|
2017-01-10 21:12:50 +02:00
|
|
|
`;
|
|
|
|
|
|
|
|
const Shadow = styled.div`
|
2017-01-11 16:14:26 +02:00
|
|
|
z-index: 1;
|
2017-01-10 21:12:50 +02:00
|
|
|
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 20:06:01 +02:00
|
|
|
`;
|
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;
|