|
|
@ -20,6 +20,8 @@ import './App.css';
|
|
|
|
import React, {Component} from 'react';
|
|
|
|
import React, {Component} from 'react';
|
|
|
|
import createHistory from 'history/createBrowserHistory';
|
|
|
|
import createHistory from 'history/createBrowserHistory';
|
|
|
|
import {BrowserRouter as Router, Redirect, Route, Switch} from 'react-router-dom'
|
|
|
|
import {BrowserRouter as Router, Redirect, Route, Switch} from 'react-router-dom'
|
|
|
|
|
|
|
|
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
|
|
|
|
|
|
|
|
import getMuiTheme from 'material-ui/styles/getMuiTheme';
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
ApplicationCreate,
|
|
|
|
ApplicationCreate,
|
|
|
|
ApplicationListing,
|
|
|
|
ApplicationListing,
|
|
|
@ -29,9 +31,21 @@ import {
|
|
|
|
PlatformCreate,
|
|
|
|
PlatformCreate,
|
|
|
|
PlatformListing
|
|
|
|
PlatformListing
|
|
|
|
} from './components';
|
|
|
|
} from './components';
|
|
|
|
|
|
|
|
|
|
|
|
const history = createHistory({basename: '/publisher'});
|
|
|
|
const history = createHistory({basename: '/publisher'});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* User can define the themes in the config.json. The themes will be loaded based on the user preference.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
const theme = require("./config.json").theme;
|
|
|
|
|
|
|
|
let muiTheme = null;
|
|
|
|
|
|
|
|
if (theme.current === "default") {
|
|
|
|
|
|
|
|
let defaultTheme = require("material-ui/styles/baseThemes/" + theme.default);
|
|
|
|
|
|
|
|
muiTheme = getMuiTheme(defaultTheme.default);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
let customTheme = require("./themes/" + theme.custom);
|
|
|
|
|
|
|
|
muiTheme = getMuiTheme(customTheme.default);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* This component defines the layout and the routes for the app.
|
|
|
|
* This component defines the layout and the routes for the app.
|
|
|
|
* All the content will be loaded inside the Base component.
|
|
|
|
* All the content will be loaded inside the Base component.
|
|
|
@ -45,7 +59,6 @@ const history = createHistory({basename: '/publisher'});
|
|
|
|
* HashRouter is used because the other router types need the server to serve those urls. In hashRouter, server does
|
|
|
|
* HashRouter is used because the other router types need the server to serve those urls. In hashRouter, server does
|
|
|
|
* not want to serve the URL.
|
|
|
|
* not want to serve the URL.
|
|
|
|
* */
|
|
|
|
* */
|
|
|
|
|
|
|
|
|
|
|
|
class Base extends Component {
|
|
|
|
class Base extends Component {
|
|
|
|
constructor() {
|
|
|
|
constructor() {
|
|
|
|
super();
|
|
|
|
super();
|
|
|
@ -91,6 +104,7 @@ class Publisher extends Component {
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div className="App">
|
|
|
|
<div className="App">
|
|
|
|
|
|
|
|
<MuiThemeProvider muiTheme={muiTheme}>
|
|
|
|
<Router basename="publisher" history={history}>
|
|
|
|
<Router basename="publisher" history={history}>
|
|
|
|
<Switch>
|
|
|
|
<Switch>
|
|
|
|
<Route path="/login" component={Login}/>
|
|
|
|
<Route path="/login" component={Login}/>
|
|
|
@ -98,6 +112,7 @@ class Publisher extends Component {
|
|
|
|
<Route component={Base}/>
|
|
|
|
<Route component={Base}/>
|
|
|
|
</Switch>
|
|
|
|
</Switch>
|
|
|
|
</Router>
|
|
|
|
</Router>
|
|
|
|
|
|
|
|
</MuiThemeProvider>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|