Skip to content

Commit

Permalink
Merge pull request #26923 from hoangzinh/df/26069
Browse files Browse the repository at this point in the history
Fix background image is missing in Android native app
  • Loading branch information
roryabraham authored Sep 20, 2023
2 parents 352f1f1 + deef0ff commit 45f232a
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 4 deletions.
20 changes: 18 additions & 2 deletions src/pages/signin/SignInPageLayout/BackgroundImage/index.android.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
import backgroundImage from '../../../../../assets/images/home-background--android.svg';
import React from 'react';
import AndroidBackgroundImage from '../../../../../assets/images/home-background--android.svg';
import styles from '../../../../styles/styles';
import defaultPropTypes from './propTypes';

export default backgroundImage;
function BackgroundImage(props) {
return (
<AndroidBackgroundImage
pointerEvents={props.pointerEvents}
width={props.width}
style={styles.signInBackground}
/>
);
}

BackgroundImage.displayName = 'BackgroundImage';
BackgroundImage.propTypes = defaultPropTypes;

export default BackgroundImage;
6 changes: 4 additions & 2 deletions src/pages/signin/SignInPageLayout/BackgroundImage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@ import PropTypes from 'prop-types';
import MobileBackgroundImage from '../../../../../assets/images/home-background--mobile.svg';
import DesktopBackgroundImage from '../../../../../assets/images/home-background--desktop.svg';
import styles from '../../../../styles/styles';
import defaultPropTypes from './propTypes';

const defaultProps = {
isSmallScreen: false,
};

const propTypes = {
/** Is the window width narrow, like on a mobile device */
isSmallScreen: PropTypes.bool,
pointerEvents: PropTypes.string.isRequired,
width: PropTypes.number.isRequired,

...defaultPropTypes,
};
function BackgroundImage(props) {
return props.isSmallScreen ? (
Expand Down
11 changes: 11 additions & 0 deletions src/pages/signin/SignInPageLayout/BackgroundImage/propTypes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import PropTypes from 'prop-types';

const propTypes = {
/** pointerEvents property to the SVG element */
pointerEvents: PropTypes.string.isRequired,

/** The width of the image. */
width: PropTypes.number.isRequired,
};

export default propTypes;

0 comments on commit 45f232a

Please sign in to comment.