Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update landing page copy (below headline) for SaaStr & SBE Conferences #26278

Merged
merged 7 commits into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -1667,9 +1667,11 @@ export default {
demos: {
saastr: {
signInWelcome: 'Welcome to SaaStr! Hop in to start networking now.',
heroBody: 'Use New Expensify for event updates, networking, social chatter, and to get paid back for lunch!',
},
sbe: {
signInWelcome: 'Welcome to Small Business Expo! Get paid back for your ride.',
heroBody: 'Use New Expensify for event updates, networking, social chatter, and to get paid back for your ride to or from the show!',
},
},
};
3 changes: 3 additions & 0 deletions src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -2155,9 +2155,12 @@ export default {
demos: {
saastr: {
signInWelcome: '¡Bienvenido a SaaStr! Entra y empieza a establecer contactos.',
heroBody: 'Utiliza New Expensify para estar al día de los eventos, establecer contactos, charlar en las redes sociales, ¡y para que te devuelvan el dinero de la comida!',
},
sbe: {
signInWelcome: '¡Bienvenido a Small Business Expo! Recupera el dinero de tu viaje.',
heroBody:
'Utiliza New Expensify para estar al día de los eventos, establecer contactos, charlar en las redes sociales y para que te paguen el viaje de ida y vuelta a la conferencia.',
},
},
};
20 changes: 15 additions & 5 deletions src/libs/actions/DemoActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,24 @@ function runDemoByURL(url = '') {
}
}

function getHeadlineKeyByDemoInfo(demoInfo = {}) {
/**
* @param {Object} demoInfo
* @returns {Object}
*/
function getCustomTextForDemo(demoInfo = {}) {
if (lodashGet(demoInfo, 'saastr.isBeginningDemo')) {
return Localize.translateLocal('demos.saastr.signInWelcome');
return {
customHeadline: Localize.translateLocal('demos.saastr.signInWelcome'),
customHeroBody: Localize.translateLocal('demos.saastr.heroBody'),
};
}
if (lodashGet(demoInfo, 'sbe.isBeginningDemo')) {
return Localize.translateLocal('demos.sbe.signInWelcome');
return {
customHeadline: Localize.translateLocal('demos.sbe.signInWelcome'),
customHeroBody: Localize.translateLocal('demos.sbe.heroBody'),
};
}
return '';
return {};
}

export {runSaastrDemo, runSbeDemo, runDemoByURL, getHeadlineKeyByDemoInfo};
export {runSaastrDemo, runSbeDemo, runDemoByURL, getCustomTextForDemo};
7 changes: 6 additions & 1 deletion src/pages/signin/SignInHeroCopy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<View style={[styles.flex1, styles.alignSelfCenter, styles.gap7]}>
Expand All @@ -32,7 +37,7 @@ function SignInHeroCopy(props) {
>
{props.customHeadline || props.translate('login.hero.header')}
</Text>
<Text style={[styles.loginHeroBody]}>{props.translate('login.hero.body')}</Text>
<Text style={[styles.loginHeroBody]}>{props.customHeroBody || props.translate('login.hero.body')}</Text>
</View>
);
}
Expand Down
3 changes: 2 additions & 1 deletion src/pages/signin/SignInPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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. */}
Expand Down
9 changes: 8 additions & 1 deletion src/pages/signin/SignInPageHero.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ const propTypes = {
/** Override the green headline copy */
customHeadline: PropTypes.string,

/** Override the smaller hero body copy below the headline */
customHeroBody: PropTypes.string,

...windowDimensionsPropTypes,
};

const defaultProps = {
customHeadline: '',
customHeroBody: '',
};

function SignInPageHero(props) {
Expand All @@ -33,7 +37,10 @@ function SignInPageHero(props) {
>
<View style={[styles.flex1, styles.alignSelfCenter, styles.gap7]}>
<SignInHeroImage />
<SignInHeroCopy customHeadline={props.customHeadline} />
<SignInHeroCopy
customHeadline={props.customHeadline}
customHeroBody={props.customHeroBody}
/>
</View>
</View>
);
Expand Down
9 changes: 8 additions & 1 deletion src/pages/signin/SignInPageLayout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,17 @@ 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 = {
innerRef: () => {},
customHeadline: '',
customHeroBody: '',
};

function SignInPageLayout(props) {
Expand Down Expand Up @@ -133,7 +137,10 @@ function SignInPageLayout(props) {
props.isLargeScreenWidth ? styles.ph25 : {},
]}
>
<SignInPageHero customHeadline={props.customHeadline} />
<SignInPageHero
customHeadline={props.customHeadline}
customHeroBody={props.customHeroBody}
/>
<Footer scrollPageToTop={scrollPageToTop} />
</View>
</View>
Expand Down
Loading