diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/App.jsx b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/App.jsx index 58002cfb62d..8859f1897f1 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/App.jsx +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/App.jsx @@ -31,18 +31,21 @@ import { PlatformCreate, PlatformListing } from './components'; +import Theme from './themes/theme'; + + const history = createHistory({basename: '/publisher'}); /** - * User can define the themes in the config.json. The themes will be loaded based on the user preference. + *Loading the theme files based on the 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); +let selected = Theme.selectedTheme; +if (Theme.currentTheme === "default") { + let defaultTheme = require("material-ui/styles/baseThemes/" + selected); muiTheme = getMuiTheme(defaultTheme.default); } else { - let customTheme = require("./themes/" + theme.custom); + let customTheme = require("./themes/" + selected + "/theme.js"); muiTheme = getMuiTheme(customTheme.default); } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Application/ApplicationCreate.jsx b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Application/ApplicationCreate.jsx index 86ad0961ff6..afb03ffbaa0 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Application/ApplicationCreate.jsx +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Application/ApplicationCreate.jsx @@ -24,7 +24,7 @@ import {Step1, Step2, Step3} from './CreateSteps'; import RaisedButton from 'material-ui/RaisedButton'; import {Card, CardActions, CardTitle} from 'material-ui/Card'; import {Step, StepLabel, Stepper,} from 'material-ui/Stepper'; - +import Theme from '../../themes/theme'; /** * The App Create Component. @@ -51,6 +51,20 @@ class ApplicationCreate extends Component { }; } + componentWillMount() { + let selected = Theme.selectedTheme; + if (Theme.currentTheme === "default") { + require("../../themes/default/application-create.css"); + } else { + try { + require("../../themes/" + selected + "/application-create.css"); + } catch (ex){ + // If the particular customized file does not exist, use the default one. + require("../../themes/default/application-create.css"); + } + } + } + /** * Handles next button click event. * */ @@ -179,15 +193,15 @@ class ApplicationCreate extends Component { return ( -
Create App?
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Application/ApplicationListing.jsx b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Application/ApplicationListing.jsx index d0df14fb181..2b33e409f28 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Application/ApplicationListing.jsx +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Application/ApplicationListing.jsx @@ -21,6 +21,7 @@ import {withRouter} from 'react-router-dom'; import TextField from 'material-ui/TextField'; import DataTable from '../UIComponents/DataTable'; import {Card, CardActions, CardTitle} from 'material-ui/Card'; +import Theme from '../../themes/theme'; /** * The App Create Component. @@ -112,6 +113,18 @@ class ApplicationListing extends Component { componentWillMount() { //Fetch all the applications from backend and create application objects. this.setState({data: this.data}); + + let selected = Theme.selectedTheme; + if (Theme.currentTheme === "default") { + require("../../themes/default/application-listing.css"); + } else { + try { + require("../../themes/" + selected + "/application-listing.css"); + } catch (ex) { + // If the particular customized file does not exist, use the default one. + require("../../themes/default/application-listing.css"); + } + } } /** @@ -156,12 +169,11 @@ class ApplicationListing extends Component { render() { return ( -Platform Specific Properties
+Platform Specific Properties
{this.state.errors["Banner"]}
-Banner*:
-{this.state.errors["Banner"]}
+Banner*:
++
++
{this.state.errors["Screenshots"]}
-Screenshots*:
-{this.state.errors["Screenshots"]}
+Screenshots*:
++
++
{this.state.errors["Icon"]}
-Icon*:
-{this.state.errors["Icon"]}
+Icon*:
++
++