From 2e37bb2c2256f8726e1f291399903b98e348bab0 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 24 Feb 2018 21:21:05 -0800 Subject: [PATCH] menu-improves --- .../DropdownMenu/DropdownMenuItem.js | 24 +++++++-------- app/menus/AccountMenu.js | 29 +++++++++++-------- shared/utils/routeHelpers.js | 8 +++++ 3 files changed, 36 insertions(+), 25 deletions(-) diff --git a/app/components/DropdownMenu/DropdownMenuItem.js b/app/components/DropdownMenu/DropdownMenuItem.js index 8b8c20548..ca48984bf 100644 --- a/app/components/DropdownMenu/DropdownMenuItem.js +++ b/app/components/DropdownMenu/DropdownMenuItem.js @@ -1,20 +1,23 @@ // @flow import React from 'react'; import styled from 'styled-components'; -import Flex from 'shared/components/Flex'; import { color } from 'shared/styles/constants'; -const DropdownMenuItem = ({ - onClick, - children, -}: { +type Props = { onClick?: SyntheticEvent => void, children?: React.Element, -}) => { - return {children}; }; -const MenuItem = styled(Flex)` +const DropdownMenuItem = ({ onClick, children, ...rest }: Props) => { + return ( + + {children} + + ); +}; + +const MenuItem = styled.a` + display: flex; margin: 0; padding: 5px 10px; height: 32px; @@ -29,11 +32,6 @@ const MenuItem = styled(Flex)` margin-right: 8px; } - a { - text-decoration: none; - width: 100%; - } - &:hover { color: ${color.white}; background: ${color.primary}; diff --git a/app/menus/AccountMenu.js b/app/menus/AccountMenu.js index c317db1b7..01aab33c6 100644 --- a/app/menus/AccountMenu.js +++ b/app/menus/AccountMenu.js @@ -5,7 +5,12 @@ import { inject, observer } from 'mobx-react'; import UiStore from 'stores/UiStore'; import AuthStore from 'stores/AuthStore'; import { DropdownMenu, DropdownMenuItem } from 'components/DropdownMenu'; -import { spectrumUrl } from '../../shared/utils/routeHelpers'; +import { + developers, + githubIssuesUrl, + mailToUrl, + spectrumUrl, +} from '../../shared/utils/routeHelpers'; @observer class AccountMenu extends Component { @@ -24,18 +29,10 @@ class AccountMenu extends Component { this.props.history.push('/settings'); }; - handleApi = () => { - window.location.href = '/developers'; - }; - handleLogout = () => { this.props.auth.logout(); }; - handleFeedback = () => { - window.location.href = spectrumUrl(); - }; - render() { return ( Keyboard shortcuts - + API documentation - - Feedback +
+ + Community + + Send us feedback + + + Report a bug + +
Logout
); diff --git a/shared/utils/routeHelpers.js b/shared/utils/routeHelpers.js index e593f94c5..826a83278 100644 --- a/shared/utils/routeHelpers.js +++ b/shared/utils/routeHelpers.js @@ -29,6 +29,10 @@ export function githubUrl(): string { return 'https://www.github.com/outline'; } +export function githubIssuesUrl(): string { + return 'https://www.github.com/outline/outline/issues'; +} + export function blogUrl(): string { return 'https://medium.com/getoutline'; } @@ -41,6 +45,10 @@ export function spectrumUrl(): string { return 'https://spectrum.chat/outline'; } +export function mailToUrl(): string { + return 'mailto:hello@getoutline.com'; +} + export function developers(): string { return '/developers'; }