diff --git a/app/actions/definitions/navigation.tsx b/app/actions/definitions/navigation.tsx index 8a26452ff..a14ad3240 100644 --- a/app/actions/definitions/navigation.tsx +++ b/app/actions/definitions/navigation.tsx @@ -11,6 +11,7 @@ import { EmailIcon, LogoutIcon, ProfileIcon, + BrowserIcon, } from "outline-icons"; import * as React from "react"; import { @@ -24,7 +25,10 @@ import SearchQuery from "~/models/SearchQuery"; import KeyboardShortcuts from "~/scenes/KeyboardShortcuts"; import { createAction } from "~/actions"; import { NavigationSection, RecentSearchesSection } from "~/actions/sections"; +import Desktop from "~/utils/Desktop"; +import { isMac } from "~/utils/browser"; import history from "~/utils/history"; +import isCloudHosted from "~/utils/isCloudHosted"; import { organizationSettingsPath, profileSettingsPath, @@ -157,6 +161,20 @@ export const openKeyboardShortcuts = createAction({ }, }); +export const downloadApp = createAction({ + name: ({ t }) => + t("Download {{ platform }} app", { + platform: isMac() ? "macOS" : "Windows", + }), + section: NavigationSection, + iconInContextMenu: false, + icon: , + visible: () => !Desktop.isElectron() && isMac() && isCloudHosted, + perform: () => { + window.open("https://desktop.getoutline.com"); + }, +}); + export const logout = createAction({ name: ({ t }) => t("Log out"), section: NavigationSection, @@ -170,6 +188,7 @@ export const rootNavigationActions = [ navigateToTemplates, navigateToArchive, navigateToTrash, + downloadApp, openAPIDocumentation, openFeedbackUrl, openBugReportUrl, diff --git a/app/menus/AccountMenu.tsx b/app/menus/AccountMenu.tsx index b275f168b..88970b297 100644 --- a/app/menus/AccountMenu.tsx +++ b/app/menus/AccountMenu.tsx @@ -13,6 +13,7 @@ import { openBugReportUrl, openFeedbackUrl, logout, + downloadApp, } from "~/actions/definitions/navigation"; import { changeTheme } from "~/actions/definitions/settings"; import usePrevious from "~/hooks/usePrevious"; @@ -38,6 +39,7 @@ const AccountMenu: React.FC = ({ children }) => { const actions = React.useMemo(() => { return [ openKeyboardShortcuts, + downloadApp, openAPIDocumentation, separator(), openChangelog, diff --git a/shared/i18n/locales/en_US/translation.json b/shared/i18n/locales/en_US/translation.json index 2f314053f..fa3fea8e5 100644 --- a/shared/i18n/locales/en_US/translation.json +++ b/shared/i18n/locales/en_US/translation.json @@ -58,6 +58,7 @@ "Report a bug": "Report a bug", "Changelog": "Changelog", "Keyboard shortcuts": "Keyboard shortcuts", + "Download {{ platform }} app": "Download {{ platform }} app", "Log out": "Log out", "Restore revision": "Restore revision", "Document restored": "Document restored",