@xyo-network/react-appbar 2.36.0 → 2.36.1
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/dist/cjs/components/CollapsibleDrawer/CollapseToggle.d.ts.map +1 -1
- package/dist/cjs/components/CollapsibleDrawer/CollapseToggle.js +2 -5
- package/dist/cjs/components/CollapsibleDrawer/CollapseToggle.js.map +1 -1
- package/dist/cjs/components/CollapsibleDrawer/ExampleMenuData.d.ts.map +1 -1
- package/dist/cjs/components/CollapsibleDrawer/ExampleMenuData.js +14 -10
- package/dist/cjs/components/CollapsibleDrawer/ExampleMenuData.js.map +1 -1
- package/dist/cjs/components/SiteMenu/MenuIcon.d.ts +2 -2
- package/dist/cjs/components/SiteMenu/MenuIcon.d.ts.map +1 -1
- package/dist/cjs/components/SiteMenu/MenuIcon.js +1 -1
- package/dist/cjs/components/SiteMenu/MenuIcon.js.map +1 -1
- package/dist/cjs/components/SiteMenu/MenuItems.d.ts +1 -1
- package/dist/cjs/components/SiteMenu/MenuItems.d.ts.map +1 -1
- package/dist/cjs/components/SiteMenu/MenuItems.js +5 -3
- package/dist/cjs/components/SiteMenu/MenuItems.js.map +1 -1
- package/dist/cjs/components/SiteMenu/MenuSection.d.ts +10 -0
- package/dist/cjs/components/SiteMenu/MenuSection.d.ts.map +1 -0
- package/dist/cjs/components/SiteMenu/MenuSection.js +13 -0
- package/dist/cjs/components/SiteMenu/MenuSection.js.map +1 -0
- package/dist/cjs/components/SiteMenu/index.d.ts +1 -0
- package/dist/cjs/components/SiteMenu/index.d.ts.map +1 -1
- package/dist/cjs/components/SiteMenu/index.js +1 -0
- package/dist/cjs/components/SiteMenu/index.js.map +1 -1
- package/dist/docs.json +339 -159
- package/dist/esm/components/CollapsibleDrawer/CollapseToggle.d.ts.map +1 -1
- package/dist/esm/components/CollapsibleDrawer/CollapseToggle.js +2 -4
- package/dist/esm/components/CollapsibleDrawer/CollapseToggle.js.map +1 -1
- package/dist/esm/components/CollapsibleDrawer/ExampleMenuData.d.ts.map +1 -1
- package/dist/esm/components/CollapsibleDrawer/ExampleMenuData.js +15 -11
- package/dist/esm/components/CollapsibleDrawer/ExampleMenuData.js.map +1 -1
- package/dist/esm/components/SiteMenu/MenuIcon.d.ts +2 -2
- package/dist/esm/components/SiteMenu/MenuIcon.d.ts.map +1 -1
- package/dist/esm/components/SiteMenu/MenuIcon.js +1 -1
- package/dist/esm/components/SiteMenu/MenuIcon.js.map +1 -1
- package/dist/esm/components/SiteMenu/MenuItems.d.ts +1 -1
- package/dist/esm/components/SiteMenu/MenuItems.d.ts.map +1 -1
- package/dist/esm/components/SiteMenu/MenuItems.js +6 -4
- package/dist/esm/components/SiteMenu/MenuItems.js.map +1 -1
- package/dist/esm/components/SiteMenu/MenuSection.d.ts +10 -0
- package/dist/esm/components/SiteMenu/MenuSection.d.ts.map +1 -0
- package/dist/esm/components/SiteMenu/MenuSection.js +7 -0
- package/dist/esm/components/SiteMenu/MenuSection.js.map +1 -0
- package/dist/esm/components/SiteMenu/index.d.ts +1 -0
- package/dist/esm/components/SiteMenu/index.d.ts.map +1 -1
- package/dist/esm/components/SiteMenu/index.js +1 -0
- package/dist/esm/components/SiteMenu/index.js.map +1 -1
- package/package.json +6 -6
- package/src/components/CollapsibleDrawer/CollapseDrawer.stories.tsx +5 -18
- package/src/components/CollapsibleDrawer/CollapseToggle.tsx +2 -4
- package/src/components/CollapsibleDrawer/ExampleMenuData.tsx +17 -10
- package/src/components/SiteMenu/MenuIcon.tsx +3 -4
- package/src/components/SiteMenu/MenuItems.tsx +17 -23
- package/src/components/SiteMenu/MenuSection.tsx +22 -0
- package/src/components/SiteMenu/index.ts +1 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CollapseToggle.d.ts","sourceRoot":"","sources":["../../../../src/components/CollapsibleDrawer/CollapseToggle.tsx"],"names":[],"mappings":";
|
1
|
+
{"version":3,"file":"CollapseToggle.d.ts","sourceRoot":"","sources":["../../../../src/components/CollapsibleDrawer/CollapseToggle.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAW,MAAM,uBAAuB,CAAA;AAK7D,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAoBrD,CAAA"}
|
@@ -1,8 +1,7 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
-
import KeyboardDoubleArrowLeftRoundedIcon from '@mui/icons-material/KeyboardDoubleArrowLeftRounded';
|
3
|
-
import KeyboardDoubleArrowRightRounded from '@mui/icons-material/KeyboardDoubleArrowRightRounded';
|
4
2
|
import { IconButton } from '@mui/material';
|
5
3
|
import { FlexRow } from '@xylabs/react-flexbox';
|
4
|
+
import { VscArrowSmallLeft, VscArrowSmallRight } from 'react-icons/vsc';
|
6
5
|
import { useCollapsible } from '../../contexts';
|
7
6
|
export const CollapseToggleFlex = (props) => {
|
8
7
|
const { collapse, setCollapse, setCollapseEnd } = useCollapsible();
|
@@ -12,7 +11,6 @@ export const CollapseToggleFlex = (props) => {
|
|
12
11
|
};
|
13
12
|
return (_jsx(FlexRow, { mt: 2, py: 2, ...props, children: _jsx(IconButton, { onClick: handleCollapseToggle, sx: {
|
14
13
|
flexDirection: 'column',
|
15
|
-
|
16
|
-
}, children: !collapse ? _jsx(KeyboardDoubleArrowLeftRoundedIcon, {}) : _jsx(KeyboardDoubleArrowRightRounded, {}) }) }));
|
14
|
+
}, children: !collapse ? _jsx(VscArrowSmallLeft, {}) : _jsx(VscArrowSmallRight, {}) }) }));
|
17
15
|
};
|
18
16
|
//# sourceMappingURL=CollapseToggle.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CollapseToggle.js","sourceRoot":"","sources":["../../../../src/components/CollapsibleDrawer/CollapseToggle.tsx"],"names":[],"mappings":";AAAA,OAAO,
|
1
|
+
{"version":3,"file":"CollapseToggle.js","sourceRoot":"","sources":["../../../../src/components/CollapsibleDrawer/CollapseToggle.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAgB,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAEvE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAE/C,MAAM,CAAC,MAAM,kBAAkB,GAA2B,CAAC,KAAK,EAAE,EAAE;IAClE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,GAAG,cAAc,EAAE,CAAA;IAElE,MAAM,oBAAoB,GAAG,GAAG,EAAE;QAChC,WAAW,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAA;QACxB,cAAc,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAA;IAC/D,CAAC,CAAA;IAED,OAAO,CACL,KAAC,OAAO,IAAC,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,KAAM,KAAK,YAC9B,KAAC,UAAU,IACT,OAAO,EAAE,oBAAoB,EAC7B,EAAE,EAAE;gBACF,aAAa,EAAE,QAAQ;aACxB,YAEA,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAC,iBAAiB,KAAG,CAAC,CAAC,CAAC,KAAC,kBAAkB,KAAG,GAChD,GACL,CACX,CAAA;AACH,CAAC,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ExampleMenuData.d.ts","sourceRoot":"","sources":["../../../../src/components/CollapsibleDrawer/ExampleMenuData.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"ExampleMenuData.d.ts","sourceRoot":"","sources":["../../../../src/components/CollapsibleDrawer/ExampleMenuData.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAEnD,eAAO,MAAM,WAAW,EAAE,qBAAqB,EAoC9C,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,qBAAqB,EAyBjD,CAAA"}
|
@@ -1,59 +1,63 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
-
import { VscAccount, VscGlobe, VscGraph, VscGraphLine, VscJson, VscServer, VscSettingsGear, VscSymbolMethod, VscSymbolNamespace, } from 'react-icons/vsc';
|
2
|
+
import { VscAccount, VscAdd, VscDashboard, VscGlobe, VscGraph, VscGraphLine, VscJson, VscServer, VscSettingsGear, VscSymbolMethod, VscSymbolNamespace, VscTable, } from 'react-icons/vsc';
|
3
3
|
export const menuDataTop = [
|
4
4
|
{
|
5
|
-
icon: _jsx(VscGlobe, {}),
|
5
|
+
icon: _jsx(VscGlobe, { fontSize: "body1" }),
|
6
6
|
primary: 'Explore',
|
7
|
-
subNavListItems: [{ primary: 'Explore', to: '', tooltip: 'View global archivist data on a world map.' }],
|
8
7
|
to: '',
|
9
8
|
tooltip: 'View global archivist data on a world map.',
|
10
9
|
},
|
11
10
|
{
|
12
|
-
icon: _jsx(VscSymbolMethod, {}),
|
11
|
+
icon: _jsx(VscSymbolMethod, { fontSize: "body1" }),
|
13
12
|
primary: 'Blocks',
|
14
13
|
to: '',
|
15
14
|
tooltip: 'The most recent blocks seen in the in temp archive on your current network.',
|
16
15
|
},
|
17
16
|
{
|
18
|
-
icon: _jsx(VscSymbolNamespace, {}),
|
17
|
+
icon: _jsx(VscSymbolNamespace, { fontSize: "body1" }),
|
19
18
|
primary: 'Payloads',
|
20
19
|
to: '',
|
21
20
|
tooltip: 'The most recent blocks seen in the in temp archive on your current network.',
|
22
21
|
},
|
23
22
|
{
|
24
|
-
icon: _jsx(VscGraph, {}),
|
23
|
+
icon: _jsx(VscGraph, { fontSize: "body1" }),
|
25
24
|
primary: 'Queries',
|
26
25
|
to: '',
|
27
26
|
tooltip: 'The most recent blocks seen in the in temp archive on your current network.',
|
28
27
|
},
|
29
28
|
{
|
30
|
-
icon: _jsx(VscServer, {}),
|
29
|
+
icon: _jsx(VscServer, { fontSize: "body1" }),
|
31
30
|
primary: 'Archives',
|
31
|
+
subNavListItems: [
|
32
|
+
{ icon: _jsx(VscDashboard, { fontSize: "body2" }), primary: 'Dashboard', to: '', tooltip: 'View data for all archives on this network.' },
|
33
|
+
{ icon: _jsx(VscAdd, { fontSize: "body2" }), primary: 'Create Archive', to: '', tooltip: 'Create a new archive on this network.' },
|
34
|
+
{ icon: _jsx(VscTable, { fontSize: "body2" }), primary: 'Archive Table', to: '', tooltip: 'View all archives on this network as a table.' },
|
35
|
+
],
|
32
36
|
to: '',
|
33
37
|
tooltip: 'The most recent blocks seen in the in temp archive on your current network.',
|
34
38
|
},
|
35
39
|
];
|
36
40
|
export const menuDataBottom = [
|
37
41
|
{
|
38
|
-
icon: _jsx(VscGraphLine, {}),
|
42
|
+
icon: _jsx(VscGraphLine, { fontSize: "body1" }),
|
39
43
|
primary: 'Statistics',
|
40
44
|
to: '',
|
41
45
|
tooltip: 'The most recent blocks seen in the in temp archive on your current network.',
|
42
46
|
},
|
43
47
|
{
|
44
|
-
icon: _jsx(VscJson, {}),
|
48
|
+
icon: _jsx(VscJson, { fontSize: "body1" }),
|
45
49
|
primary: 'Schema',
|
46
50
|
to: '',
|
47
51
|
tooltip: 'The most recent blocks seen in the in temp archive on your current network.',
|
48
52
|
},
|
49
53
|
{
|
50
|
-
icon: _jsx(VscAccount, {}),
|
54
|
+
icon: _jsx(VscAccount, { fontSize: "body1" }),
|
51
55
|
primary: 'Account',
|
52
56
|
to: '',
|
53
57
|
tooltip: 'The most recent blocks seen in the in temp archive on your current network.',
|
54
58
|
},
|
55
59
|
{
|
56
|
-
icon: _jsx(VscSettingsGear, {}),
|
60
|
+
icon: _jsx(VscSettingsGear, { fontSize: "body1" }),
|
57
61
|
primary: 'Settings',
|
58
62
|
to: '',
|
59
63
|
tooltip: 'The most recent blocks seen in the in temp archive on your current network.',
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ExampleMenuData.js","sourceRoot":"","sources":["../../../../src/components/CollapsibleDrawer/ExampleMenuData.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,OAAO,EACP,SAAS,EACT,eAAe,EACf,eAAe,EACf,kBAAkB,
|
1
|
+
{"version":3,"file":"ExampleMenuData.js","sourceRoot":"","sources":["../../../../src/components/CollapsibleDrawer/ExampleMenuData.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EACV,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,OAAO,EACP,SAAS,EACT,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,QAAQ,GACT,MAAM,iBAAiB,CAAA;AAIxB,MAAM,CAAC,MAAM,WAAW,GAA4B;IAClD;QACE,IAAI,EAAE,KAAC,QAAQ,IAAC,QAAQ,EAAC,OAAO,GAAG;QACnC,OAAO,EAAE,SAAS;QAClB,EAAE,EAAE,EAAE;QACN,OAAO,EAAE,4CAA4C;KACtD;IACD;QACE,IAAI,EAAE,KAAC,eAAe,IAAC,QAAQ,EAAC,OAAO,GAAG;QAC1C,OAAO,EAAE,QAAQ;QACjB,EAAE,EAAE,EAAE;QACN,OAAO,EAAE,6EAA6E;KACvF;IACD;QACE,IAAI,EAAE,KAAC,kBAAkB,IAAC,QAAQ,EAAC,OAAO,GAAG;QAC7C,OAAO,EAAE,UAAU;QACnB,EAAE,EAAE,EAAE;QACN,OAAO,EAAE,6EAA6E;KACvF;IACD;QACE,IAAI,EAAE,KAAC,QAAQ,IAAC,QAAQ,EAAC,OAAO,GAAG;QACnC,OAAO,EAAE,SAAS;QAClB,EAAE,EAAE,EAAE;QACN,OAAO,EAAE,6EAA6E;KACvF;IACD;QACE,IAAI,EAAE,KAAC,SAAS,IAAC,QAAQ,EAAC,OAAO,GAAG;QACpC,OAAO,EAAE,UAAU;QACnB,eAAe,E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import { ReactNode } from 'react';
|
3
|
-
export interface MenuIconProps extends
|
3
|
+
export interface MenuIconProps extends TypographyProps {
|
4
4
|
icon?: ReactNode;
|
5
5
|
}
|
6
6
|
export declare const MenuIcon: React.FC<MenuIconProps>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"MenuIcon.d.ts","sourceRoot":"","sources":["../../../../src/components/SiteMenu/MenuIcon.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"MenuIcon.d.ts","sourceRoot":"","sources":["../../../../src/components/SiteMenu/MenuIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,eAAe,EAAE,MAAM,eAAe,CAAA;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC,MAAM,WAAW,aAAc,SAAQ,eAAe;IACpD,IAAI,CAAC,EAAE,SAAS,CAAA;CACjB;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAM5C,CAAA"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
2
|
import { Typography } from '@mui/material';
|
3
3
|
export const MenuIcon = ({ icon, ...props }) => {
|
4
|
-
return (_jsx(Typography, { display: "flex",
|
4
|
+
return (_jsx(Typography, { display: "flex", ...props, children: icon }));
|
5
5
|
};
|
6
6
|
//# sourceMappingURL=MenuIcon.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"MenuIcon.js","sourceRoot":"","sources":["../../../../src/components/SiteMenu/MenuIcon.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,
|
1
|
+
{"version":3,"file":"MenuIcon.js","sourceRoot":"","sources":["../../../../src/components/SiteMenu/MenuIcon.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,eAAe,CAAA;AAO3D,MAAM,CAAC,MAAM,QAAQ,GAA4B,CAAC,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IACtE,OAAO,CACL,KAAC,UAAU,IAAC,OAAO,EAAC,MAAM,KAAK,KAAK,YACjC,IAAI,GACM,CACd,CAAA;AACH,CAAC,CAAA"}
|
@@ -11,7 +11,7 @@ export interface SiteMenuListItemProps extends SiteMenuListItemBase, ListItemPro
|
|
11
11
|
onButtonClick?: ListItemButtonExProps['onClick'];
|
12
12
|
subNavListItems?: SubNavListItemProps[];
|
13
13
|
tooltip?: string;
|
14
|
-
|
14
|
+
subNavOpen?: boolean;
|
15
15
|
}
|
16
16
|
export interface SubNavListItemProps {
|
17
17
|
primary: ListItemTextProps['primary'];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"MenuItems.d.ts","sourceRoot":"","sources":["../../../../src/components/SiteMenu/MenuItems.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA8B,aAAa,EAAE,iBAAiB,EAAqB,MAAM,eAAe,CAAA;AAE/G,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAA;AACjE,OAAO,EAAE,SAAS,EAAY,MAAM,OAAO,CAAA;AAE3C,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAA;
|
1
|
+
{"version":3,"file":"MenuItems.d.ts","sourceRoot":"","sources":["../../../../src/components/SiteMenu/MenuItems.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA8B,aAAa,EAAE,iBAAiB,EAAqB,MAAM,eAAe,CAAA;AAE/G,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAA;AACjE,OAAO,EAAE,SAAS,EAAY,MAAM,OAAO,CAAA;AAE3C,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAA;AAGrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAA;AAM5C,MAAM,WAAW,qBAAsB,SAAQ,oBAAoB,EAAE,aAAa;IAChF,OAAO,EAAE,iBAAiB,CAAC,SAAS,CAAC,CAAA;IACrC,EAAE,CAAC,EAAE,EAAE,CAAA;IACP,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,aAAa,CAAC,EAAE,qBAAqB,CAAC,SAAS,CAAC,CAAA;IAChD,eAAe,CAAC,EAAE,mBAAmB,EAAE,CAAA;IACvC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,iBAAiB,CAAC,SAAS,CAAC,CAAA;IACrC,EAAE,CAAC,EAAE,EAAE,CAAA;IACP,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,aAAa,CAAC,EAAE,qBAAqB,CAAC,SAAS,CAAC,CAAA;IAChD,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA8D5D,CAAA"}
|
@@ -1,19 +1,21 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
2
|
import { Collapse, IconButton, List, Tooltip, useTheme } from '@mui/material';
|
3
|
-
import { FlexRow } from '@xylabs/react-flexbox';
|
3
|
+
import { FlexCol, FlexRow } from '@xylabs/react-flexbox';
|
4
4
|
import { useState } from 'react';
|
5
5
|
import { VscChevronDown, VscInfo } from 'react-icons/vsc';
|
6
|
+
import { useCollapsible } from '../../contexts';
|
6
7
|
import { MenuIcon } from './MenuIcon';
|
7
8
|
import { MenuListItem } from './MenuListItem';
|
8
9
|
import { MenuListItemButtonEx } from './MenuListItemButtonEx';
|
9
10
|
import { MenuListItemText } from './MenuListItemText';
|
10
|
-
export const SiteMenuListItem = ({ style, subNavListItems, iconOnly, tooltip,
|
11
|
+
export const SiteMenuListItem = ({ style, subNavListItems, iconOnly, tooltip, collapseEnd, icon, primary, onButtonClick, to, ...props }) => {
|
11
12
|
const { dense } = props;
|
12
13
|
const theme = useTheme();
|
14
|
+
const { collapse } = useCollapsible();
|
13
15
|
const [openSubNav, setOpenSubNav] = useState(false);
|
14
16
|
const [hovered, setHovered] = useState(false);
|
15
|
-
return (_jsxs(MenuListItem, { disableGutters: true, style: { whiteSpace: 'nowrap', ...style }, iconOnly: iconOnly,
|
16
|
-
return _jsx(SiteMenuListItem, { ...item }, index);
|
17
|
+
return (_jsxs(MenuListItem, { disableGutters: true, style: { whiteSpace: 'nowrap', ...style }, iconOnly: iconOnly, ...props, children: [_jsxs(MenuListItemButtonEx, { iconOnly: iconOnly, onClick: onButtonClick, collapseEnd: collapseEnd, dense: dense, to: to, sx: { justifyContent: 'space-between' }, onMouseEnter: () => setHovered(true), onMouseLeave: () => setHovered(false), children: [_jsxs(FlexRow, { children: [_jsx(MenuIcon, { icon: icon, paddingRight: theme.spacing(1), color: hovered ? 'primary' : 'inherit' }), _jsx(MenuListItemText, { primary: primary, iconOnly: iconOnly })] }), _jsxs(FlexRow, { children: [subNavListItems ? (_jsx(IconButton, { onClick: () => setOpenSubNav(!openSubNav), sx: { marginRight: theme.spacing(1) }, children: _jsx(VscChevronDown, { fontSize: "16px" }) })) : null, tooltip ? (_jsx(Tooltip, { title: tooltip, placement: "right", children: _jsx("div", { children: _jsx(FlexCol, { justifyContent: "center", children: _jsx(VscInfo, { color: "grey" }) }) }) })) : null] })] }), subNavListItems ? (_jsx(Collapse, { in: collapse == true ? false : openSubNav, children: _jsx(List, { children: subNavListItems.map((item, index) => {
|
18
|
+
return _jsx(SiteMenuListItem, { sx: { pl: theme.spacing(1) }, ...item }, index);
|
17
19
|
}) }) })) : null] }));
|
18
20
|
};
|
19
21
|
//# sourceMappingURL=MenuItems.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"MenuItems.js","sourceRoot":"","sources":["../../../../src/components/SiteMenu/MenuItems.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAoC,OAAO,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,IAAI,IACA,IACW,EACtB,eAAe,CAAC,CAAC,CAAC,CACjB,KAAC,QAAQ,IAAC,EAAE,EAAE,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,YACjD,KAAC,IAAI,cACF,eAAe,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;wBACnC,OAAO,KAAC,gBAAgB,IAAC,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,KAAkB,IAAI,IAAf,KAAK,CAAc,CAAA;oBACjF,CAAC,CAAC,GACG,GACE,CACZ,CAAC,CAAC,CAAC,IAAI,IACK,CAChB,CAAA;AACH,CAAC,CAAA"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { ListProps } from '@mui/material';
|
3
|
+
import { SiteMenuListItemProps } from './MenuItems';
|
4
|
+
export interface MenuSectionProps extends ListProps {
|
5
|
+
title: string;
|
6
|
+
listItems: SiteMenuListItemProps[];
|
7
|
+
showTitle?: boolean;
|
8
|
+
}
|
9
|
+
export declare const MenuSection: React.FC<MenuSectionProps>;
|
10
|
+
//# sourceMappingURL=MenuSection.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"MenuSection.d.ts","sourceRoot":"","sources":["../../../../src/components/SiteMenu/MenuSection.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAQ,SAAS,EAAiB,MAAM,eAAe,CAAA;AAE9D,OAAO,EAAoB,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAErE,MAAM,WAAW,gBAAiB,SAAQ,SAAS;IACjD,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,qBAAqB,EAAE,CAAA;IAClC,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAWlD,CAAA"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import { List, ListSubheader } from '@mui/material';
|
3
|
+
import { SiteMenuListItem } from './MenuItems';
|
4
|
+
export const MenuSection = ({ title, listItems, showTitle = true, ...props }) => {
|
5
|
+
return (_jsxs(List, { ...props, children: [showTitle ? _jsx(ListSubheader, { children: title }) : null, listItems.map((item, index) => (_jsx(_Fragment, { children: _jsx(SiteMenuListItem, { ...item }, index) })))] }));
|
6
|
+
};
|
7
|
+
//# sourceMappingURL=MenuSection.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"MenuSection.js","sourceRoot":"","sources":["../../../../src/components/SiteMenu/MenuSection.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAa,aAAa,EAAE,MAAM,eAAe,CAAA;AAE9D,OAAO,EAAE,gBAAgB,EAAyB,MAAM,aAAa,CAAA;AAQrE,MAAM,CAAC,MAAM,WAAW,GAA+B,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,GAAG,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAC1G,OAAO,CACL,MAAC,IAAI,OAAK,KAAK,aACZ,SAAS,CAAC,CAAC,CAAC,KAAC,aAAa,cAAE,KAAK,GAAiB,CAAC,CAAC,CAAC,IAAI,EACzD,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAC9B,4BACE,KAAC,gBAAgB,OAAiB,IAAI,IAAf,KAAK,CAA+B,GAC1D,CACJ,CAAC,IACG,CACR,CAAA;AACH,CAAC,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/SiteMenu/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA;AACtB,cAAc,aAAa,CAAA"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/SiteMenu/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA;AACtB,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/SiteMenu/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA;AACtB,cAAc,aAAa,CAAA"}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/SiteMenu/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA;AACtB,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA"}
|
package/package.json
CHANGED
@@ -16,11 +16,11 @@
|
|
16
16
|
"@xylabs/react-flexbox": "^2.14.20",
|
17
17
|
"@xylabs/react-link": "^2.14.20",
|
18
18
|
"@xylabs/react-shared": "^2.14.20",
|
19
|
-
"@xyo-network/react-app-settings": "^2.36.
|
20
|
-
"@xyo-network/react-archive": "^2.36.
|
21
|
-
"@xyo-network/react-auth-sets": "^2.36.
|
22
|
-
"@xyo-network/react-network": "^2.36.
|
23
|
-
"@xyo-network/react-shared": "^2.36.
|
19
|
+
"@xyo-network/react-app-settings": "^2.36.1",
|
20
|
+
"@xyo-network/react-archive": "^2.36.1",
|
21
|
+
"@xyo-network/react-auth-sets": "^2.36.1",
|
22
|
+
"@xyo-network/react-network": "^2.36.1",
|
23
|
+
"@xyo-network/react-shared": "^2.36.1",
|
24
24
|
"tslib": "^2.4.0"
|
25
25
|
},
|
26
26
|
"peerDependencies": {
|
@@ -77,5 +77,5 @@
|
|
77
77
|
},
|
78
78
|
"sideEffects": false,
|
79
79
|
"types": "dist/esm/index.d.ts",
|
80
|
-
"version": "2.36.
|
80
|
+
"version": "2.36.1"
|
81
81
|
}
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import {
|
1
|
+
import { useTheme } from '@mui/material'
|
2
2
|
import { ComponentMeta, ComponentStory, DecoratorFn } from '@storybook/react'
|
3
3
|
import { FlexGrowCol } from '@xylabs/react-flexbox'
|
4
4
|
|
5
5
|
import { CollapsibleProvider, useCollapsible } from '../../contexts'
|
6
|
-
import {
|
6
|
+
import { MenuSection } from '../SiteMenu'
|
7
7
|
import { CollapseToggleFlex } from './CollapseToggle'
|
8
8
|
import { CollapsibleDrawer } from './CollapsibleDrawer'
|
9
9
|
import { menuDataBottom, menuDataTop } from './ExampleMenuData'
|
@@ -29,30 +29,17 @@ const StorybookEntry = {
|
|
29
29
|
} as ComponentMeta<typeof CollapsibleDrawer>
|
30
30
|
|
31
31
|
const Template: ComponentStory<typeof CollapsibleDrawer> = (args) => {
|
32
|
-
const { collapse, setCollapseEnd
|
32
|
+
const { collapse, setCollapseEnd } = useCollapsible()
|
33
33
|
const theme = useTheme()
|
34
34
|
return (
|
35
35
|
<>
|
36
36
|
<FlexGrowCol alignItems="start" height="calc(100vh - 2rem)">
|
37
37
|
<CollapsibleDrawer in={!collapse} orientation="horizontal" collapsedSize={theme.spacing(5)} onExited={() => setCollapseEnd?.(true)} {...args}>
|
38
|
-
<
|
39
|
-
|
40
|
-
{menuDataTop.map((item, index) => (
|
41
|
-
<>
|
42
|
-
<SiteMenuListItem key={index} {...item}></SiteMenuListItem>
|
43
|
-
</>
|
44
|
-
))}
|
45
|
-
{collapseEnd ? null : <ListSubheader>Settings & Analytics</ListSubheader>}
|
46
|
-
{menuDataBottom.map((item, index) => (
|
47
|
-
<>
|
48
|
-
<SiteMenuListItem key={index} {...item}></SiteMenuListItem>
|
49
|
-
</>
|
50
|
-
))}
|
51
|
-
</List>
|
38
|
+
<MenuSection title="Explore & Create" listItems={menuDataTop} showTitle={!collapse} />
|
39
|
+
<MenuSection title="Settings & Analytics" listItems={menuDataBottom} showTitle={!collapse} />
|
52
40
|
<FlexGrowCol />
|
53
41
|
<CollapseToggleFlex justifyContent="start" />
|
54
42
|
</CollapsibleDrawer>
|
55
|
-
<Divider orientation="vertical" flexItem />
|
56
43
|
</FlexGrowCol>
|
57
44
|
</>
|
58
45
|
)
|
@@ -1,7 +1,6 @@
|
|
1
|
-
import KeyboardDoubleArrowLeftRoundedIcon from '@mui/icons-material/KeyboardDoubleArrowLeftRounded'
|
2
|
-
import KeyboardDoubleArrowRightRounded from '@mui/icons-material/KeyboardDoubleArrowRightRounded'
|
3
1
|
import { IconButton } from '@mui/material'
|
4
2
|
import { FlexBoxProps, FlexRow } from '@xylabs/react-flexbox'
|
3
|
+
import { VscArrowSmallLeft, VscArrowSmallRight } from 'react-icons/vsc'
|
5
4
|
|
6
5
|
import { useCollapsible } from '../../contexts'
|
7
6
|
|
@@ -19,10 +18,9 @@ export const CollapseToggleFlex: React.FC<FlexBoxProps> = (props) => {
|
|
19
18
|
onClick={handleCollapseToggle}
|
20
19
|
sx={{
|
21
20
|
flexDirection: 'column',
|
22
|
-
ml: 1,
|
23
21
|
}}
|
24
22
|
>
|
25
|
-
{!collapse ? <
|
23
|
+
{!collapse ? <VscArrowSmallLeft /> : <VscArrowSmallRight />}
|
26
24
|
</IconButton>
|
27
25
|
</FlexRow>
|
28
26
|
)
|
@@ -1,5 +1,7 @@
|
|
1
1
|
import {
|
2
2
|
VscAccount,
|
3
|
+
VscAdd,
|
4
|
+
VscDashboard,
|
3
5
|
VscGlobe,
|
4
6
|
VscGraph,
|
5
7
|
VscGraphLine,
|
@@ -8,39 +10,44 @@ import {
|
|
8
10
|
VscSettingsGear,
|
9
11
|
VscSymbolMethod,
|
10
12
|
VscSymbolNamespace,
|
13
|
+
VscTable,
|
11
14
|
} from 'react-icons/vsc'
|
12
15
|
|
13
16
|
import { SiteMenuListItemProps } from '../SiteMenu'
|
14
17
|
|
15
18
|
export const menuDataTop: SiteMenuListItemProps[] = [
|
16
19
|
{
|
17
|
-
icon: <VscGlobe />,
|
20
|
+
icon: <VscGlobe fontSize="body1" />,
|
18
21
|
primary: 'Explore',
|
19
|
-
subNavListItems: [{ primary: 'Explore', to: '', tooltip: 'View global archivist data on a world map.' }],
|
20
22
|
to: '',
|
21
23
|
tooltip: 'View global archivist data on a world map.',
|
22
24
|
},
|
23
25
|
{
|
24
|
-
icon: <VscSymbolMethod />,
|
26
|
+
icon: <VscSymbolMethod fontSize="body1" />,
|
25
27
|
primary: 'Blocks',
|
26
28
|
to: '',
|
27
29
|
tooltip: 'The most recent blocks seen in the in temp archive on your current network.',
|
28
30
|
},
|
29
31
|
{
|
30
|
-
icon: <VscSymbolNamespace />,
|
32
|
+
icon: <VscSymbolNamespace fontSize="body1" />,
|
31
33
|
primary: 'Payloads',
|
32
34
|
to: '',
|
33
35
|
tooltip: 'The most recent blocks seen in the in temp archive on your current network.',
|
34
36
|
},
|
35
37
|
{
|
36
|
-
icon: <VscGraph />,
|
38
|
+
icon: <VscGraph fontSize="body1" />,
|
37
39
|
primary: 'Queries',
|
38
40
|
to: '',
|
39
41
|
tooltip: 'The most recent blocks seen in the in temp archive on your current network.',
|
40
42
|
},
|
41
43
|
{
|
42
|
-
icon: <VscServer />,
|
44
|
+
icon: <VscServer fontSize="body1" />,
|
43
45
|
primary: 'Archives',
|
46
|
+
subNavListItems: [
|
47
|
+
{ icon: <VscDashboard fontSize="body2" />, primary: 'Dashboard', to: '', tooltip: 'View data for all archives on this network.' },
|
48
|
+
{ icon: <VscAdd fontSize="body2" />, primary: 'Create Archive', to: '', tooltip: 'Create a new archive on this network.' },
|
49
|
+
{ icon: <VscTable fontSize="body2" />, primary: 'Archive Table', to: '', tooltip: 'View all archives on this network as a table.' },
|
50
|
+
],
|
44
51
|
to: '',
|
45
52
|
tooltip: 'The most recent blocks seen in the in temp archive on your current network.',
|
46
53
|
},
|
@@ -48,25 +55,25 @@ export const menuDataTop: SiteMenuListItemProps[] = [
|
|
48
55
|
|
49
56
|
export const menuDataBottom: SiteMenuListItemProps[] = [
|
50
57
|
{
|
51
|
-
icon: <VscGraphLine />,
|
58
|
+
icon: <VscGraphLine fontSize="body1" />,
|
52
59
|
primary: 'Statistics',
|
53
60
|
to: '',
|
54
61
|
tooltip: 'The most recent blocks seen in the in temp archive on your current network.',
|
55
62
|
},
|
56
63
|
{
|
57
|
-
icon: <VscJson />,
|
64
|
+
icon: <VscJson fontSize="body1" />,
|
58
65
|
primary: 'Schema',
|
59
66
|
to: '',
|
60
67
|
tooltip: 'The most recent blocks seen in the in temp archive on your current network.',
|
61
68
|
},
|
62
69
|
{
|
63
|
-
icon: <VscAccount />,
|
70
|
+
icon: <VscAccount fontSize="body1" />,
|
64
71
|
primary: 'Account',
|
65
72
|
to: '',
|
66
73
|
tooltip: 'The most recent blocks seen in the in temp archive on your current network.',
|
67
74
|
},
|
68
75
|
{
|
69
|
-
icon: <VscSettingsGear />,
|
76
|
+
icon: <VscSettingsGear fontSize="body1" />,
|
70
77
|
primary: 'Settings',
|
71
78
|
to: '',
|
72
79
|
tooltip: 'The most recent blocks seen in the in temp archive on your current network.',
|
@@ -1,14 +1,13 @@
|
|
1
|
-
import { Typography } from '@mui/material'
|
2
|
-
import { TypographyExProps } from '@xyo-network/react-shared'
|
1
|
+
import { Typography, TypographyProps } from '@mui/material'
|
3
2
|
import { ReactNode } from 'react'
|
4
3
|
|
5
|
-
export interface MenuIconProps extends
|
4
|
+
export interface MenuIconProps extends TypographyProps {
|
6
5
|
icon?: ReactNode
|
7
6
|
}
|
8
7
|
|
9
8
|
export const MenuIcon: React.FC<MenuIconProps> = ({ icon, ...props }) => {
|
10
9
|
return (
|
11
|
-
<Typography display="flex"
|
10
|
+
<Typography display="flex" {...props}>
|
12
11
|
{icon}
|
13
12
|
</Typography>
|
14
13
|
)
|
@@ -1,10 +1,11 @@
|
|
1
1
|
import { Collapse, IconButton, List, ListItemProps, ListItemTextProps, Tooltip, useTheme } from '@mui/material'
|
2
|
-
import { FlexRow } from '@xylabs/react-flexbox'
|
2
|
+
import { FlexCol, FlexRow } from '@xylabs/react-flexbox'
|
3
3
|
import { ListItemButtonExProps } from '@xyo-network/react-shared'
|
4
4
|
import { ReactNode, useState } from 'react'
|
5
5
|
import { VscChevronDown, VscInfo } from 'react-icons/vsc'
|
6
6
|
import { To } from 'react-router-dom'
|
7
7
|
|
8
|
+
import { useCollapsible } from '../../contexts'
|
8
9
|
import { SiteMenuListItemBase } from './lib'
|
9
10
|
import { MenuIcon } from './MenuIcon'
|
10
11
|
import { MenuListItem } from './MenuListItem'
|
@@ -19,7 +20,7 @@ export interface SiteMenuListItemProps extends SiteMenuListItemBase, ListItemPro
|
|
19
20
|
onButtonClick?: ListItemButtonExProps['onClick']
|
20
21
|
subNavListItems?: SubNavListItemProps[]
|
21
22
|
tooltip?: string
|
22
|
-
|
23
|
+
subNavOpen?: boolean
|
23
24
|
}
|
24
25
|
|
25
26
|
export interface SubNavListItemProps {
|
@@ -36,7 +37,6 @@ export const SiteMenuListItem: React.FC<SiteMenuListItemProps> = ({
|
|
36
37
|
subNavListItems,
|
37
38
|
iconOnly,
|
38
39
|
tooltip,
|
39
|
-
small,
|
40
40
|
collapseEnd,
|
41
41
|
icon,
|
42
42
|
primary,
|
@@ -46,17 +46,11 @@ export const SiteMenuListItem: React.FC<SiteMenuListItemProps> = ({
|
|
46
46
|
}) => {
|
47
47
|
const { dense } = props
|
48
48
|
const theme = useTheme()
|
49
|
+
const { collapse } = useCollapsible()
|
49
50
|
const [openSubNav, setOpenSubNav] = useState(false)
|
50
51
|
const [hovered, setHovered] = useState(false)
|
51
52
|
return (
|
52
|
-
<MenuListItem
|
53
|
-
disableGutters
|
54
|
-
style={{ whiteSpace: 'nowrap', ...style }}
|
55
|
-
iconOnly={iconOnly}
|
56
|
-
onMouseEnter={() => setHovered(true)}
|
57
|
-
onMouseLeave={() => setHovered(false)}
|
58
|
-
{...props}
|
59
|
-
>
|
53
|
+
<MenuListItem disableGutters style={{ whiteSpace: 'nowrap', ...style }} iconOnly={iconOnly} {...props}>
|
60
54
|
<MenuListItemButtonEx
|
61
55
|
iconOnly={iconOnly}
|
62
56
|
onClick={onButtonClick}
|
@@ -64,36 +58,36 @@ export const SiteMenuListItem: React.FC<SiteMenuListItemProps> = ({
|
|
64
58
|
dense={dense}
|
65
59
|
to={to}
|
66
60
|
sx={{ justifyContent: 'space-between' }}
|
61
|
+
onMouseEnter={() => setHovered(true)}
|
62
|
+
onMouseLeave={() => setHovered(false)}
|
67
63
|
>
|
68
64
|
<FlexRow>
|
69
|
-
<MenuIcon
|
70
|
-
|
71
|
-
fontSize={small ? '14px' : '16px'}
|
72
|
-
paddingRight={theme.spacing(1)}
|
73
|
-
color={hovered ? theme.palette.primary.main : 'inherit'}
|
74
|
-
/>
|
75
|
-
<MenuListItemText primary={primary} iconOnly={iconOnly} sx={{ fontSize: small ? theme.typography.caption.fontSize : '' }} />
|
65
|
+
<MenuIcon icon={icon} paddingRight={theme.spacing(1)} color={hovered ? 'primary' : 'inherit'} />
|
66
|
+
<MenuListItemText primary={primary} iconOnly={iconOnly} />
|
76
67
|
</FlexRow>
|
77
68
|
<FlexRow>
|
78
69
|
{subNavListItems ? (
|
79
70
|
<IconButton onClick={() => setOpenSubNav(!openSubNav)} sx={{ marginRight: theme.spacing(1) }}>
|
80
|
-
<VscChevronDown fontSize=
|
71
|
+
<VscChevronDown fontSize="16px" />
|
81
72
|
</IconButton>
|
82
73
|
) : null}
|
83
74
|
{tooltip ? (
|
84
75
|
<Tooltip title={tooltip} placement="right">
|
76
|
+
{/* Needs div so it can work, the hovering doesn't work with a FlexCol */}
|
85
77
|
<div>
|
86
|
-
<
|
78
|
+
<FlexCol justifyContent="center">
|
79
|
+
<VscInfo color="grey" />
|
80
|
+
</FlexCol>
|
87
81
|
</div>
|
88
82
|
</Tooltip>
|
89
83
|
) : null}
|
90
84
|
</FlexRow>
|
91
85
|
</MenuListItemButtonEx>
|
92
|
-
{subNavListItems
|
93
|
-
<Collapse in={openSubNav}>
|
86
|
+
{subNavListItems ? (
|
87
|
+
<Collapse in={collapse == true ? false : openSubNav}>
|
94
88
|
<List>
|
95
89
|
{subNavListItems.map((item, index) => {
|
96
|
-
return <SiteMenuListItem key={index} {...item} />
|
90
|
+
return <SiteMenuListItem sx={{ pl: theme.spacing(1) }} key={index} {...item} />
|
97
91
|
})}
|
98
92
|
</List>
|
99
93
|
</Collapse>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { List, ListProps, ListSubheader } from '@mui/material'
|
2
|
+
|
3
|
+
import { SiteMenuListItem, SiteMenuListItemProps } from './MenuItems'
|
4
|
+
|
5
|
+
export interface MenuSectionProps extends ListProps {
|
6
|
+
title: string
|
7
|
+
listItems: SiteMenuListItemProps[]
|
8
|
+
showTitle?: boolean
|
9
|
+
}
|
10
|
+
|
11
|
+
export const MenuSection: React.FC<MenuSectionProps> = ({ title, listItems, showTitle = true, ...props }) => {
|
12
|
+
return (
|
13
|
+
<List {...props}>
|
14
|
+
{showTitle ? <ListSubheader>{title}</ListSubheader> : null}
|
15
|
+
{listItems.map((item, index) => (
|
16
|
+
<>
|
17
|
+
<SiteMenuListItem key={index} {...item}></SiteMenuListItem>
|
18
|
+
</>
|
19
|
+
))}
|
20
|
+
</List>
|
21
|
+
)
|
22
|
+
}
|