diff options
Diffstat (limited to 'dashboard/assets/index.jsx')
-rw-r--r-- | dashboard/assets/index.jsx | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/dashboard/assets/index.jsx b/dashboard/assets/index.jsx index 1e5fdc892..4ee567b01 100644 --- a/dashboard/assets/index.jsx +++ b/dashboard/assets/index.jsx @@ -1,3 +1,5 @@ +// @flow + // Copyright 2017 The go-ethereum Authors // This file is part of the go-ethereum library. // @@ -15,22 +17,25 @@ // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. import React from 'react'; -import {hydrate} from 'react-dom'; -import {createMuiTheme, MuiThemeProvider} from 'material-ui/styles'; +import {render} from 'react-dom'; -import Dashboard from './components/Dashboard.jsx'; +import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'; +import createMuiTheme from 'material-ui/styles/createMuiTheme'; -// Theme for the dashboard. -const theme = createMuiTheme({ - palette: { - type: 'dark', - }, -}); +import Dashboard from './components/Dashboard'; -// Renders the whole dashboard. -hydrate( - <MuiThemeProvider theme={theme}> - <Dashboard /> - </MuiThemeProvider>, - document.getElementById('dashboard') -); +const theme: Object = createMuiTheme({ + palette: { + type: 'dark', + }, +}); +const dashboard = document.getElementById('dashboard'); +if (dashboard) { + // Renders the whole dashboard. + render( + <MuiThemeProvider theme={theme}> + <Dashboard /> + </MuiThemeProvider>, + dashboard, + ); +} |