mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-23 20:23:08 +00:00
[Beta] Open external link in new tab
This commit is contained in:
@@ -47,11 +47,16 @@ export function SidebarLink({
|
||||
}
|
||||
}, [ref, selected]);
|
||||
|
||||
let target = '';
|
||||
if (href.startsWith('https://')) {
|
||||
target = '_blank';
|
||||
}
|
||||
return (
|
||||
<Link href={href}>
|
||||
<a
|
||||
ref={ref}
|
||||
title={title}
|
||||
target={target}
|
||||
aria-current={selected ? 'page' : undefined}
|
||||
className={cn(
|
||||
'p-2 pr-2 w-full rounded-none lg:rounded-r-lg text-left hover:bg-gray-5 dark:hover:bg-gray-80 relative flex items-center justify-between',
|
||||
|
||||
@@ -11,10 +11,6 @@
|
||||
"title": "Overview",
|
||||
"path": "/"
|
||||
},
|
||||
{
|
||||
"title": "Blog",
|
||||
"path": "https://reactjs.org/blog"
|
||||
},
|
||||
{
|
||||
"title": "Community",
|
||||
"path": "/community",
|
||||
@@ -25,6 +21,10 @@
|
||||
"title": "Meet the Team",
|
||||
"path": "/community/meet-the-team"
|
||||
}]
|
||||
},
|
||||
{
|
||||
"title": "Blog",
|
||||
"path": "https://reactjs.org/blog"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user