From ce7f73e89dee33feeb7f51ecf1213f18559ede76 Mon Sep 17 00:00:00 2001 From: Gerardo Pacheco Date: Wed, 4 Dec 2019 09:22:08 +0100 Subject: [PATCH 1/2] [RNMobile] Adds missing imageFillStyles implementation in Media & Text block --- .../src/media-text/media-container.native.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/block-library/src/media-text/media-container.native.js b/packages/block-library/src/media-text/media-container.native.js index 8ad8304cab8fc1..280137db139db4 100644 --- a/packages/block-library/src/media-text/media-container.native.js +++ b/packages/block-library/src/media-text/media-container.native.js @@ -44,6 +44,15 @@ import SvgIconRetry from './icon-retry'; */ const ALLOWED_MEDIA_TYPES = [ MEDIA_TYPE_IMAGE, MEDIA_TYPE_VIDEO ]; +export function imageFillStyles( url, focalPoint ) { + return url ? + { + backgroundImage: `url(${ url })`, + backgroundPosition: focalPoint ? `${ focalPoint.x * 100 }% ${ focalPoint.y * 100 }%` : `50% 50%`, + } : + {}; +} + class MediaContainer extends Component { constructor() { super( ...arguments ); From 49c94c12f07e5100dd11d330227e35fa5640ee96 Mon Sep 17 00:00:00 2001 From: Gerardo Pacheco Date: Thu, 5 Dec 2019 10:33:53 +0100 Subject: [PATCH 2/2] [RNMobile] Export missing imageFillStyles implementation in Media & Text --- .../src/media-text/media-container.native.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/packages/block-library/src/media-text/media-container.native.js b/packages/block-library/src/media-text/media-container.native.js index 280137db139db4..718e035469d0ed 100644 --- a/packages/block-library/src/media-text/media-container.native.js +++ b/packages/block-library/src/media-text/media-container.native.js @@ -44,14 +44,7 @@ import SvgIconRetry from './icon-retry'; */ const ALLOWED_MEDIA_TYPES = [ MEDIA_TYPE_IMAGE, MEDIA_TYPE_VIDEO ]; -export function imageFillStyles( url, focalPoint ) { - return url ? - { - backgroundImage: `url(${ url })`, - backgroundPosition: focalPoint ? `${ focalPoint.x * 100 }% ${ focalPoint.y * 100 }%` : `50% 50%`, - } : - {}; -} +export { imageFillStyles } from './media-container.js'; class MediaContainer extends Component { constructor() {