2017-01-06 11:38:51 +00:00
|
|
|
import React from 'react'
|
|
|
|
import Link from 'next/link'
|
|
|
|
import { inject, observer } from 'mobx-react'
|
|
|
|
import Clock from './Clock'
|
|
|
|
|
2018-12-17 16:34:32 +00:00
|
|
|
@inject('store')
|
|
|
|
@observer
|
2017-01-06 11:38:51 +00:00
|
|
|
class Page extends React.Component {
|
2018-12-17 16:34:32 +00:00
|
|
|
componentDidMount() {
|
2017-01-06 11:38:51 +00:00
|
|
|
this.props.store.start()
|
|
|
|
}
|
|
|
|
|
2018-12-17 16:34:32 +00:00
|
|
|
componentWillUnmount() {
|
2017-01-06 11:38:51 +00:00
|
|
|
this.props.store.stop()
|
|
|
|
}
|
|
|
|
|
2018-12-17 16:34:32 +00:00
|
|
|
render() {
|
2017-01-06 11:38:51 +00:00
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<h1>{this.props.title}</h1>
|
2018-12-17 16:34:32 +00:00
|
|
|
<Clock
|
|
|
|
lastUpdate={this.props.store.lastUpdate}
|
|
|
|
light={this.props.store.light}
|
|
|
|
/>
|
2017-01-06 11:38:51 +00:00
|
|
|
<nav>
|
2018-12-17 16:34:32 +00:00
|
|
|
<Link href={this.props.linkTo}>
|
|
|
|
<a>Navigate</a>
|
|
|
|
</Link>
|
2017-01-06 11:38:51 +00:00
|
|
|
</nav>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Page
|