gbs-add-block 0.0.84 → 0.0.85
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/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# GBS Building Blocks 2.0 (v0.0.
|
|
1
|
+
# GBS Building Blocks 2.0 (v0.0.85)
|
|
2
2
|
|
|
3
3
|
Latest and upgraded version of GBS building blocks with headless UI and removed dependencies.
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@ Latest and upgraded version of GBS building blocks with headless UI and removed
|
|
|
6
6
|
|
|
7
7
|
For detailed documentation on usage and props, Please visit: [Building Block Documentation v2.0](https://blackmax-designs.gitbook.io/building-block-v2.0)
|
|
8
8
|
|
|
9
|
-
## What's New 🎉 (Ver 0.0.
|
|
9
|
+
## What's New 🎉 (Ver 0.0.85)
|
|
10
10
|
|
|
11
11
|
- Updated for bug fixes.
|
|
12
12
|
- New Component Card, Tabs & SideBar Added
|
package/package.json
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
1
2
|
import { MenuItem, IconComponent } from "../type";
|
|
2
3
|
|
|
3
4
|
type MenuItemProps = {
|
|
@@ -12,6 +13,13 @@ export const MenuItemComponent = ({
|
|
|
12
13
|
onToggle,
|
|
13
14
|
}: MenuItemProps) => {
|
|
14
15
|
const IconComponent = iconMap[item.icon] || (() => null);
|
|
16
|
+
const [path, setPath] = useState("");
|
|
17
|
+
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (typeof window !== "undefined") {
|
|
20
|
+
setPath(window.location.pathname);
|
|
21
|
+
}
|
|
22
|
+
}, []);
|
|
15
23
|
|
|
16
24
|
return (
|
|
17
25
|
<li>
|
|
@@ -26,7 +34,7 @@ export const MenuItemComponent = ({
|
|
|
26
34
|
: undefined
|
|
27
35
|
}
|
|
28
36
|
className={`flex items-center py-2 px-3 rounded-md text-sm ${
|
|
29
|
-
item.
|
|
37
|
+
item.path === path
|
|
30
38
|
? "bg-gray-100 text-black font-medium"
|
|
31
39
|
: "text-gray-700 hover:bg-gray-50"
|
|
32
40
|
}`}
|