UNPKG

1.5 kBJavaScriptView Raw
1"use strict";
2
3var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
4
5var _react = _interopRequireDefault(require("react"));
6
7var _styles = require("@material-ui/core/styles");
8
9var _ListItem = _interopRequireDefault(require("@material-ui/core/ListItem"));
10
11var _ListItemIcon = _interopRequireDefault(require("@material-ui/core/ListItemIcon"));
12
13var _ListItemText = _interopRequireDefault(require("@material-ui/core/ListItemText"));
14
15var _propTypes = _interopRequireDefault(require("prop-types"));
16
17/* eslint-disable import/no-extraneous-dependencies */
18// flow-disable-next-line
19// flow-disable-next-line
20// flow-disable-next-line
21// flow-disable-next-line
22var styles = {
23 label: {
24 '& > span': {
25 textDecoration: 'none',
26 display: 'inline-block'
27 }
28 }
29};
30
31var DrawerItemJSX = function DrawerItemJSX(_ref) {
32 var classes = _ref.classes,
33 label = _ref.label,
34 Icon = _ref.icon;
35 return _react.default.createElement(_ListItem.default, {
36 button: true
37 }, Icon && _react.default.createElement(_ListItemIcon.default, null, _react.default.createElement(Icon, null)), _react.default.createElement(_ListItemText.default, {
38 primary: label,
39 className: classes.label
40 }));
41};
42
43DrawerItemJSX.propTypes = {
44 classes: _propTypes.default.object.isRequired,
45 label: _propTypes.default.string.isRequired,
46 icon: _propTypes.default.func
47};
48var DrawerItem = (0, _styles.withStyles)(styles)(DrawerItemJSX);
49module.exports = DrawerItem;
\No newline at end of file