2017-11-23 12:41:59 +00:00
|
|
|
import React from 'react'
|
|
|
|
import Link from 'next/link'
|
|
|
|
import { inject, observer } from 'mobx-react'
|
|
|
|
import Clock from './Clock'
|
|
|
|
|
|
|
|
@inject('store') @observer
|
|
|
|
class Page extends React.Component {
|
2017-12-04 23:19:53 +00:00
|
|
|
componentDidMount () {
|
2017-11-23 12:41:59 +00:00
|
|
|
this.props.store.start()
|
|
|
|
}
|
|
|
|
|
2017-12-04 23:19:53 +00:00
|
|
|
componentWillUnmount () {
|
2017-11-23 12:41:59 +00:00
|
|
|
this.props.store.stop()
|
|
|
|
}
|
|
|
|
|
2017-12-04 23:19:53 +00:00
|
|
|
render () {
|
2017-11-23 12:41:59 +00:00
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<h1>{this.props.title}</h1>
|
|
|
|
<Clock lastUpdate={this.props.store.lastUpdate} light={this.props.store.light} />
|
|
|
|
<nav>
|
|
|
|
<Link href={this.props.linkTo}><a>Navigate</a></Link>
|
|
|
|
</nav>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Page
|