X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/8dda39e1ac1e43d08881b8ac19db92c18d1cb4fe..22b7bf88fb799c912a813790301f715fb6b8ccf0:/src/components/list-item-text-icon/list-item-text-icon.tsx diff --git a/src/components/list-item-text-icon/list-item-text-icon.tsx b/src/components/list-item-text-icon/list-item-text-icon.tsx index f140d860..6f8a2c43 100644 --- a/src/components/list-item-text-icon/list-item-text-icon.tsx +++ b/src/components/list-item-text-icon/list-item-text-icon.tsx @@ -9,40 +9,8 @@ import { ListItemIcon, ListItemText, Typography } from '@material-ui/core'; import { IconType } from '../icon/icon'; import * as classnames from "classnames"; -export interface ListItemTextIconDataProps { - icon: IconType; - name: string; - isActive?: boolean; - hasMargin?: boolean; -} - -type ListItemTextIconProps = ListItemTextIconDataProps & WithStyles; - -class ListItemTextIcon extends React.Component { - render() { - const { classes, isActive, hasMargin, name, icon: Icon } = this.props; - return ( - - - - - - {name} - - } /> - - ); - } -} - type CssRules = 'root' | 'listItemText' | 'hasMargin' | 'active'; - + const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ root: { display: 'flex', @@ -55,8 +23,40 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ color: theme.palette.primary.main, }, hasMargin: { - marginLeft: '18px', + marginLeft: `${theme.spacing.unit}px`, }, }); -export default withStyles(styles)(ListItemTextIcon); \ No newline at end of file +export interface ListItemTextIconDataProps { + icon: IconType; + name: string; + isActive?: boolean; + hasMargin?: boolean; +} + +type ListItemTextIconProps = ListItemTextIconDataProps & WithStyles; + +export const ListItemTextIcon = withStyles(styles)( + class extends React.Component { + render() { + const { classes, isActive, hasMargin, name, icon: Icon } = this.props; + return ( + + + + + + {name} + + } /> + + ); + } + } +);