-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathAuthScreen.js
More file actions
37 lines (34 loc) · 945 Bytes
/
AuthScreen.js
File metadata and controls
37 lines (34 loc) · 945 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import React from 'react'
import Header from '../Header'
import Authorized from './Authorized'
import Anonymous from './Anonymous'
import CredsCheckingScreen from './CredsCheckingScreen'
import { locationType, credsType } from '../../helpers/propTypes'
const AuthScreen = ({
creds: {
haveBeenChecked,
username,
},
location: { state },
...rest
}) => (
<div className="overlay auth-screen">
<Header />
<div className="panel">
{(!haveBeenChecked && <CredsCheckingScreen />)
|| (username && (
<Authorized
username={username}
from={state ? state.from : '/'}
redirectToReferrer={state && state.redirectToReferrer}
{...rest}
/>))
|| <Anonymous from={state ? state.from : '/'} {...rest} />}
</div>
</div>
)
AuthScreen.propTypes = {
creds: credsType.isRequired,
location: locationType.isRequired,
}
export default AuthScreen