From 756a49dacb4e0b405c566f0c2d3549ecdff7c6d3 Mon Sep 17 00:00:00 2001 From: Alex Beaman Date: Wed, 30 Aug 2023 15:29:38 +0300 Subject: [PATCH 1/6] Pass new custom hero body text down --- src/pages/signin/SignInHeroCopy.js | 7 ++++++- src/pages/signin/SignInPage.js | 3 ++- src/pages/signin/SignInPageHero.js | 5 ++++- src/pages/signin/SignInPageLayout/index.js | 5 ++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/pages/signin/SignInHeroCopy.js b/src/pages/signin/SignInHeroCopy.js index 93951c0b9236..c2caa3ea1296 100644 --- a/src/pages/signin/SignInHeroCopy.js +++ b/src/pages/signin/SignInHeroCopy.js @@ -13,13 +13,18 @@ const propTypes = { /** Override the green headline copy */ customHeadline: PropTypes.string, + /** Override the smaller hero body copy below the headline */ + customHeroBody: PropTypes.string, + ...windowDimensionsPropTypes, ...withLocalizePropTypes, }; const defaultProps = { customHeadline: '', + customHeroBody: '', }; + function SignInHeroCopy(props) { return ( @@ -32,7 +37,7 @@ function SignInHeroCopy(props) { > {props.customHeadline || props.translate('login.hero.header')} - {props.translate('login.hero.body')} + {props.customHeroBody || props.translate('login.hero.body')} ); } diff --git a/src/pages/signin/SignInPage.js b/src/pages/signin/SignInPage.js index 21a92bce41c0..892c2e0faaed 100644 --- a/src/pages/signin/SignInPage.js +++ b/src/pages/signin/SignInPage.js @@ -115,7 +115,7 @@ function SignInPage({credentials, account, isInModal, demoInfo}) { let welcomeHeader = ''; let welcomeText = ''; - const customHeadline = DemoActions.getHeadlineKeyByDemoInfo(demoInfo); + const {customHeadline, customHeroBody} = DemoActions.getCustomTextForDemo(demoInfo); const headerText = customHeadline || translate('login.hero.header'); if (shouldShowLoginForm) { welcomeHeader = isSmallScreenWidth ? headerText : translate('welcomeText.getStarted'); @@ -165,6 +165,7 @@ function SignInPage({credentials, account, isInModal, demoInfo}) { ref={signInPageLayoutRef} isInModal={isInModal} customHeadline={customHeadline} + customHeroBody={customHeroBody} > {/* LoginForm must use the isVisible prop. This keeps it mounted, but visually hidden so that password managers can access the values. Conditionally rendering this component will break this feature. */} diff --git a/src/pages/signin/SignInPageHero.js b/src/pages/signin/SignInPageHero.js index eb2a275a49f7..85d1c882cbd9 100644 --- a/src/pages/signin/SignInPageHero.js +++ b/src/pages/signin/SignInPageHero.js @@ -12,6 +12,9 @@ const propTypes = { /** Override the green headline copy */ customHeadline: PropTypes.string, + /** Override the smaller hero body copy below the headline */ + customHeroBody: PropTypes.string, + ...windowDimensionsPropTypes, }; @@ -33,7 +36,7 @@ function SignInPageHero(props) { > - + ); diff --git a/src/pages/signin/SignInPageLayout/index.js b/src/pages/signin/SignInPageLayout/index.js index 52a8875a8e04..5c31dea1bd5a 100644 --- a/src/pages/signin/SignInPageLayout/index.js +++ b/src/pages/signin/SignInPageLayout/index.js @@ -43,6 +43,9 @@ const propTypes = { /** Override the green headline copy */ customHeadline: PropTypes.string, + + /** Override the smaller hero body copy below the headline */ + customHeroBody: PropTypes.string, ...windowDimensionsPropTypes, ...withLocalizePropTypes, @@ -133,7 +136,7 @@ function SignInPageLayout(props) { props.isLargeScreenWidth ? styles.ph25 : {}, ]} > - +