import * as styles from './layerStyles' ; import { styleReducer , getSVG } from '../utils' ; const getSvgBackground = ( id , frame , svgs ) : next . css . BackgroundImage | null => { const svg = getSVG ( svgs , id ) ; if ( svg ) { return { backgroundImage : `url(${ svg ? svg . src : null })` , backgroundRepeat : 'no-repeat' , backgroundSize : `${ frame . width } ${ frame . height }` , backgroundPosition : 'center center' } ; } else { return null ; } } ; const shapeStyles = ( layer , svgs ) => { const baseStyles = styles . createBaseLayerStyles ( layer ) ; const background = getSvgBackground ( layer . id , layer . frame , svgs ) ; const combined = [ baseStyles , background ] ; return styleReducer ( combined ) ; } ; export default shapeStyles ;