Add link to download app (macOS)

This commit is contained in:
Tom Moor
2022-12-04 18:03:35 -05:00
parent 3d6da26ad6
commit 481382ee9f
3 changed files with 22 additions and 0 deletions

View File

@@ -11,6 +11,7 @@ import {
EmailIcon, EmailIcon,
LogoutIcon, LogoutIcon,
ProfileIcon, ProfileIcon,
BrowserIcon,
} from "outline-icons"; } from "outline-icons";
import * as React from "react"; import * as React from "react";
import { import {
@@ -24,7 +25,10 @@ import SearchQuery from "~/models/SearchQuery";
import KeyboardShortcuts from "~/scenes/KeyboardShortcuts"; import KeyboardShortcuts from "~/scenes/KeyboardShortcuts";
import { createAction } from "~/actions"; import { createAction } from "~/actions";
import { NavigationSection, RecentSearchesSection } from "~/actions/sections"; import { NavigationSection, RecentSearchesSection } from "~/actions/sections";
import Desktop from "~/utils/Desktop";
import { isMac } from "~/utils/browser";
import history from "~/utils/history"; import history from "~/utils/history";
import isCloudHosted from "~/utils/isCloudHosted";
import { import {
organizationSettingsPath, organizationSettingsPath,
profileSettingsPath, 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: <BrowserIcon />,
visible: () => !Desktop.isElectron() && isMac() && isCloudHosted,
perform: () => {
window.open("https://desktop.getoutline.com");
},
});
export const logout = createAction({ export const logout = createAction({
name: ({ t }) => t("Log out"), name: ({ t }) => t("Log out"),
section: NavigationSection, section: NavigationSection,
@@ -170,6 +188,7 @@ export const rootNavigationActions = [
navigateToTemplates, navigateToTemplates,
navigateToArchive, navigateToArchive,
navigateToTrash, navigateToTrash,
downloadApp,
openAPIDocumentation, openAPIDocumentation,
openFeedbackUrl, openFeedbackUrl,
openBugReportUrl, openBugReportUrl,

View File

@@ -13,6 +13,7 @@ import {
openBugReportUrl, openBugReportUrl,
openFeedbackUrl, openFeedbackUrl,
logout, logout,
downloadApp,
} from "~/actions/definitions/navigation"; } from "~/actions/definitions/navigation";
import { changeTheme } from "~/actions/definitions/settings"; import { changeTheme } from "~/actions/definitions/settings";
import usePrevious from "~/hooks/usePrevious"; import usePrevious from "~/hooks/usePrevious";
@@ -38,6 +39,7 @@ const AccountMenu: React.FC = ({ children }) => {
const actions = React.useMemo(() => { const actions = React.useMemo(() => {
return [ return [
openKeyboardShortcuts, openKeyboardShortcuts,
downloadApp,
openAPIDocumentation, openAPIDocumentation,
separator(), separator(),
openChangelog, openChangelog,

View File

@@ -58,6 +58,7 @@
"Report a bug": "Report a bug", "Report a bug": "Report a bug",
"Changelog": "Changelog", "Changelog": "Changelog",
"Keyboard shortcuts": "Keyboard shortcuts", "Keyboard shortcuts": "Keyboard shortcuts",
"Download {{ platform }} app": "Download {{ platform }} app",
"Log out": "Log out", "Log out": "Log out",
"Restore revision": "Restore revision", "Restore revision": "Restore revision",
"Document restored": "Document restored", "Document restored": "Document restored",