diff options
author | vantezzen <hello@vantezzen.io> | 2019-10-14 10:38:27 +0200 |
---|---|---|
committer | vantezzen <hello@vantezzen.io> | 2019-10-14 10:38:27 +0200 |
commit | c84edee908d40a9cab45b9ae3c5dc899fbb3eb11 (patch) | |
tree | 80158d14869b59723d09535558358d62b2612c2b /src/components/auth/Welcome.js | |
parent | Add indicator for hibernating services (diff) | |
download | ferdium-app-c84edee908d40a9cab45b9ae3c5dc899fbb3eb11.tar.gz ferdium-app-c84edee908d40a9cab45b9ae3c5dc899fbb3eb11.tar.zst ferdium-app-c84edee908d40a9cab45b9ae3c5dc899fbb3eb11.zip |
Add local server to allow serverlesss usage
Diffstat (limited to 'src/components/auth/Welcome.js')
-rw-r--r-- | src/components/auth/Welcome.js | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/components/auth/Welcome.js b/src/components/auth/Welcome.js index ef917e336..2ca8b430f 100644 --- a/src/components/auth/Welcome.js +++ b/src/components/auth/Welcome.js | |||
@@ -1,7 +1,9 @@ | |||
1 | /* eslint jsx-a11y/anchor-is-valid: 0 */ | ||
1 | import React, { Component } from 'react'; | 2 | import React, { Component } from 'react'; |
2 | import PropTypes from 'prop-types'; | 3 | import PropTypes from 'prop-types'; |
3 | import { observer, PropTypes as MobxPropTypes } from 'mobx-react'; | 4 | import { observer, PropTypes as MobxPropTypes, inject } from 'mobx-react'; |
4 | import { defineMessages, intlShape } from 'react-intl'; | 5 | import { defineMessages, intlShape } from 'react-intl'; |
6 | import serverlessLogin from '../../helpers/serverless-helpers'; | ||
5 | 7 | ||
6 | import Link from '../ui/Link'; | 8 | import Link from '../ui/Link'; |
7 | 9 | ||
@@ -14,19 +16,28 @@ const messages = defineMessages({ | |||
14 | id: 'welcome.loginButton', | 16 | id: 'welcome.loginButton', |
15 | defaultMessage: '!!!Login to your account', | 17 | defaultMessage: '!!!Login to your account', |
16 | }, | 18 | }, |
19 | serverless: { | ||
20 | id: 'services.serverless', | ||
21 | defaultMessage: '!!!Use Ferdi without an Account', | ||
22 | }, | ||
17 | }); | 23 | }); |
18 | 24 | ||
19 | export default @observer class Login extends Component { | 25 | export default @observer @inject('actions') class Login extends Component { |
20 | static propTypes = { | 26 | static propTypes = { |
21 | loginRoute: PropTypes.string.isRequired, | 27 | loginRoute: PropTypes.string.isRequired, |
22 | signupRoute: PropTypes.string.isRequired, | 28 | signupRoute: PropTypes.string.isRequired, |
23 | recipes: MobxPropTypes.arrayOrObservableArray.isRequired, | 29 | recipes: MobxPropTypes.arrayOrObservableArray.isRequired, |
30 | actions: PropTypes.object.isRequired, | ||
24 | }; | 31 | }; |
25 | 32 | ||
26 | static contextTypes = { | 33 | static contextTypes = { |
27 | intl: intlShape, | 34 | intl: intlShape, |
28 | }; | 35 | }; |
29 | 36 | ||
37 | useLocalServer() { | ||
38 | serverlessLogin(this.props.actions); | ||
39 | } | ||
40 | |||
30 | render() { | 41 | render() { |
31 | const { intl } = this.context; | 42 | const { intl } = this.context; |
32 | const { | 43 | const { |
@@ -53,6 +64,12 @@ export default @observer class Login extends Component { | |||
53 | </Link> | 64 | </Link> |
54 | <br /> | 65 | <br /> |
55 | <br /> | 66 | <br /> |
67 | <a className="button" onClick={this.useLocalServer.bind(this)}> | ||
68 | {intl.formatMessage(messages.serverless)} | ||
69 | </a> | ||
70 | <br /> | ||
71 | <br /> | ||
72 | |||
56 | 73 | ||
57 | <Link to="settings/app"> | 74 | <Link to="settings/app"> |
58 | <span style={{ | 75 | <span style={{ |