diff options
author | 2018-11-25 23:02:12 +0100 | |
---|---|---|
committer | 2018-11-25 23:02:12 +0100 | |
commit | 0d9c7ff6a638861d54f29bf91c82847cfa62a24c (patch) | |
tree | 1091fc0fe9b498e7b6fa69386ed2586d298d9269 /src/components/ui/PremiumFeatureContainer/index.js | |
parent | Fix delayApp issues (diff) | |
download | ferdium-app-0d9c7ff6a638861d54f29bf91c82847cfa62a24c.tar.gz ferdium-app-0d9c7ff6a638861d54f29bf91c82847cfa62a24c.tar.zst ferdium-app-0d9c7ff6a638861d54f29bf91c82847cfa62a24c.zip |
Move spellchecker to premium
Diffstat (limited to 'src/components/ui/PremiumFeatureContainer/index.js')
-rw-r--r-- | src/components/ui/PremiumFeatureContainer/index.js | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/src/components/ui/PremiumFeatureContainer/index.js b/src/components/ui/PremiumFeatureContainer/index.js new file mode 100644 index 000000000..113fe2221 --- /dev/null +++ b/src/components/ui/PremiumFeatureContainer/index.js | |||
@@ -0,0 +1,64 @@ | |||
1 | import React, { Component } from 'react'; | ||
2 | import { inject, observer } from 'mobx-react'; | ||
3 | import PropTypes from 'prop-types'; | ||
4 | import { defineMessages, intlShape } from 'react-intl'; | ||
5 | import injectSheet from 'react-jss'; | ||
6 | |||
7 | import { oneOrManyChildElements } from '../../../prop-types'; | ||
8 | |||
9 | import styles from './styles'; | ||
10 | |||
11 | const messages = defineMessages({ | ||
12 | action: { | ||
13 | id: 'premiumFeature.button.upgradeAccount', | ||
14 | defaultMessage: '!!!Upgrade account', | ||
15 | }, | ||
16 | }); | ||
17 | |||
18 | export default @inject('actions') @injectSheet(styles) @observer class PremiumFeatureContainer extends Component { | ||
19 | static propTypes = { | ||
20 | classes: PropTypes.object.isRequired, | ||
21 | }; | ||
22 | |||
23 | static contextTypes = { | ||
24 | intl: intlShape, | ||
25 | }; | ||
26 | |||
27 | render() { | ||
28 | const { | ||
29 | classes, | ||
30 | children, | ||
31 | actions, | ||
32 | } = this.props; | ||
33 | |||
34 | const { intl } = this.context; | ||
35 | |||
36 | return ( | ||
37 | <div className={classes.container}> | ||
38 | <div className={classes.titleContainer}> | ||
39 | <p className={classes.title}>Premium Feature</p> | ||
40 | <button | ||
41 | className={classes.actionButton} | ||
42 | type="button" | ||
43 | onClick={() => actions.ui.openSettings({ path: 'user' })} | ||
44 | > | ||
45 | {intl.formatMessage(messages.action)} | ||
46 | </button> | ||
47 | </div> | ||
48 | <div className={classes.content}> | ||
49 | {children} | ||
50 | </div> | ||
51 | </div> | ||
52 | ); | ||
53 | } | ||
54 | } | ||
55 | |||
56 | PremiumFeatureContainer.wrappedComponent.propTypes = { | ||
57 | children: oneOrManyChildElements.isRequired, | ||
58 | actions: PropTypes.shape({ | ||
59 | ui: PropTypes.shape({ | ||
60 | openSettings: PropTypes.func.isRequired, | ||
61 | }).isRequired, | ||
62 | }).isRequired, | ||
63 | }; | ||
64 | |||