diff --git a/packages/desktop-client/src/components/HelpMenu.tsx b/packages/desktop-client/src/components/HelpMenu.tsx index a447c643869..73aed99ef4c 100644 --- a/packages/desktop-client/src/components/HelpMenu.tsx +++ b/packages/desktop-client/src/components/HelpMenu.tsx @@ -9,12 +9,12 @@ import { useToggle } from 'usehooks-ts'; import { pushModal } from 'loot-core/client/actions/modals'; import { SvgHelp } from '../icons/v2/Help'; +import { openUrl } from '../util/router-tools'; import { Button } from './common/Button2'; import { Menu } from './common/Menu'; import { Popover } from './common/Popover'; import { SpaceBetween } from './common/SpaceBetween'; -import { View } from './common/View'; type HelpMenuItem = 'docs' | 'keyboard-shortcuts'; @@ -24,24 +24,21 @@ type HelpButtonProps = { const HelpButton = forwardRef( ({ onPress }, ref) => { - const { t } = useTranslation(); const size = 15; return ( - - - + ); }, ); @@ -79,7 +76,7 @@ export const HelpMenu = () => { const handleItemSelect = (item: HelpMenuItem) => { switch (item) { case 'docs': - window.open(getPageDocs(page), '_blank'); + openUrl(getPageDocs(page)); break; case 'keyboard-shortcuts': dispatch(pushModal('keyboard-shortcuts')); diff --git a/packages/desktop-client/src/util/router-tools.ts b/packages/desktop-client/src/util/router-tools.ts index 1bba51ee678..b47386270e9 100644 --- a/packages/desktop-client/src/util/router-tools.ts +++ b/packages/desktop-client/src/util/router-tools.ts @@ -9,3 +9,7 @@ export function ExposeNavigate() { }, [navigate]); return null; } + +export function openUrl(url: string) { + window.open(url, '_blank', 'noopener,noreferrer'); +}