diff options
Diffstat (limited to 'src/components/settings/navigation/SettingsNavigation.js')
-rw-r--r-- | src/components/settings/navigation/SettingsNavigation.js | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/src/components/settings/navigation/SettingsNavigation.js b/src/components/settings/navigation/SettingsNavigation.js index 66539f324..46b2f82fc 100644 --- a/src/components/settings/navigation/SettingsNavigation.js +++ b/src/components/settings/navigation/SettingsNavigation.js | |||
@@ -1,6 +1,7 @@ | |||
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 { defineMessages, intlShape } from 'react-intl'; | 3 | import { defineMessages, intlShape } from 'react-intl'; |
4 | import { inject, observer } from 'mobx-react'; | ||
4 | 5 | ||
5 | import Link from '../../ui/Link'; | 6 | import Link from '../../ui/Link'; |
6 | 7 | ||
@@ -31,6 +32,7 @@ const messages = defineMessages({ | |||
31 | }, | 32 | }, |
32 | }); | 33 | }); |
33 | 34 | ||
35 | @inject('stores') @observer | ||
34 | export default class SettingsNavigation extends Component { | 36 | export default class SettingsNavigation extends Component { |
35 | static propTypes = { | 37 | static propTypes = { |
36 | serviceCount: PropTypes.number.isRequired, | 38 | serviceCount: PropTypes.number.isRequired, |
@@ -42,17 +44,20 @@ export default class SettingsNavigation extends Component { | |||
42 | 44 | ||
43 | render() { | 45 | render() { |
44 | const { serviceCount } = this.props; | 46 | const { serviceCount } = this.props; |
47 | const { features } = this.props.stores.features; | ||
45 | const { intl } = this.context; | 48 | const { intl } = this.context; |
46 | 49 | ||
47 | return ( | 50 | return ( |
48 | <div className="settings-navigation"> | 51 | <div className="settings-navigation"> |
49 | <Link | 52 | {features.userCanManageServices && ( |
50 | to="/settings/recipes" | 53 | <Link |
51 | className="settings-navigation__link" | 54 | to="/settings/recipes" |
52 | activeClassName="is-active" | 55 | className="settings-navigation__link" |
53 | > | 56 | activeClassName="is-active" |
54 | {intl.formatMessage(messages.availableServices)} | 57 | > |
55 | </Link> | 58 | {intl.formatMessage(messages.availableServices)} |
59 | </Link> | ||
60 | )} | ||
56 | <Link | 61 | <Link |
57 | to="/settings/services" | 62 | to="/settings/services" |
58 | className="settings-navigation__link" | 63 | className="settings-navigation__link" |
@@ -92,3 +97,12 @@ export default class SettingsNavigation extends Component { | |||
92 | ); | 97 | ); |
93 | } | 98 | } |
94 | } | 99 | } |
100 | |||
101 | SettingsNavigation.wrappedComponent.propTypes = { | ||
102 | stores: PropTypes.shape({ | ||
103 | features: PropTypes.shape({ | ||
104 | features: PropTypes.object.isRequired, | ||
105 | }).isRequired, | ||
106 | }).isRequired, | ||
107 | }; | ||
108 | |||