lbry-desktop/ui/js/component/auth/view.jsx

30 lines
725 B
React
Raw Normal View History

2017-06-03 01:09:52 +02:00
import React from 'react'
import {BusyMessage} from 'component/common'
import UserEmailNew from 'component/userEmailNew'
import UserEmailVerify from 'component/userEmailVerify'
2017-05-17 10:10:25 +02:00
2017-06-03 01:09:52 +02:00
export class Auth extends React.Component {
2017-05-17 10:10:25 +02:00
render() {
2017-05-26 10:53:32 +02:00
const {
2017-06-03 01:09:52 +02:00
isPending,
existingEmail,
user,
2017-05-26 10:53:32 +02:00
} = this.props
2017-06-03 01:09:52 +02:00
console.log('auth render')
console.log(this.props)
if (isPending) {
return <BusyMessage message="Authenticating" />
} else if (!existingEmail && !user.has_email) {
return <UserEmailNew />
} else if (!user.has_verified_email) {
return <UserEmailVerify />
} else {
return <span className="empty">Auth is done fix this yo</span>
}
2017-05-17 10:10:25 +02:00
}
}
2017-05-26 10:53:32 +02:00
2017-06-03 01:09:52 +02:00
export default Auth