| 1 |
/** |
| 2 |
* Background image styles. |
| 3 |
*/ |
| 4 |
|
| 5 |
const BackgroundImageStyles = (attributes) => { |
| 6 |
const styles = { |
| 7 |
backgroundImage: attributes.backgroundImgURL |
| 8 |
? `url(${attributes.backgroundImgURL})` |
| 9 |
: undefined, |
| 10 |
backgroundPosition: attributes.focalPoint |
| 11 |
? `${attributes.focalPoint.x * 100}% ${ |
| 12 |
attributes.focalPoint.y * 100 |
| 13 |
}%` |
| 14 |
: undefined, |
| 15 |
}; |
| 16 |
|
| 17 |
return styles; |
| 18 |
}; |
| 19 |
|
| 20 |
export default BackgroundImageStyles; |
| 21 |
|