Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-1607/Remove feature listing #452

Merged
merged 6 commits into from Sep 25, 2019

Refactored menu items to a constant

  • Loading branch information
benstrumeyer committed Sep 18, 2019
commit 62b92e32f8e563de0739aee88e21a1849de0a223
@@ -47,19 +47,14 @@ class SideNavigationViewContainer extends Component {
const { user, location } = this.props;
const disableRegEx = /^(\/setup(?!\/4$))|(\/tutorial(?!\/6$))/;

let menuItems = [
const menuItems = [
{ href: '/', icon: 'home', text: t('hub_side_navigation_home') },
{ href: '/setup', icon: 'setup', text: t('hub_side_navigation_setup') },
{ href: '/tutorial', icon: 'tutorial', text: t('hub_side_navigation_tutorial') },
{ href: '/plus', icon: 'plus', text: t('hub_side_navigation_supporter') },
{ href: '/rewards', icon: 'rewards', text: t('hub_side_navigation_rewards') },
{ href: '/products', icon: 'products', text: t('hub_side_navigation_products') }
...(IS_CLIQZ ? [] : [{ href: '/rewards', icon: 'rewards', text: t('hub_side_navigation_rewards') }]),
...[{ href: '/products', icon: 'products', text: t('hub_side_navigation_products') }]
This conversation was marked as resolved by benstrumeyer

This comment has been minimized.

@wlycdgr

wlycdgr Sep 20, 2019
Member

you can simplify the last entry to
{ href: '/products', icon: 'products', text: t('hub_side_navigation_products')}
(i.e. you don't need the array destructuring syntax for this element)

This comment has been minimized.

@wlycdgr

wlycdgr Sep 20, 2019
Member

(@fcjr fyi - didn't notice this when you were asking me about it the other day)

This comment has been minimized.

@benstrumeyer

benstrumeyer Sep 20, 2019
Author Contributor

Great catch. I changed it.

];

if (IS_CLIQZ) {
menuItems = menuItems.filter(item => item.href !== '/rewards');
}

const bottomItems = user ? [
{ id: 'email', href: `https://account.${globals.GHOSTERY_DOMAIN}.com/`, text: user.email },
{ id: 'logout', text: t('hub_side_navigation_log_out'), clickHandler: this._handleLogoutClick },
ProTip! Use n and p to navigate between commits in a pull request.