Unverified Commit bf75c147 authored by Lyza Gardner's avatar Lyza Gardner Committed by GitHub

Merge pull request #2072 from hypothesis/fix-nested-buttons

Do not use `button` element in `Menu` label
parents 9495bba6 481fe703
...@@ -2,9 +2,9 @@ import { createElement } from 'preact'; ...@@ -2,9 +2,9 @@ import { createElement } from 'preact';
import useStore from '../store/use-store'; import useStore from '../store/use-store';
import Button from './button';
import Menu from './menu'; import Menu from './menu';
import MenuItem from './menu-item'; import MenuItem from './menu-item';
import SvgIcon from '../../shared/components/svg-icon';
/** /**
* A drop-down menu of sorting options for a collection of annotations. * A drop-down menu of sorting options for a collection of annotations.
...@@ -35,12 +35,9 @@ export default function SortMenu() { ...@@ -35,12 +35,9 @@ export default function SortMenu() {
}); });
const menuLabel = ( const menuLabel = (
<Button <span className="top-bar__menu-label">
className="top-bar__icon-button" <SvgIcon name="sort" className="top-bar__menu-icon" />
icon="sort" </span>
title="Sort annotations"
useCompactStyle
/>
); );
return ( return (
......
...@@ -6,10 +6,10 @@ import serviceConfig from '../service-config'; ...@@ -6,10 +6,10 @@ import serviceConfig from '../service-config';
import { isThirdPartyUser } from '../util/account-id'; import { isThirdPartyUser } from '../util/account-id';
import { withServices } from '../util/service-context'; import { withServices } from '../util/service-context';
import Button from './button';
import Menu from './menu'; import Menu from './menu';
import MenuItem from './menu-item'; import MenuItem from './menu-item';
import MenuSection from './menu-section'; import MenuSection from './menu-section';
import SvgIcon from '../../shared/components/svg-icon';
/** /**
* A menu with user and account links. * A menu with user and account links.
...@@ -44,12 +44,9 @@ function UserMenu({ auth, bridge, onLogout, serviceUrl, settings }) { ...@@ -44,12 +44,9 @@ function UserMenu({ auth, bridge, onLogout, serviceUrl, settings }) {
})(); })();
const menuLabel = ( const menuLabel = (
<Button <span className="top-bar__menu-label">
className="top-bar__icon-button" <SvgIcon name="profile" className="top-bar__menu-icon" />
icon="profile" </span>
title="User menu"
useCompactStyle
/>
); );
return ( return (
<div className="user-menu"> <div className="user-menu">
......
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
// the window is scrolled. // the window is scrolled.
transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0);
&__icon-button { &__icon-button,
&__menu-icon {
&.is-active { &.is-active {
color: var.$grey-6; color: var.$grey-6;
...@@ -34,6 +35,10 @@ ...@@ -34,6 +35,10 @@
color: var.$brand; color: var.$brand;
} }
} }
&__menu-label {
padding: 0.25em;
}
} }
.top-bar--theme-clean { .top-bar--theme-clean {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment