From 537697a6e9757f118d09d9e76362ba1ff617e2c6 Mon Sep 17 00:00:00 2001 From: Markus Hatvan Date: Mon, 13 Sep 2021 14:45:46 +0200 Subject: chore: upgrade intl dependencies (#1920) --- src/components/services/content/Services.js | 103 +++++++++++++++------------- 1 file changed, 55 insertions(+), 48 deletions(-) (limited to 'src/components/services/content/Services.js') diff --git a/src/components/services/content/Services.js b/src/components/services/content/Services.js index bb93ff7d4..fb43fb816 100644 --- a/src/components/services/content/Services.js +++ b/src/components/services/content/Services.js @@ -2,7 +2,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { observer, PropTypes as MobxPropTypes, inject } from 'mobx-react'; import { Link } from 'react-router'; -import { defineMessages, intlShape } from 'react-intl'; +import { defineMessages, injectIntl } from 'react-intl'; import Confetti from 'react-confetti'; import ms from 'ms'; import injectSheet from 'react-jss'; @@ -14,23 +14,24 @@ import serverlessLogin from '../../../helpers/serverless-helpers'; const messages = defineMessages({ welcome: { id: 'services.welcome', - defaultMessage: '!!!Welcome to Ferdi', + defaultMessage: 'Welcome to Ferdi', }, getStarted: { id: 'services.getStarted', - defaultMessage: '!!!Get started', + defaultMessage: 'Get started', }, login: { id: 'services.login', - defaultMessage: '!!!Please login to use Ferdi.', + defaultMessage: 'Please login to use Ferdi.', }, serverless: { id: 'services.serverless', - defaultMessage: '!!!Use Ferdi without an Account', + defaultMessage: 'Use Ferdi without an Account', }, serverInfo: { id: 'services.serverInfo', - defaultMessage: '!!!Optionally, you can change your Ferdi server by clicking the cog in the bottom left corner. If you are switching over (from one of the hosted servers) to using Ferdi without an account, please be informed that you can export your data from that server and subsequently import it using the Help menu to resurrect all your workspaces and configured services!', + defaultMessage: + 'Optionally, you can change your Ferdi server by clicking the cog in the bottom left corner. If you are switching over (from one of the hosted servers) to using Ferdi without an account, please be informed that you can export your data from that server and subsequently import it using the Help menu to resurrect all your workspaces and configured services!', }, }); @@ -43,7 +44,10 @@ const styles = { }, }; -export default @injectSheet(styles) @inject('actions') @observer class Services extends Component { +@injectSheet(styles) +@inject('actions') +@observer +class Services extends Component { static propTypes = { services: MobxPropTypes.arrayOrObservableArray, setWebviewReference: PropTypes.func.isRequired, @@ -63,10 +67,6 @@ export default @injectSheet(styles) @inject('actions') @observer class Services services: [], }; - static contextTypes = { - intl: intlShape, - }; - state = { showConfetti: true, }; @@ -112,11 +112,9 @@ export default @injectSheet(styles) @inject('actions') @observer class Services isSpellcheckerEnabled, } = this.props; - const { - showConfetti, - } = this.state; + const { showConfetti } = this.state; - const { intl } = this.context; + const { intl } = this.props; const isLoggedIn = Boolean(localStorage.getItem('authToken')); return ( @@ -131,25 +129,28 @@ export default @injectSheet(styles) @inject('actions') @observer class Services )} {services.length === 0 && ( - +
- Logo + Logo

{intl.formatMessage(messages.welcome)}

- { !isLoggedIn && ( + {!isLoggedIn && ( <>

{intl.formatMessage(messages.login)}

{intl.formatMessage(messages.serverInfo)}

- ) } - - - { isLoggedIn ? intl.formatMessage(messages.getStarted) : 'Login' } + )} + + + {isLoggedIn + ? intl.formatMessage(messages.getStarted) + : 'Login'} {!isLoggedIn && (
); } } + +export default injectIntl(Services); -- cgit v1.2.3-70-g09d2