From 1f61447b4ba937840644421ffa0b309e38faedfe Mon Sep 17 00:00:00 2001 From: Chris Weaver <25087905+Weves@users.noreply.github.com> Date: Thu, 26 Sep 2024 13:01:35 -0700 Subject: [PATCH] Add open in new tab for custom links (#2568) --- web/src/components/UserDropdown.tsx | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/web/src/components/UserDropdown.tsx b/web/src/components/UserDropdown.tsx index cf12b72d82c..8a8db182299 100644 --- a/web/src/components/UserDropdown.tsx +++ b/web/src/components/UserDropdown.tsx @@ -23,6 +23,7 @@ interface DropdownOptionProps { onClick?: () => void; icon: React.ReactNode; label: string; + openInNewTab?: boolean; } const DropdownOption: React.FC = ({ @@ -30,6 +31,7 @@ const DropdownOption: React.FC = ({ onClick, icon, label, + openInNewTab, }) => { const content = (
@@ -38,11 +40,19 @@ const DropdownOption: React.FC = ({
); - return href ? ( - {content} - ) : ( -
{content}
- ); + if (href) { + return ( + + {content} + + ); + } else { + return
{content}
; + } }; export function UserDropdown({ @@ -173,6 +183,7 @@ export function UserDropdown({ ) } label={item.title} + openInNewTab /> ))}