From 5f349ddda7af4a5df9606afb749a41cd49fcd413 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Wed, 7 Sep 2022 21:42:05 +0100 Subject: [PATCH] [Beta] Open external link in new tab --- beta/src/components/Layout/Sidebar/SidebarLink.tsx | 5 +++++ beta/src/sidebarHome.json | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/beta/src/components/Layout/Sidebar/SidebarLink.tsx b/beta/src/components/Layout/Sidebar/SidebarLink.tsx index 5c83407f..3ee35fa1 100644 --- a/beta/src/components/Layout/Sidebar/SidebarLink.tsx +++ b/beta/src/components/Layout/Sidebar/SidebarLink.tsx @@ -47,11 +47,16 @@ export function SidebarLink({ } }, [ref, selected]); + let target = ''; + if (href.startsWith('https://')) { + target = '_blank'; + } return (