groovinads-ui 1.2.54 → 1.2.57
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.
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "groovinads-ui",
|
|
3
3
|
"description": "Groovinads UI is a React component library designed exclusively for Groovinads applications. It provides ready-to-use UI elements styled according to Groovinads design guidelines to facilitate rapid development.",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.57",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"css",
|
|
7
7
|
"sass",
|
|
@@ -21,13 +21,11 @@ const Sidebar = ({
|
|
|
21
21
|
onNavigate,
|
|
22
22
|
selectedClient,
|
|
23
23
|
showClients = false,
|
|
24
|
-
setGroovinProfile
|
|
25
|
-
inModal = false,
|
|
26
|
-
customUrl,
|
|
24
|
+
setGroovinProfile
|
|
27
25
|
}) => {
|
|
28
|
-
const isMobile =
|
|
26
|
+
const isMobile = useMediaQuery({ query: '(max-width: 992px)' });
|
|
29
27
|
|
|
30
|
-
const url =
|
|
28
|
+
const url = window.location.pathname; // to get current url
|
|
31
29
|
|
|
32
30
|
const [sidebarLinks, setSidebarLinks] = useState([]);
|
|
33
31
|
const [openIndex, setOpenIndex] = useState(null);
|
|
@@ -54,27 +52,23 @@ const Sidebar = ({
|
|
|
54
52
|
}, [show]);
|
|
55
53
|
|
|
56
54
|
useEffect(() => {
|
|
57
|
-
if (isMobile && setShow
|
|
58
|
-
|
|
55
|
+
if (isMobile && setShow) setShow(innerShow);
|
|
56
|
+
setInnerShow(isMobile ? false : firstOpen.current ? defaultOpened : show);
|
|
59
57
|
firstOpen.current = false;
|
|
60
58
|
}, []);
|
|
61
59
|
|
|
62
60
|
return (
|
|
63
61
|
<Collapse in={innerShow} dimension={'width'}>
|
|
64
62
|
<nav id='sidebarMenu' className='sidebar' ref={sidebarRef}>
|
|
65
|
-
|
|
66
|
-
<
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
</div>
|
|
75
|
-
) : (
|
|
76
|
-
<></>
|
|
77
|
-
)}
|
|
63
|
+
<div className='position-relative d-none d-lg-block'>
|
|
64
|
+
<button
|
|
65
|
+
className='collapse-button'
|
|
66
|
+
// Toggle the sidebar
|
|
67
|
+
onClick={() => setInnerShow((prev) => !prev)}
|
|
68
|
+
>
|
|
69
|
+
<Icon className='collapse-icon' iconName='chevron-left' />
|
|
70
|
+
</button>
|
|
71
|
+
</div>
|
|
78
72
|
|
|
79
73
|
{/* SECTIONS */}
|
|
80
74
|
<div className='scroll'>
|
|
@@ -161,12 +155,7 @@ Sidebar.propTypes = {
|
|
|
161
155
|
onNavigate: PropTypes.func.isRequired, // Nueva prop para manejar la navegación
|
|
162
156
|
selectedClient: PropTypes.object,
|
|
163
157
|
showClients:PropTypes.oneOf([true, false, 'single']),
|
|
164
|
-
setGroovinProfile: PropTypes.func
|
|
165
|
-
inModal: PropTypes.bool,
|
|
166
|
-
customUrl: PropTypes.oneOfType([
|
|
167
|
-
PropTypes.string,
|
|
168
|
-
PropTypes.oneOf([undefined])
|
|
169
|
-
]),
|
|
158
|
+
setGroovinProfile: PropTypes.func
|
|
170
159
|
};
|
|
171
160
|
|
|
172
161
|
export default Sidebar;
|