lbry-desktop/src/renderer/component/userVerify/view.jsx

136 lines
4.5 KiB
React
Raw Normal View History

// @flow
import * as React from 'react';
2018-03-26 23:32:43 +02:00
import Button from 'component/button';
import CardVerify from 'component/cardVerify';
2018-09-24 05:44:42 +02:00
import Lbryio from 'lbryinc';
2018-03-26 23:32:43 +02:00
import * as icons from 'constants/icons';
2017-07-16 18:29:46 +02:00
type Props = {
errorMessage: ?string,
isPending: boolean,
navigate: string => void,
verifyUserIdentity: string => void,
verifyPhone: () => void,
};
2017-07-16 18:29:46 +02:00
class UserVerify extends React.PureComponent<Props> {
constructor() {
super();
2017-07-16 18:29:46 +02:00
(this: any).onToken = this.onToken.bind(this);
2017-07-16 18:29:46 +02:00
}
onToken(data: { id: string }) {
2017-07-19 01:00:13 +02:00
this.props.verifyUserIdentity(data.id);
2017-07-16 18:29:46 +02:00
}
render() {
const { errorMessage, isPending, navigate, verifyPhone } = this.props;
2017-07-16 18:29:46 +02:00
return (
2018-03-26 23:32:43 +02:00
<React.Fragment>
<section className="card card--section">
<div className="card__title">
<h1>{__('Final Human Proof')}</h1>
2017-08-26 05:21:26 +02:00
</div>
<div className="card__content">
<p>
Finally, please complete <strong>one and only one</strong> of the options below.
2017-08-26 05:21:26 +02:00
</p>
</div>
</section>
2018-03-26 23:32:43 +02:00
<section className="card card--section">
<div className="card__title">{__('1) Proof via Credit')}</div>
<p className="card__content">
{`${__(
'If you have a valid credit or debit card, you can use it to instantly prove your humanity.'
)} ${__('There is no charge at all for this, now or in the future.')} `}
</p>
<div className="card__actions">
{errorMessage && <p className="form-field__error">{errorMessage}</p>}
<CardVerify
label={__('Perform Card Verification')}
disabled={isPending}
token={this.onToken}
2018-09-24 05:44:42 +02:00
stripeKey={Lbryio.getStripeToken()}
/>
</div>
<div className="card__content">
<div className="meta">
{__('A $1 authorization may temporarily appear with your provider.')}{' '}
2018-03-26 23:32:43 +02:00
<Button
button="link"
2017-08-26 05:21:26 +02:00
href="https://lbry.io/faq/identity-requirements"
label={__('Read more about why we do this.')}
2017-08-26 05:21:26 +02:00
/>
</div>
2017-08-26 05:21:26 +02:00
</div>
</section>
2018-03-26 23:32:43 +02:00
<section className="card card--section">
<div className="card__title">{__('2) Proof via Phone')}</div>
<p className="card__content">
2018-01-11 06:41:51 +01:00
{`${__(
'You will receive an SMS text message confirming that your phone number is correct.'
)}`}
</p>
2018-01-11 06:41:51 +01:00
<div className="card__actions">
2018-03-26 23:32:43 +02:00
<Button
2018-01-15 14:32:01 +01:00
onClick={() => {
verifyPhone();
}}
button="primary"
2018-03-26 23:32:43 +02:00
icon={icons.PHONE}
2018-01-11 06:41:51 +01:00
label={__('Submit Phone Number')}
/>
</div>
<div className="card__content">
2018-01-29 20:22:40 +01:00
<div className="meta">
{__('Standard messaging rates apply. Having trouble?')}{' '}
<Button button="link" href="https://lbry.io/faq/phone" label={__('Read more.')} />
2018-01-29 20:22:40 +01:00
</div>
2018-01-11 06:41:51 +01:00
</div>
</section>
<section className="card card--section">
<div className="card__title">{__('3) Proof via Chat')}</div>
2017-08-26 05:21:26 +02:00
<div className="card__content">
<p>
{__(
'A moderator capable of approving you is typically available in the #verification channel of our chat room.'
2017-08-26 05:21:26 +02:00
)}
</p>
<p>
{__(
'This process will likely involve providing proof of a stable and established online or real-life identity.'
2017-08-26 05:21:26 +02:00
)}
</p>
</div>
<div className="card__actions">
2018-03-26 23:32:43 +02:00
<Button
2017-10-25 23:45:47 +02:00
href="https://chat.lbry.io"
button="primary"
2018-03-26 23:32:43 +02:00
icon={icons.MESSAGE}
label={__('Join LBRY Chat')}
2017-08-26 05:21:26 +02:00
/>
</div>
</section>
2018-03-26 23:32:43 +02:00
<section className="card card--section">
<div className="card__title">{__('Or, Skip It Entirely')}</div>
<p className="card__content">
{__(
'You can continue without this step, but you will not be eligible to earn rewards.'
)}
</p>
2017-08-26 05:21:26 +02:00
<div className="card__actions">
<Button
onClick={() => navigate('/discover')}
button="primary"
label={__('Skip Rewards')}
/>
2017-08-26 05:21:26 +02:00
</div>
</section>
2018-03-26 23:32:43 +02:00
</React.Fragment>
2017-07-16 18:29:46 +02:00
);
}
}
export default UserVerify;