Skip to content

Commit

Permalink
add shouldShowSmallScreen
Browse files Browse the repository at this point in the history
  • Loading branch information
tienifr committed Nov 13, 2023
1 parent b33c309 commit aedebbe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/pages/signin/SignInHeroImage.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import PropTypes from 'prop-types';
import React from 'react';
import Lottie from '@components/Lottie';
import LottieAnimations from '@components/LottieAnimations';
Expand All @@ -7,11 +8,17 @@ import variables from '@styles/variables';

const propTypes = {
...windowDimensionsPropTypes,

shouldShowSmallScreen: PropTypes.bool,
};

const defaultProps = {
shouldShowSmallScreen: false,
};

function SignInHeroImage(props) {
let imageSize;
if (props.isSmallScreenWidth) {
if (props.isSmallScreenWidth || props.shouldShowSmallScreen) {
imageSize = {
height: variables.signInHeroImageMobileHeight,
width: variables.signInHeroImageMobileWidth,
Expand Down Expand Up @@ -41,5 +48,6 @@ function SignInHeroImage(props) {

SignInHeroImage.displayName = 'SignInHeroImage';
SignInHeroImage.propTypes = propTypes;
SignInHeroImage.defaultProps = defaultProps;

export default withWindowDimensions(SignInHeroImage);
2 changes: 1 addition & 1 deletion src/pages/signin/SignInPageLayout/SignInPageContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function SignInPageContent(props) {
</View>
{props.shouldShowSmallScreen ? (
<View style={[styles.mt8]}>
<SignInHeroImage />
<SignInHeroImage shouldShowSmallScreen />
</View>
) : null}
</View>
Expand Down

0 comments on commit aedebbe

Please sign in to comment.