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

Add WelcomeText component #2190

Merged
merged 6 commits into from
Apr 2, 2021
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
33 changes: 33 additions & 0 deletions src/components/WelcomeText.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React from 'react';
import {Text} from 'react-native';
import PropTypes from 'prop-types';
import styles from '../styles/styles';

const propTypes = {

// Fontsize
textSize: PropTypes.oneOf(['default', 'large']),
};

const defaultProps = {
textSize: 'default',
};

const WelcomeText = props => (
<>
<Text style={[props.textSize === 'large' ? styles.textP : styles.textLabel, styles.textStrong, styles.mb1]}>
With Expensify.cash, chat and payments are the same thing.
</Text>
<Text style={[props.textSize === 'large' ? styles.textP : styles.textLabel]}>
Money talks. And now that chat and payments are in one place, it&apos;s also easy.
{' '}
Your payments get to you as fast as you can get your point across.
</Text>
</>
);

WelcomeText.displayName = 'WelcomeText';
WelcomeText.propTypes = propTypes;
WelcomeText.defaultProps = defaultProps;

export default WelcomeText;
13 changes: 2 additions & 11 deletions src/pages/signin/LoginForm/LoginFormNarrow.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import ButtonWithLoader from '../../../components/ButtonWithLoader';
import {fetchAccountDetails} from '../../../libs/actions/Session';
import welcomeScreenshot from '../../../../assets/images/welcome-screenshot.png';
import ONYXKEYS from '../../../ONYXKEYS';
import WelcomeText from '../../../components/WelcomeText';

const propTypes = {
/* Onyx Props */
Expand Down Expand Up @@ -102,17 +103,7 @@ class LoginFormNarrow extends React.Component {
source={welcomeScreenshot}
/>
</View>

<View>
marcaaron marked this conversation as resolved.
Show resolved Hide resolved
<Text style={[styles.textLabel, styles.textStrong, styles.mb1]}>
With Expensify.cash, chat and payments are the same thing.
</Text>
<Text style={[styles.textLabel]}>
Money talks. And now that chat and payments are in one place, it&apos;s also easy.
{' '}
Your payments get to you as fast as you can get your point across.
</Text>
</View>
<WelcomeText />
</View>
);
}
Expand Down
15 changes: 3 additions & 12 deletions src/pages/signin/LoginForm/LoginFormWide.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {fetchAccountDetails} from '../../../libs/actions/Session';
import styles from '../../../styles/styles';
import ButtonWithLoader from '../../../components/ButtonWithLoader';
import ONYXKEYS from '../../../ONYXKEYS';
import WelcomeText from '../../../components/WelcomeText';

const propTypes = {
/* Onyx Props */
Expand Down Expand Up @@ -92,18 +93,8 @@ class LoginFormWide extends React.Component {
</Text>
)}
</View>

<View style={[styles.mt6]}>
<View style={[styles.mb6]}>
<Text style={[styles.textP, styles.textStrong, styles.mb1]}>
With Expensify.cash, chat and payments are the same thing.
</Text>
<Text style={[styles.textP]}>
Money talks. And now that chat and payments are in one place, it&apos;s also easy.
{' '}
Your payments get to you as fast as you can get your point across.
</Text>
</View>
<View style={[styles.mb6, styles.mt6]}>
<WelcomeText textSize="large" />
</View>
</>
);
Expand Down