diff options
Diffstat (limited to 'src/features/workspaces/components/WorkspaceServiceListItem.js')
-rw-r--r-- | src/features/workspaces/components/WorkspaceServiceListItem.js | 43 |
1 files changed, 34 insertions, 9 deletions
diff --git a/src/features/workspaces/components/WorkspaceServiceListItem.js b/src/features/workspaces/components/WorkspaceServiceListItem.js index 7b516d056..e05b21440 100644 --- a/src/features/workspaces/components/WorkspaceServiceListItem.js +++ b/src/features/workspaces/components/WorkspaceServiceListItem.js | |||
@@ -2,23 +2,37 @@ import React, { Component } from 'react'; | |||
2 | import PropTypes from 'prop-types'; | 2 | import PropTypes from 'prop-types'; |
3 | import { observer } from 'mobx-react'; | 3 | import { observer } from 'mobx-react'; |
4 | import injectSheet from 'react-jss'; | 4 | import injectSheet from 'react-jss'; |
5 | import classnames from 'classnames'; | ||
5 | import { Toggle } from '@meetfranz/forms'; | 6 | import { Toggle } from '@meetfranz/forms'; |
6 | 7 | ||
7 | import Service from '../../../models/Service'; | 8 | import Service from '../../../models/Service'; |
8 | import ServiceIcon from '../../../components/ui/ServiceIcon'; | 9 | import ServiceIcon from '../../../components/ui/ServiceIcon'; |
9 | 10 | ||
10 | const styles = theme => ({ | 11 | const styles = theme => ({ |
11 | service: { | 12 | listItem: { |
12 | height: theme.workspaceSettings.listItemHeight, | 13 | height: theme.workspaces.settings.listItems.height, |
14 | borderBottom: `1px solid ${theme.workspaces.settings.listItems.borderColor}`, | ||
13 | display: 'flex', | 15 | display: 'flex', |
16 | alignItems: 'center', | ||
14 | }, | 17 | }, |
15 | name: { | 18 | serviceIcon: { |
16 | marginTop: '4px', | 19 | padding: theme.workspaces.settings.listItems.padding, |
20 | }, | ||
21 | toggle: { | ||
22 | height: 'auto', | ||
23 | margin: 0, | ||
24 | }, | ||
25 | label: { | ||
26 | padding: theme.workspaces.settings.listItems.padding, | ||
27 | flexGrow: 1, | ||
28 | }, | ||
29 | disabledLabel: { | ||
30 | color: theme.workspaces.settings.listItems.disabled.color, | ||
17 | }, | 31 | }, |
18 | }); | 32 | }); |
19 | 33 | ||
20 | @injectSheet(styles) @observer | 34 | @injectSheet(styles) @observer |
21 | class ServiceListItem extends Component { | 35 | class WorkspaceServiceListItem extends Component { |
22 | static propTypes = { | 36 | static propTypes = { |
23 | classes: PropTypes.object.isRequired, | 37 | classes: PropTypes.object.isRequired, |
24 | isInWorkspace: PropTypes.bool.isRequired, | 38 | isInWorkspace: PropTypes.bool.isRequired, |
@@ -35,16 +49,27 @@ class ServiceListItem extends Component { | |||
35 | } = this.props; | 49 | } = this.props; |
36 | 50 | ||
37 | return ( | 51 | return ( |
38 | <div className={classes.service}> | 52 | <div className={classes.listItem}> |
39 | <ServiceIcon service={service} /> | 53 | <ServiceIcon |
54 | className={classes.serviceIcon} | ||
55 | service={service} | ||
56 | /> | ||
57 | <span | ||
58 | className={classnames([ | ||
59 | classes.label, | ||
60 | service.isEnabled ? null : classes.disabledLabel, | ||
61 | ])} | ||
62 | > | ||
63 | {service.name} | ||
64 | </span> | ||
40 | <Toggle | 65 | <Toggle |
66 | className={classes.toggle} | ||
41 | checked={isInWorkspace} | 67 | checked={isInWorkspace} |
42 | onChange={onToggle} | 68 | onChange={onToggle} |
43 | label={service.name} | ||
44 | /> | 69 | /> |
45 | </div> | 70 | </div> |
46 | ); | 71 | ); |
47 | } | 72 | } |
48 | } | 73 | } |
49 | 74 | ||
50 | export default ServiceListItem; | 75 | export default WorkspaceServiceListItem; |