Add a background image

This commit is contained in:
2017-09-14 19:38:54 +01:00
parent 6fac6fa4fd
commit 3d33eaf30c
5 changed files with 58 additions and 9 deletions

View File

@@ -0,0 +1,24 @@
import React from 'react';
import styled from 'styled-components';
class BackgroundImage extends React.Component {
render() {
return (
<BackgroundImg url={this.props.url} />
)
}
}
const BackgroundImg = styled.div`
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: ${props => props.url ? `url(${props.url}) no-repeat center center` : ''};
background-size: cover;
filter: blur(5px);
`;
export default BackgroundImage;