2018-04-17 00:44:57 +02:00
// @flow
2019-09-26 18:07:11 +02:00
import * as ICONS from 'constants/icons' ;
import React , { Fragment } from 'react' ;
2018-03-26 23:32:43 +02:00
import Button from 'component/button' ;
2017-12-21 22:08:54 +01:00
import CardVerify from 'component/cardVerify' ;
2018-10-04 21:27:49 +02:00
import { Lbryio } from 'lbryinc' ;
2019-09-26 18:07:11 +02:00
import Card from 'component/common/card' ;
2017-07-16 18:29:46 +02:00
2018-04-17 00:44:57 +02:00
type Props = {
errorMessage : ? string ,
isPending : boolean ,
verifyUserIdentity : string => void ,
verifyPhone : ( ) => void ,
} ;
2017-07-16 18:29:46 +02:00
2018-04-17 00:44:57 +02:00
class UserVerify extends React . PureComponent < Props > {
constructor ( ) {
super ( ) ;
2017-07-16 18:29:46 +02:00
2018-04-17 00:44:57 +02:00
( this : any ) . onToken = this . onToken . bind ( this ) ;
2017-07-16 18:29:46 +02:00
}
2018-04-17 00:44:57 +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 ( ) {
2019-03-28 17:53:13 +01:00
const { errorMessage , isPending , verifyPhone } = this . props ;
2017-07-16 18:29:46 +02:00
return (
2018-03-26 23:32:43 +02:00
< React.Fragment >
2019-09-26 18:07:11 +02:00
< section className = "section--large" >
< h1 className = "section__title--large" > { _ _ ( 'Extra Verification Needed' ) } < / h1 >
< p >
{ _ _ (
"We weren't able to auto-approve you for rewards. Please complete one of the steps below to unlock them."
) } { ' ' }
< Button navigate = "/" button = "link" label = { _ _ ( 'Skip' ) } / > .
2019-07-21 23:31:22 +02:00
< / p >
2017-08-26 05:21:26 +02:00
< / section >
2018-12-19 06:44:53 +01:00
2019-09-26 18:07:11 +02:00
< div className = "section" >
< Card
icon = { ICONS . PHONE }
title = { _ _ ( 'Proof via Text' ) }
subtitle = { _ _ (
2019-07-21 23:31:22 +02:00
'You will receive an SMS text message confirming that your phone number is correct. Does not work for Canada and possibly other regions'
2019-09-26 18:07:11 +02:00
) }
actions = {
< Fragment >
< Button
onClick = { ( ) => {
verifyPhone ( ) ;
} }
button = "primary"
label = { _ _ ( 'Verify Phone Number' ) }
/ >
< p className = "help" >
{ _ _ ( 'Standard messaging rates apply. LBRY will not text or call you otherwise. Having trouble?' ) } { ' ' }
< Button button = "link" href = "https://lbry.com/faq/phone" label = { _ _ ( 'Read more.' ) } / >
< / p >
< / Fragment >
}
/ >
2019-07-21 23:31:22 +02:00
2019-09-26 18:07:11 +02:00
< div className = "section__divider" >
< hr / >
< p > { _ _ ( 'OR' ) } < / p >
2019-07-21 23:31:22 +02:00
< / div >
2018-12-19 06:44:53 +01:00
2019-09-26 18:07:11 +02:00
< Card
icon = { ICONS . WALLET }
title = { _ _ ( 'Proof via Credit' ) }
subtitle = { _ _ (
'If you have a valid credit or debit card, you can use it to instantly prove your humanity. LBRY does not store your credit card information. There is no charge at all for this, now or in the future.'
2019-07-21 23:31:22 +02:00
) }
2019-09-26 18:07:11 +02:00
actions = {
< Fragment >
{ errorMessage && < p className = "error-text" > { errorMessage } < / p > }
< CardVerify
label = { _ _ ( 'Verify Card' ) }
disabled = { isPending }
token = { this . onToken }
stripeKey = { Lbryio . getStripeToken ( ) }
/ >
< p className = "help" >
{ _ _ ( 'A $1 authorization may temporarily appear with your provider.' ) } { ' ' }
< Button button = "link" href = "https://lbry.com/faq/identity-requirements" label = { _ _ ( 'Read more' ) } / > .
< / p >
< / Fragment >
}
/ >
2019-07-21 23:31:22 +02:00
2019-09-26 18:07:11 +02:00
< div className = "section__divider" >
< hr / >
< p > { _ _ ( 'OR' ) } < / p >
2017-08-26 05:21:26 +02:00
< / div >
2018-12-19 06:44:53 +01:00
2019-09-26 18:07:11 +02:00
< Card
icon = { ICONS . CHAT }
title = { _ _ ( 'Proof via Chat' ) }
subtitle = { _ _ (
'A moderator capable of approving you is typically available in the discord server. Check out the #rewards-approval channel for more information. This process will likely involve providing proof of a stable and established online or real-life identity.'
) }
actions = {
< Fragment >
< Button href = "https://chat.lbry.com" button = "primary" label = { _ _ ( 'Join LBRY Chat' ) } / >
< p className = "help" > { _ _ ( "We're friendly. We promise." ) } < / p >
< / Fragment >
}
/ >
< / div >
2018-03-26 23:32:43 +02:00
< / React.Fragment >
2017-07-16 18:29:46 +02:00
) ;
}
}
export default UserVerify ;