diff options
Diffstat (limited to 'app/client/modules/pix2pix/index.js')
| -rw-r--r-- | app/client/modules/pix2pix/index.js | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/app/client/modules/pix2pix/index.js b/app/client/modules/pix2pix/index.js index 174398d..21bffe7 100644 --- a/app/client/modules/pix2pix/index.js +++ b/app/client/modules/pix2pix/index.js @@ -1,22 +1,33 @@ import { h, Component } from 'preact' import { Route, Link } from 'react-router-dom' +import actions from '../../actions' + import util from '../../util' import Pix2PixNew from './views/pix2pix.new' import Pix2PixShow from './views/pix2pix.show' import Pix2PixLive from './views/pix2pix.live' -function router () { - document.body.style.backgroundImage = 'linear-gradient(' + (util.randint(40)+40) + 'deg, #fde, #ffe)' - return ( - <section> - <Route exact path='/pix2pix/new/' component={Pix2PixNew} /> - <Route exact path='/pix2pix/sequences/' component={Pix2PixShow} /> - <Route exact path='/pix2pix/sequences/:id/' component={Pix2PixShow} /> - <Route exact path='/pix2pix/live/' component={Pix2PixLive} /> - </section> - ) +class router { + componentWillMount(){ + actions.system.changeTool('pix2pix') + document.body.style.backgroundImage = 'linear-gradient(' + (util.randint(40)+40) + 'deg, #fde, #ffe)' + } + componentWillReceiveProps(){ + actions.system.changeTool('pix2pix') + document.body.style.backgroundImage = 'linear-gradient(' + (util.randint(40)+40) + 'deg, #fde, #ffe)' + } + render(){ + return ( + <section> + <Route exact path='/pix2pix/new/' component={Pix2PixNew} /> + <Route exact path='/pix2pix/sequences/' component={Pix2PixShow} /> + <Route exact path='/pix2pix/sequences/:id/' component={Pix2PixShow} /> + <Route exact path='/pix2pix/live/' component={Pix2PixLive} /> + </section> + ) + } } function links(){ |
