imbric-theme 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -5,12 +5,9 @@ import styles from './ItemMenu.module.css'
|
|
|
5
5
|
import { options } from './constants'
|
|
6
6
|
import withStyles from '../../hocs/withStyles'
|
|
7
7
|
|
|
8
|
-
import { Link, Route, BrowserRouter } from 'react-router-dom'
|
|
9
|
-
|
|
10
8
|
import Icon from '../../atoms/Icon'
|
|
11
9
|
|
|
12
|
-
|
|
13
|
-
export const ItemMenu = ({ children, getStyles, size, icon, color, background, subMenu, itemSubmenu, toHref }) => {
|
|
10
|
+
export const ItemMenu = ({ children, getStyles, size, icon, color, background, subMenu, itemSubmenu }) => {
|
|
14
11
|
|
|
15
12
|
//create initial menuCollapse state using useState hook
|
|
16
13
|
const [subMenuCollapse, setSubMenuCollapse] = useState(false)
|
|
@@ -25,33 +22,29 @@ export const ItemMenu = ({ children, getStyles, size, icon, color, background, s
|
|
|
25
22
|
if (!subMenu) {
|
|
26
23
|
return (
|
|
27
24
|
<>
|
|
28
|
-
<
|
|
29
|
-
<Link to={toHref}>
|
|
30
|
-
<li className={getStyles('pro-menu-item')}>
|
|
25
|
+
<li className={getStyles('pro-menu-item')}>
|
|
31
26
|
|
|
32
|
-
|
|
27
|
+
<div className={getStyles('pro-inner-item')}>
|
|
33
28
|
|
|
34
|
-
|
|
29
|
+
<span className={getStyles('pro-icon-wrapper')}>
|
|
35
30
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
31
|
+
<span className={getStyles('pro-icon')}>
|
|
32
|
+
<Icon
|
|
33
|
+
size={size}
|
|
34
|
+
name={icon}
|
|
35
|
+
color={color}
|
|
36
|
+
background={background}
|
|
37
|
+
onClick={function noRefCheck() { }}
|
|
38
|
+
/>
|
|
39
|
+
</span>
|
|
45
40
|
|
|
46
|
-
|
|
41
|
+
</span>
|
|
47
42
|
|
|
48
|
-
|
|
43
|
+
<span className={getStyles('pro-item-content', { 'color': color })}>{children}</span>
|
|
49
44
|
|
|
50
|
-
|
|
45
|
+
</div>
|
|
51
46
|
|
|
52
|
-
|
|
53
|
-
</Link>
|
|
54
|
-
</BrowserRouter>
|
|
47
|
+
</li>
|
|
55
48
|
</>
|
|
56
49
|
)
|
|
57
50
|
} else {
|
|
@@ -117,7 +110,6 @@ ItemMenu.propTypes = {
|
|
|
117
110
|
|
|
118
111
|
ItemMenu.defaultProps = {
|
|
119
112
|
subMenu: false,
|
|
120
|
-
toHref: '/',
|
|
121
113
|
icon: 'home',
|
|
122
114
|
size: 'lg',
|
|
123
115
|
color: 'highlight',
|
package/package.json
CHANGED