mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-10 23:45:48 +01:00
🚸 Open external links in manage nav in new tab
This commit is contained in:
@@ -122,6 +122,7 @@ type Icon = (props: TablerIconsProps) => JSX.Element;
|
|||||||
type NavigationLinkHref = {
|
type NavigationLinkHref = {
|
||||||
icon: Icon;
|
icon: Icon;
|
||||||
href: string;
|
href: string;
|
||||||
|
target?: '_self' | '_blank';
|
||||||
onlyAdmin?: boolean;
|
onlyAdmin?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -182,7 +183,7 @@ const CustomNavigationLink = forwardRef<
|
|||||||
const matchesActive = router.pathname.endsWith(item.href);
|
const matchesActive = router.pathname.endsWith(item.href);
|
||||||
|
|
||||||
if (item.href.startsWith('http')) {
|
if (item.href.startsWith('http')) {
|
||||||
return <NavLink {...commonItemProps} active={matchesActive} component="a" />;
|
return <NavLink {...commonItemProps} active={matchesActive} target={item.target} component="a" />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return <NavLink {...commonItemProps} active={matchesActive} component={Link} />;
|
return <NavLink {...commonItemProps} active={matchesActive} component={Link} />;
|
||||||
@@ -228,18 +229,22 @@ const navigationLinks: NavigationLinks = {
|
|||||||
documentation: {
|
documentation: {
|
||||||
icon: IconBook2,
|
icon: IconBook2,
|
||||||
href: 'https://homarr.dev/docs/about',
|
href: 'https://homarr.dev/docs/about',
|
||||||
|
target: '_blank'
|
||||||
},
|
},
|
||||||
report: {
|
report: {
|
||||||
icon: IconBrandGithub,
|
icon: IconBrandGithub,
|
||||||
href: 'https://github.com/ajnart/homarr/issues/new/choose',
|
href: 'https://github.com/ajnart/homarr/issues/new/choose',
|
||||||
|
target: '_blank'
|
||||||
},
|
},
|
||||||
discord: {
|
discord: {
|
||||||
icon: IconBrandDiscord,
|
icon: IconBrandDiscord,
|
||||||
href: 'https://discord.com/invite/aCsmEV5RgA',
|
href: 'https://discord.com/invite/aCsmEV5RgA',
|
||||||
|
target: '_blank'
|
||||||
},
|
},
|
||||||
contribute: {
|
contribute: {
|
||||||
icon: IconGitFork,
|
icon: IconGitFork,
|
||||||
href: 'https://github.com/ajnart/homarr',
|
href: 'https://github.com/ajnart/homarr',
|
||||||
|
target: '_blank'
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user