From a341c430750293fc0f8d0c9f554dce8857a44c0f Mon Sep 17 00:00:00 2001 From: Eric Jinks Date: Tue, 27 Mar 2018 15:40:09 +1000 Subject: [PATCH] Update BackgroundImage --- src/components/BackgroundImage.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/BackgroundImage.js b/src/components/BackgroundImage.js index 25f4130..1f8f06e 100644 --- a/src/components/BackgroundImage.js +++ b/src/components/BackgroundImage.js @@ -9,7 +9,10 @@ import { getImageSrc } from '../util/getImageUrl' export default class BackgroundImage extends React.Component { static defaultProps = { lazy: false, - src: '' + src: '', + className: '', + contain: false, + opacity: 1 } state = { @@ -44,7 +47,7 @@ export default class BackgroundImage extends React.Component { } render () { - let className = this.props.className || '' + let { className, contain, opacity } = this.props if (this.state.loaded) className += ' BackgroundImage-lazy-loaded' if (this.props.lazy) className += ' BackgroundImage-lazy' const options = { @@ -56,12 +59,12 @@ export default class BackgroundImage extends React.Component { return (