Skip to content

Commit

Permalink
UserMenu: migrate to Layout.isForMobile()
Browse files Browse the repository at this point in the history
  • Loading branch information
rwaldron committed Jul 27, 2020
1 parent e8cf6ed commit f3abcb6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions client/components/User/UserMenu.jsx
Expand Up @@ -7,7 +7,7 @@ import ConfirmableLogout from '@components/Login/ConfirmableLogout';
import Username from '@components/User/Username';
import UserSettings from '@components/User/UserSettings';

const MOBILE_WIDTH = 767;
import Layout from '@utils/Layout';

class UserMenu extends Component {
constructor(props) {
Expand All @@ -32,14 +32,13 @@ class UserMenu extends Component {
const { onSettingsClick, onLogoutClick } = this;
const { openSettings, openLogout } = this.state;
const { user } = this.props;
const IS_ON_MOBILE = window.innerWidth <= MOBILE_WIDTH;

const dropdownProps = {
simple: true,
item: true
};

if (IS_ON_MOBILE) {
if (Layout.isForMobile()) {
dropdownProps.icon = 'user';
} else {
dropdownProps.trigger = <Username {...user} />;
Expand Down

0 comments on commit f3abcb6

Please sign in to comment.