From 7917bca6c4da52f65de7f5ff139d66db2ac9ec51 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 16 Jun 2018 16:02:33 +0200 Subject: navigationnnn --- app/client/modules/samplernn/index.js | 36 +++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) (limited to 'app/client/modules/samplernn/index.js') diff --git a/app/client/modules/samplernn/index.js b/app/client/modules/samplernn/index.js index 2a9d64d..85c99e4 100644 --- a/app/client/modules/samplernn/index.js +++ b/app/client/modules/samplernn/index.js @@ -1,5 +1,8 @@ import { h, Component } from 'preact' import { Route, Link } from 'react-router-dom' + +import actions from '../../actions' + import util from '../../util' import SampleRNNNew from './views/samplernn.new' @@ -8,18 +11,27 @@ import SampleRNNImport from './views/samplernn.import' import SampleRNNResults from './views/samplernn.results' import SampleRNNGraph from './views/samplernn.graph' -function router () { - document.body.style.backgroundImage = 'linear-gradient(' + (util.randint(40)+40) + 'deg, #eef, #fef)' - return ( -
- - - - - - -
- ) +class router { + componentWillMount(){ + actions.system.changeTool('samplernn') + document.body.style.backgroundImage = 'linear-gradient(' + (util.randint(40)+40) + 'deg, #eef, #fef)' + } + componentWillReceiveProps(){ + actions.system.changeTool('samplernn') + document.body.style.backgroundImage = 'linear-gradient(' + (util.randint(40)+40) + 'deg, #eef, #fef)' + } + render(){ + return ( +
+ + + + + + +
+ ) + } } function links(){ -- cgit v1.2.3-70-g09d2