listpage-next 0.0.254 → 0.0.255
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
3
|
import { Outlet, useNavigate } from "react-router-dom";
|
|
4
|
-
import { PageLayout } from "../../components/index.js";
|
|
4
|
+
import { PageLayout, usePageContext } from "../../components/index.js";
|
|
5
5
|
import { Menu } from "../../ui/Menu/index.js";
|
|
6
6
|
import { getDefaultActiveKey } from "./utils.js";
|
|
7
7
|
const Layout = (props)=>{
|
|
@@ -17,11 +17,23 @@ const Layout = (props)=>{
|
|
|
17
17
|
title
|
|
18
18
|
},
|
|
19
19
|
content: /*#__PURE__*/ jsx(Outlet, {}),
|
|
20
|
-
|
|
20
|
+
siderProps: {
|
|
21
|
+
style: {
|
|
22
|
+
padding: 0
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
sider: /*#__PURE__*/ jsx(Sider, {
|
|
21
26
|
items: menus,
|
|
22
27
|
defaultActiveKey: defaultActiveKey,
|
|
23
28
|
onSelect: navigate
|
|
24
29
|
})
|
|
25
30
|
});
|
|
26
31
|
};
|
|
32
|
+
const Sider = (props)=>{
|
|
33
|
+
const { collapsed } = usePageContext();
|
|
34
|
+
return /*#__PURE__*/ jsx(Menu, {
|
|
35
|
+
isCollapsed: collapsed,
|
|
36
|
+
...props
|
|
37
|
+
});
|
|
38
|
+
};
|
|
27
39
|
export { Layout };
|
package/dist/ui/Menu/index.js
CHANGED
|
@@ -18,7 +18,7 @@ const Menu = (props)=>{
|
|
|
18
18
|
]);
|
|
19
19
|
};
|
|
20
20
|
return /*#__PURE__*/ jsxs("div", {
|
|
21
|
-
className: `overflow-y-auto overflow-x-hidden py-2 px-2 scrollbar-hide bg-[#000c17] ${isCollapsed ? 'w-[80px]' : 'flex-1'}`,
|
|
21
|
+
className: `h-full overflow-y-auto overflow-x-hidden py-2 px-2 scrollbar-hide bg-[#000c17] ${isCollapsed ? 'w-[80px]' : 'flex-1'}`,
|
|
22
22
|
children: [
|
|
23
23
|
!isCollapsed && title && /*#__PURE__*/ jsx("div", {
|
|
24
24
|
className: "px-3 mb-2 mt-2 text-[11px] font-medium text-neutral-500 uppercase tracking-widest",
|