feat(frontend): side nav business plan warn
This commit is contained in:
parent
dbbaf4fe50
commit
4d6493f8c5
|
|
@ -7,6 +7,7 @@ import ArrowDownOnSquareStackIcon from '@heroicons/react/24/solid/ArrowDownOnSqu
|
||||||
import UserGroupIcon from '@heroicons/react/24/solid/UserGroupIcon'
|
import UserGroupIcon from '@heroicons/react/24/solid/UserGroupIcon'
|
||||||
import KeyIcon from '@heroicons/react/24/solid/KeyIcon'
|
import KeyIcon from '@heroicons/react/24/solid/KeyIcon'
|
||||||
import CpuChip from '@heroicons/react/24/solid/CpuChipIcon';
|
import CpuChip from '@heroicons/react/24/solid/CpuChipIcon';
|
||||||
|
import BriefCaseIcon from '@heroicons/react/24/outline/BriefcaseIcon';
|
||||||
import { SvgIcon } from '@mui/material';
|
import { SvgIcon } from '@mui/material';
|
||||||
|
|
||||||
export const items = [
|
export const items = [
|
||||||
|
|
@ -35,10 +36,12 @@ export const items = [
|
||||||
<RectangleGroupIcon color='gray'/>
|
<RectangleGroupIcon color='gray'/>
|
||||||
</SvgIcon>
|
</SvgIcon>
|
||||||
),
|
),
|
||||||
|
tooltip: 'Upgrade to Business Plan',
|
||||||
disabled: true,
|
disabled: true,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
title: 'Firmware Update',
|
title: 'Firmware Update',
|
||||||
|
tooltip: 'Upgrade to Business Plan',
|
||||||
icon: (
|
icon: (
|
||||||
<SvgIcon fontSize="small">
|
<SvgIcon fontSize="small">
|
||||||
<ArrowDownOnSquareStackIcon color='gray'/>
|
<ArrowDownOnSquareStackIcon color='gray'/>
|
||||||
|
|
@ -50,6 +53,7 @@ export const items = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Map',
|
title: 'Map',
|
||||||
|
tooltip: 'Upgrade to Business Plan',
|
||||||
icon: (
|
icon: (
|
||||||
<SvgIcon fontSize="small">
|
<SvgIcon fontSize="small">
|
||||||
<MapIcon color='gray'/>
|
<MapIcon color='gray'/>
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import NextLink from 'next/link';
|
import NextLink from 'next/link';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { Box, ButtonBase, Collapse, SvgIcon } from '@mui/material';
|
import { Box, ButtonBase, Collapse, SvgIcon, Tooltip } from '@mui/material';
|
||||||
import ChevronDownIcon from '@heroicons/react/24/outline/ChevronDownIcon';
|
import ChevronDownIcon from '@heroicons/react/24/outline/ChevronDownIcon';
|
||||||
import ChevronUpIcon from '@heroicons/react/24/outline/ChevronUpIcon';
|
import ChevronUpIcon from '@heroicons/react/24/outline/ChevronUpIcon';
|
||||||
import { usePathname } from 'next/navigation';
|
import { usePathname } from 'next/navigation';
|
||||||
|
|
||||||
export const SideNavItem = (props) => {
|
export const SideNavItem = (props) => {
|
||||||
const { active = false, disabled, external, icon, path, title, children, padleft } = props;
|
const { active = false, disabled, external, icon, path, title, children, padleft, tooltip } = props;
|
||||||
|
|
||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
const pathname = usePathname();
|
const pathname = usePathname();
|
||||||
|
|
@ -43,6 +43,7 @@ export const SideNavItem = (props) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<li>
|
<li>
|
||||||
|
<Tooltip title={tooltip} placement='bottom-end'>
|
||||||
<ButtonBase
|
<ButtonBase
|
||||||
sx={{
|
sx={{
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
|
|
@ -63,6 +64,7 @@ export const SideNavItem = (props) => {
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
||||||
{icon && (
|
{icon && (
|
||||||
<Box
|
<Box
|
||||||
component="span"
|
component="span"
|
||||||
|
|
@ -137,6 +139,7 @@ export const SideNavItem = (props) => {
|
||||||
</Box>
|
</Box>
|
||||||
}
|
}
|
||||||
</ButtonBase>
|
</ButtonBase>
|
||||||
|
</Tooltip>
|
||||||
<Collapse in={open}>
|
<Collapse in={open}>
|
||||||
{
|
{
|
||||||
children &&
|
children &&
|
||||||
|
|
@ -153,6 +156,7 @@ export const SideNavItem = (props) => {
|
||||||
title={child.title}
|
title={child.title}
|
||||||
children={child?.children}
|
children={child?.children}
|
||||||
padleft={padleft + 2}
|
padleft={padleft + 2}
|
||||||
|
tooltip={child.tooltip}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -133,6 +133,7 @@ export const SideNav = (props) => {
|
||||||
title={item.title}
|
title={item.title}
|
||||||
children={item?.children}
|
children={item?.children}
|
||||||
padleft={2}
|
padleft={2}
|
||||||
|
tooltip={item.tooltip}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user