diff options
Diffstat (limited to 'src/features/serviceLimit/components/LimitReachedInfobox.js')
-rw-r--r-- | src/features/serviceLimit/components/LimitReachedInfobox.js | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/src/features/serviceLimit/components/LimitReachedInfobox.js b/src/features/serviceLimit/components/LimitReachedInfobox.js deleted file mode 100644 index 424c92990..000000000 --- a/src/features/serviceLimit/components/LimitReachedInfobox.js +++ /dev/null | |||
@@ -1,75 +0,0 @@ | |||
1 | import React, { Component } from 'react'; | ||
2 | import PropTypes from 'prop-types'; | ||
3 | import { inject, observer } from 'mobx-react'; | ||
4 | import { defineMessages, intlShape } from 'react-intl'; | ||
5 | import injectSheet from 'react-jss'; | ||
6 | import { Infobox } from '@meetfranz/ui'; | ||
7 | |||
8 | const messages = defineMessages({ | ||
9 | limitReached: { | ||
10 | id: 'feature.serviceLimit.limitReached', | ||
11 | defaultMessage: '!!!You have added {amount} of {limit} services. Please upgrade your account to add more services.', | ||
12 | }, | ||
13 | action: { | ||
14 | id: 'premiumFeature.button.upgradeAccount', | ||
15 | defaultMessage: '!!!Upgrade account', | ||
16 | }, | ||
17 | }); | ||
18 | |||
19 | const styles = theme => ({ | ||
20 | container: { | ||
21 | height: 'auto', | ||
22 | background: theme.styleTypes.warning.accent, | ||
23 | color: theme.styleTypes.warning.contrast, | ||
24 | borderRadius: 0, | ||
25 | marginBottom: 0, | ||
26 | |||
27 | '& > div': { | ||
28 | marginBottom: 0, | ||
29 | }, | ||
30 | |||
31 | '& button': { | ||
32 | color: theme.styleTypes.primary.contrast, | ||
33 | }, | ||
34 | }, | ||
35 | }); | ||
36 | |||
37 | @inject('stores', 'actions') @injectSheet(styles) @observer | ||
38 | class LimitReachedInfobox extends Component { | ||
39 | static propTypes = { | ||
40 | classes: PropTypes.object.isRequired, | ||
41 | stores: PropTypes.object.isRequired, | ||
42 | actions: PropTypes.object.isRequired, | ||
43 | }; | ||
44 | |||
45 | static contextTypes = { | ||
46 | intl: intlShape, | ||
47 | }; | ||
48 | |||
49 | render() { | ||
50 | const { classes, stores, actions } = this.props; | ||
51 | const { intl } = this.context; | ||
52 | |||
53 | const { | ||
54 | serviceLimit, | ||
55 | } = stores; | ||
56 | |||
57 | if (!serviceLimit.userHasReachedServiceLimit) return null; | ||
58 | |||
59 | return ( | ||
60 | <Infobox | ||
61 | icon="mdiInformation" | ||
62 | type="warning" | ||
63 | className={classes.container} | ||
64 | ctaLabel={intl.formatMessage(messages.action)} | ||
65 | ctaOnClick={() => { | ||
66 | actions.ui.openSettings({ path: 'user' }); | ||
67 | }} | ||
68 | > | ||
69 | {intl.formatMessage(messages.limitReached, { amount: serviceLimit.serviceCount, limit: serviceLimit.serviceLimit })} | ||
70 | </Infobox> | ||
71 | ); | ||
72 | } | ||
73 | } | ||
74 | |||
75 | export default LimitReachedInfobox; | ||