import React from 'react'
import PropTypes from 'prop-types'
import {NavigationView, SplitViewCommand} from 'react-uwp'

export default class Navigator extends React.Component {
  static contextTypes = {
    router: PropTypes.object
  }
  constructor () {
    super()
    this.go = this.go.bind(this)
  }
  go (path) {
    const {route} = this.context.router
    const {push} = this.context.router.history
    return function () {
      path !== route.location.pathname && push(path)
    }
  }
  render () {
    const {props, go} = this
    const navigationTopNodes = [
      // <SplitViewCommand label="本周周报" onClick={go('/')} icon={"Home"} />,
      <SplitViewCommand label='周报列表' onClick={go('/list')} icon={'CalendarWeek'} />,
      <SplitViewCommand label='编辑周报' onClick={go('/edit')} icon={'Edit'} />
    ]
    const navigationBottomNode = [
      <SplitViewCommand label='设置' onClick={go('/settings')} icon={'Settings'} />,
      <SplitViewCommand label='帮助' visited onClick={go('/help')} icon={'Help'} />
    ]
    return <NavigationView className='full-size'
      pageTitle='WEEPORT'
      displayMode='overlay'
      autoResize={false}
      initWidth={0}
      navigationTopNodes={navigationTopNodes}
      navigationBottomNodes={navigationBottomNode}
    >
      <div className='content-container'>
        {props.children}
      </div>
    </NavigationView>
  }
}

@@ -673,14 +673,16 @@
 bel=
-'%E5%91%A8%E6%8A%A5%E5%88%97%E8%A1%A8'
+%7B'%E6%B5%8F%E8%A7%88%E5%91%A8%E6%8A%A5'%7D
  onC
@@ -760,14 +760,16 @@
 bel=
+%7B
 '%E7%BC%96%E8%BE%91%E5%91%A8%E6%8A%A5'
+%7D
  onC
@@ -879,12 +879,14 @@
 bel=
+%7B
 '%E8%AE%BE%E7%BD%AE'
+%7D
  onC
@@ -964,12 +964,14 @@
 bel=
+%7B
 '%E5%B8%AE%E5%8A%A9'
+%7D
  vis

Change nav name