groovinads-ui 1.2.53 → 1.2.55

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.53",
4
+ "version": "1.2.55",
5
5
  "keywords": [
6
6
  "css",
7
7
  "sass",
@@ -21,11 +21,13 @@ const Sidebar = ({
21
21
  onNavigate,
22
22
  selectedClient,
23
23
  showClients = false,
24
- setGroovinProfile
24
+ setGroovinProfile,
25
+ inModal = false,
26
+ customUrl,
25
27
  }) => {
26
- const isMobile = useMediaQuery({ query: '(max-width: 992px)' });
28
+ const isMobile = inModal ? true : useMediaQuery({ query: '(max-width: 992px)' });
27
29
 
28
- const url = window.location.pathname; // to get current url
30
+ const url = customUrl !== undefined ? customUrl : window.location.pathname; // to get current url
29
31
 
30
32
  const [sidebarLinks, setSidebarLinks] = useState([]);
31
33
  const [openIndex, setOpenIndex] = useState(null);
@@ -52,29 +54,33 @@ const Sidebar = ({
52
54
  }, [show]);
53
55
 
54
56
  useEffect(() => {
55
- if (isMobile && setShow) setShow(innerShow);
56
- setInnerShow(isMobile ? false : firstOpen.current ? defaultOpened : show);
57
+ if (isMobile && setShow && !inModal) setShow(innerShow);
58
+ if (!inModal) setInnerShow(isMobile ? false : firstOpen.current ? defaultOpened : show);
57
59
  firstOpen.current = false;
58
60
  }, []);
59
61
 
60
62
  return (
61
63
  <Collapse in={innerShow} dimension={'width'}>
62
64
  <nav id='sidebarMenu' className='sidebar' ref={sidebarRef}>
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>
65
+ {!inModal ? (
66
+ <div className='position-relative d-none d-lg-block'>
67
+ <button
68
+ className='collapse-button'
69
+ // Toggle the sidebar
70
+ onClick={() => setInnerShow((prev) => !prev)}
71
+ >
72
+ <Icon className='collapse-icon' iconName='chevron-left' />
73
+ </button>
74
+ </div>
75
+ ) : (
76
+ <></>
77
+ )}
72
78
 
73
79
  {/* SECTIONS */}
74
80
  <div className='scroll'>
75
81
  {customLinks.map((section, i) => (
76
82
  <div className='sidebar-section' key={`sectionIndex${i}`}>
77
- <h4>{section.title}</h4>
83
+ {section.title ? <h4>{section.title}</h4> : <></> }
78
84
 
79
85
  {/* PROPS LINKS */}
80
86
  {(section.backData ? sidebarLinks : section.links || []).map(
@@ -155,7 +161,12 @@ Sidebar.propTypes = {
155
161
  onNavigate: PropTypes.func.isRequired, // Nueva prop para manejar la navegación
156
162
  selectedClient: PropTypes.object,
157
163
  showClients:PropTypes.oneOf([true, false, 'single']),
158
- setGroovinProfile: PropTypes.func
164
+ setGroovinProfile: PropTypes.func,
165
+ inModal: PropTypes.bool,
166
+ customUrl: PropTypes.oneOfType([
167
+ PropTypes.string,
168
+ PropTypes.oneOf([undefined])
169
+ ]),
159
170
  };
160
171
 
161
172
  export default Sidebar;
@@ -14,8 +14,6 @@ function ToastCardComponent({ variant, autoClose, children, className, position
14
14
  error: 'circle-xmark',
15
15
  };
16
16
 
17
- console.log('Hola');
18
-
19
17
  return (
20
18
  <Toast
21
19
  onClose={toggleShow}