diff --git a/gulpfile.js b/gulpfile.js index 6f82da83..25af23bf 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -93,8 +93,7 @@ gulp.task('browser-sync', function() { browserSync({ files: config.filesToWatch, proxy: 'http://localhost:4000', - port: 3000, - browser: "chromium-browser" + port: 3000 }); }); diff --git a/js/actions/whitelabel_actions.js b/js/actions/whitelabel_actions.js new file mode 100644 index 00000000..28d95cb9 --- /dev/null +++ b/js/actions/whitelabel_actions.js @@ -0,0 +1,25 @@ +'use strict'; + +import alt from '../alt'; +import WhitelabelFetcher from '../fetchers/whitelabel_fetcher'; + + +class WhitelabelActions { + constructor() { + this.generateActions( + 'updateWhitelabel' + ); + } + + fetchWhitelabel() { + WhitelabelFetcher.fetch() + .then((res) => { + this.actions.updateWhitelabel(res.whitelabel); + }) + .catch((err) => { + console.log(err); + }); + } +} + +export default alt.createActions(WhitelabelActions); diff --git a/js/components/edition.js b/js/components/edition.js index bdd25e84..e72822aa 100644 --- a/js/components/edition.js +++ b/js/components/edition.js @@ -518,7 +518,7 @@ let FileUploader = React.createClass({ bitcoinId: this.props.edition.bitcoin_id }} createBlobRoutine={{ - url: apiUrls.blob_digitalworks + url: apiUrls.blob_otherdatas }} validation={{ itemLimit: 100000, diff --git a/js/components/header.js b/js/components/header.js index 4699972c..b2e70f81 100644 --- a/js/components/header.js +++ b/js/components/header.js @@ -6,6 +6,9 @@ import Router from 'react-router'; import UserActions from '../actions/user_actions'; import UserStore from '../stores/user_store'; +import WhitelabelActions from '../actions/whitelabel_actions'; +import WhitelabelStore from '../stores/whitelabel_store'; + import Alt from '../alt'; import Nav from 'react-bootstrap/lib/Nav'; @@ -17,6 +20,7 @@ import MenuItemLink from 'react-router-bootstrap/lib/MenuItemLink'; import NavItemLink from 'react-router-bootstrap/lib/NavItemLink'; +import { mergeOptions } from '../utils/general_utils'; import { getLangText } from '../utils/lang_utils'; let Link = Router.Link; @@ -25,22 +29,47 @@ let Header = React.createClass({ mixins: [Router.Navigation], getInitialState() { - return UserStore.getState(); + return mergeOptions(WhitelabelStore.getState(), UserStore.getState()); }, componentDidMount() { UserActions.fetchCurrentUser(); UserStore.listen(this.onChange); + WhitelabelActions.fetchWhitelabel(); + WhitelabelStore.listen(this.onChange); }, componentWillUnmount() { UserStore.unlisten(this.onChange); + WhitelabelStore.unlisten(this.onChange); }, handleLogout(){ UserActions.logoutCurrentUser(); Alt.flush(); this.transitionTo('login'); }, + getLogo(){ + let logo = ( + + ascribe + + ); + if (this.state.whitelabel.logo){ + logo = ; + } + return logo; + }, + + getPoweredBy(){ + return ( +
); + }, onChange(state) { this.setState(state); }, @@ -64,20 +93,24 @@ let Header = React.createClass({ account =