diff options
author | Stefan Malzner <stefan@adlk.io> | 2018-12-09 01:01:12 +0100 |
---|---|---|
committer | Stefan Malzner <stefan@adlk.io> | 2018-12-09 01:01:12 +0100 |
commit | f01957203f77fce8b65d5e034a8acd68f1e0ae2e (patch) | |
tree | 2f8d0d232266cdc7ed74e1913b270527f46bb33d /src/components/auth | |
parent | Add dark mode styles to content tabs (diff) | |
download | ferdium-app-f01957203f77fce8b65d5e034a8acd68f1e0ae2e.tar.gz ferdium-app-f01957203f77fce8b65d5e034a8acd68f1e0ae2e.tar.zst ferdium-app-f01957203f77fce8b65d5e034a8acd68f1e0ae2e.zip |
Upgrade to react 16
TODO: add componentDidCatch
Diffstat (limited to 'src/components/auth')
-rw-r--r-- | src/components/auth/AuthLayout.js | 21 | ||||
-rw-r--r-- | src/components/auth/Invite.js | 6 | ||||
-rw-r--r-- | src/components/auth/Login.js | 3 |
3 files changed, 7 insertions, 23 deletions
diff --git a/src/components/auth/AuthLayout.js b/src/components/auth/AuthLayout.js index 4fb0e6a59..4e1b0c52e 100644 --- a/src/components/auth/AuthLayout.js +++ b/src/components/auth/AuthLayout.js | |||
@@ -1,7 +1,6 @@ | |||
1 | import React, { Component } from 'react'; | 1 | import React, { Component } from 'react'; |
2 | import PropTypes from 'prop-types'; | 2 | import PropTypes from 'prop-types'; |
3 | import { observer } from 'mobx-react'; | 3 | import { observer } from 'mobx-react'; |
4 | import { RouteTransition } from 'react-router-transition'; | ||
5 | import { intlShape } from 'react-intl'; | 4 | import { intlShape } from 'react-intl'; |
6 | import { TitleBar } from 'electron-react-titlebar'; | 5 | import { TitleBar } from 'electron-react-titlebar'; |
7 | 6 | ||
@@ -69,22 +68,10 @@ export default @observer class AuthLayout extends Component { | |||
69 | </InfoBar> | 68 | </InfoBar> |
70 | )} | 69 | )} |
71 | <div className="auth__layout"> | 70 | <div className="auth__layout"> |
72 | <RouteTransition | 71 | {/* Inject globalError into children */} |
73 | pathname={pathname} | 72 | {React.cloneElement(children, { |
74 | atEnter={{ opacity: 0 }} | 73 | error, |
75 | atLeave={{ opacity: 0 }} | 74 | })} |
76 | atActive={{ opacity: 1 }} | ||
77 | mapStyles={styles => ({ | ||
78 | transform: `translateX(${styles.translateX}%)`, | ||
79 | opacity: styles.opacity, | ||
80 | })} | ||
81 | component="span" | ||
82 | > | ||
83 | {/* Inject globalError into children */} | ||
84 | {React.cloneElement(children, { | ||
85 | error, | ||
86 | })} | ||
87 | </RouteTransition> | ||
88 | </div> | 75 | </div> |
89 | {/* </div> */} | 76 | {/* </div> */} |
90 | <Link to="https://adlk.io" className="auth__adlk" target="_blank"> | 77 | <Link to="https://adlk.io" className="auth__adlk" target="_blank"> |
diff --git a/src/components/auth/Invite.js b/src/components/auth/Invite.js index 96821a61a..5da89f2ce 100644 --- a/src/components/auth/Invite.js +++ b/src/components/auth/Invite.js | |||
@@ -1,4 +1,4 @@ | |||
1 | import React, { Component } from 'react'; | 1 | import React, { Component, Fragment } from 'react'; |
2 | import PropTypes from 'prop-types'; | 2 | import PropTypes from 'prop-types'; |
3 | import { observer } from 'mobx-react'; | 3 | import { observer } from 'mobx-react'; |
4 | import { defineMessages, intlShape } from 'react-intl'; | 4 | import { defineMessages, intlShape } from 'react-intl'; |
@@ -127,7 +127,7 @@ export default @observer class Invite extends Component { | |||
127 | }); | 127 | }); |
128 | 128 | ||
129 | const renderForm = ( | 129 | const renderForm = ( |
130 | <div> | 130 | <Fragment> |
131 | {this.state.showSuccessInfo && isInviteSuccessful && ( | 131 | {this.state.showSuccessInfo && isInviteSuccessful && ( |
132 | <Appear> | 132 | <Appear> |
133 | <Infobox | 133 | <Infobox |
@@ -171,7 +171,7 @@ export default @observer class Invite extends Component { | |||
171 | {intl.formatMessage(messages.skipButtonLabel)} | 171 | {intl.formatMessage(messages.skipButtonLabel)} |
172 | </Link>)} | 172 | </Link>)} |
173 | </form> | 173 | </form> |
174 | </div> | 174 | </Fragment> |
175 | ); | 175 | ); |
176 | 176 | ||
177 | return ( | 177 | return ( |
diff --git a/src/components/auth/Login.js b/src/components/auth/Login.js index f465b35a5..2cf614041 100644 --- a/src/components/auth/Login.js +++ b/src/components/auth/Login.js | |||
@@ -11,11 +11,8 @@ import Button from '../ui/Button'; | |||
11 | import Link from '../ui/Link'; | 11 | import Link from '../ui/Link'; |
12 | import Infobox from '../ui/Infobox'; | 12 | import Infobox from '../ui/Infobox'; |
13 | 13 | ||
14 | |||
15 | import { globalError as globalErrorPropType } from '../../prop-types'; | 14 | import { globalError as globalErrorPropType } from '../../prop-types'; |
16 | 15 | ||
17 | // import Appear from '../ui/effects/Appear'; | ||
18 | |||
19 | const messages = defineMessages({ | 16 | const messages = defineMessages({ |
20 | headline: { | 17 | headline: { |
21 | id: 'login.headline', | 18 | id: 'login.headline', |