feat(frontend): side nav item with external link icon
This commit is contained in:
parent
aea0b573fa
commit
946644675a
|
|
@ -5,6 +5,7 @@ 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';
|
||||||
|
import ArrowTopRightOnSquareIcon from '@heroicons/react/24/solid/ArrowTopRightOnSquareIcon';
|
||||||
|
|
||||||
export const SideNavItem = (props) => {
|
export const SideNavItem = (props) => {
|
||||||
const { active = false, disabled, external, icon, path, title, children, padleft, tooltip } = props;
|
const { active = false, disabled, external, icon, path, title, children, padleft, tooltip } = props;
|
||||||
|
|
@ -112,7 +113,13 @@ export const SideNavItem = (props) => {
|
||||||
}}
|
}}
|
||||||
{...linkProps}
|
{...linkProps}
|
||||||
>
|
>
|
||||||
{title}
|
{title} {
|
||||||
|
external && (
|
||||||
|
<SvgIcon fontSize='8px' sx={{ml: 1}}>
|
||||||
|
<ArrowTopRightOnSquareIcon />
|
||||||
|
</SvgIcon>
|
||||||
|
)
|
||||||
|
}
|
||||||
</Box>
|
</Box>
|
||||||
{ children &&
|
{ children &&
|
||||||
<Box
|
<Box
|
||||||
|
|
@ -158,7 +165,7 @@ export const SideNavItem = (props) => {
|
||||||
<SideNavItem
|
<SideNavItem
|
||||||
active={isItemActive(pathname, child.path)}
|
active={isItemActive(pathname, child.path)}
|
||||||
disabled={child.disabled}
|
disabled={child.disabled}
|
||||||
external={false}
|
external={child.external ? true : false}
|
||||||
icon={child.icon}
|
icon={child.icon}
|
||||||
key={child.title}
|
key={child.title}
|
||||||
path={child.path}
|
path={child.path}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user