Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Commit

Permalink
fix(header): remove isMobile prop handling
Browse files Browse the repository at this point in the history
fix(header): remove `isMobile` prop handling, because header is already
responsive
  • Loading branch information
Metnew committed Feb 19, 2018
1 parent 3d037a0 commit b0fd734
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions src/common/components/Header/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,21 @@ import _ from 'lodash'
import {TOGGLE_SIDEBAR} from 'actions/layout'
import {StyledHeader} from './style'
import {getMetaRoutes} from 'routing'
import {getLayoutMobileStatuses} from 'selectors'
import Headroom from 'react-headroom'

type Props = {
title: string,
toggleSidebar: () => void,
isMobile: boolean
toggleSidebar: () => void
}

const Header = ({title, toggleSidebar, isMobile}: Props) => {
const Header = ({title, toggleSidebar}: Props) => {
return (
<Headroom>
<StyledHeader>
<div className="header-inner">
{isMobile && (
<span className="navicon" role="button" onClick={toggleSidebar}>
<Icon name="content" />
</span>
)}
<span className="navicon" role="button" onClick={toggleSidebar}>
<Icon name="content" />
</span>
<span className="page-title">{title}</span>
</div>
</StyledHeader>
Expand All @@ -38,11 +34,9 @@ const Header = ({title, toggleSidebar, isMobile}: Props) => {
const mapStateToProps = (state, props) => {
const {location: {pathname}} = props
const {name: title} =
_.find(getMetaRoutes(), a => matchPath(pathname, a)) || {}
const {isMobile} = getLayoutMobileStatuses(state)
_.find(getMetaRoutes(), a => matchPath(pathname, a))
return {
title,
isMobile
title
}
}

Expand Down

0 comments on commit b0fd734

Please sign in to comment.