diff --git a/js/components/whitelabel/prize/portfolioreview/components/pr_landing.js b/js/components/whitelabel/prize/portfolioreview/components/pr_landing.js index a3f14bef..039a4b45 100644 --- a/js/components/whitelabel/prize/portfolioreview/components/pr_landing.js +++ b/js/components/whitelabel/prize/portfolioreview/components/pr_landing.js @@ -32,10 +32,11 @@ const PRLanding = React.createClass({ componentDidMount() { const { location } = this.props; + PrizeStore.listen(this.onChange); PrizeActions.fetchPrize(); - if (location && location.query && location.query.redirect) { + if (location.query.redirect) { let queryCopy = JSON.parse(JSON.stringify(location.query)); delete queryCopy.redirect; window.setTimeout(() => this.history.replaceState(null, `/${location.query.redirect}`, queryCopy)); diff --git a/js/components/whitelabel/wallet/components/23vivi/23vivi_landing.js b/js/components/whitelabel/wallet/components/23vivi/23vivi_landing.js index f6b2d50c..1219c182 100644 --- a/js/components/whitelabel/wallet/components/23vivi/23vivi_landing.js +++ b/js/components/whitelabel/wallet/components/23vivi/23vivi_landing.js @@ -5,42 +5,32 @@ import React from 'react'; import Button from 'react-bootstrap/lib/Button'; import LinkContainer from 'react-router-bootstrap/lib/LinkContainer'; -import WhitelabelActions from '../../../../../actions/whitelabel_actions'; -import WhitelabelStore from '../../../../../stores/whitelabel_store'; - -import { mergeOptions } from '../../../../../utils/general_utils'; import { getLangText } from '../../../../../utils/lang_utils'; import { setDocumentTitle } from '../../../../../utils/dom_utils'; let Vivi23Landing = React.createClass({ - getInitialState() { - return WhitelabelStore.getState(); + propTypes: { + customThumbnailPlaceholder: React.PropTypes.func, + + // Provided from PrizeApp + currentUser: React.PropTypes.object, + whitelabel: React.PropTypes.object, + + // Provided from router + location: React.PropTypes.object }, componentWillMount() { setDocumentTitle('23VIVI Marketplace'); }, - componentDidMount() { - WhitelabelStore.listen(this.onChange); - WhitelabelActions.fetchWhitelabel(); - }, - - componentWillUnmount() { - WhitelabelStore.unlisten(this.onChange); - }, - - onChange(state) { - this.setState(state); - }, - render() { return (
- +
{getLangText('Artwork from the 23VIVI Marketplace is powered by') + ' '} diff --git a/js/components/whitelabel/wallet/components/23vivi/23vivi_piece_list.js b/js/components/whitelabel/wallet/components/23vivi/23vivi_piece_list.js index 0bfb8aa0..bb64fc9a 100644 --- a/js/components/whitelabel/wallet/components/23vivi/23vivi_piece_list.js +++ b/js/components/whitelabel/wallet/components/23vivi/23vivi_piece_list.js @@ -8,17 +8,21 @@ import MarketPieceList from '../market/market_piece_list'; let Vivi23PieceList = React.createClass({ propTypes: { + // Provided from PrizeApp + currentUser: React.PropTypes.object, + whitelabel: React.PropTypes.object, + + // Provided from router location: React.PropTypes.object }, render() { return ( + {...this.props} + customThumbnailPlaceholder={Vivi23AccordionListItemThumbnailPlaceholder} /> ); } - }); export default Vivi23PieceList; diff --git a/js/components/whitelabel/wallet/components/ascribe_detail/wallet_piece_container.js b/js/components/whitelabel/wallet/components/ascribe_detail/wallet_piece_container.js index 632b415e..5c9af8b1 100644 --- a/js/components/whitelabel/wallet/components/ascribe_detail/wallet_piece_container.js +++ b/js/components/whitelabel/wallet/components/ascribe_detail/wallet_piece_container.js @@ -32,7 +32,6 @@ let WalletPieceContainer = React.createClass({ ]) }, - render() { if (this.props.piece && this.props.piece.id) { return ( diff --git a/js/components/whitelabel/wallet/components/lumenus/lumenus_landing.js b/js/components/whitelabel/wallet/components/lumenus/lumenus_landing.js index 23289276..5f5020a3 100644 --- a/js/components/whitelabel/wallet/components/lumenus/lumenus_landing.js +++ b/js/components/whitelabel/wallet/components/lumenus/lumenus_landing.js @@ -5,46 +5,31 @@ import React from 'react'; import Button from 'react-bootstrap/lib/Button'; import LinkContainer from 'react-router-bootstrap/lib/LinkContainer'; -import WhitelabelActions from '../../../../../actions/whitelabel_actions'; -import WhitelabelStore from '../../../../../stores/whitelabel_store'; - -import { mergeOptions } from '../../../../../utils/general_utils'; import { getLangText } from '../../../../../utils/lang_utils'; import { setDocumentTitle } from '../../../../../utils/dom_utils'; let LumenusLanding = React.createClass({ + propTypes: { + // Provided from PrizeApp + currentUser: React.PropTypes.object, + whitelabel: React.PropTypes.object, - getInitialState() { - return mergeOptions( - WhitelabelStore.getState() - ); + // Provided from router + location: React.PropTypes.object }, componentWillMount() { setDocumentTitle('Lumenus Marketplace'); }, - componentDidMount() { - WhitelabelStore.listen(this.onChange); - WhitelabelActions.fetchWhitelabel(); - }, - - componentWillUnmount() { - WhitelabelStore.unlisten(this.onChange); - }, - - onChange(state) { - this.setState(state); - }, - render() { return (
- +
{getLangText('Artwork from the Lumenus Marketplace is powered by') + ' '} diff --git a/js/components/whitelabel/wallet/components/market/market_piece_list.js b/js/components/whitelabel/wallet/components/market/market_piece_list.js index 1c74e6de..404926f3 100644 --- a/js/components/whitelabel/wallet/components/market/market_piece_list.js +++ b/js/components/whitelabel/wallet/components/market/market_piece_list.js @@ -6,11 +6,6 @@ import MarketAclButtonList from './market_buttons/market_acl_button_list'; import PieceList from '../../../../piece_list'; -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 { setDocumentTitle } from '../../../../../utils/dom_utils'; import { mergeOptions } from '../../../../../utils/general_utils'; import { getLangText } from '../../../../../utils/lang_utils'; @@ -18,45 +13,27 @@ import { getLangText } from '../../../../../utils/lang_utils'; let MarketPieceList = React.createClass({ propTypes: { customThumbnailPlaceholder: React.PropTypes.func, - location: React.PropTypes.object - }, - getInitialState() { - return mergeOptions( - UserStore.getState(), - WhitelabelStore.getState() - ); + // Provided from PrizeApp + currentUser: React.PropTypes.object, + whitelabel: React.PropTypes.object, + + // Provided from router + location: React.PropTypes.object }, componentWillMount() { setDocumentTitle(getLangText('Collection')); }, - componentDidMount() { - UserStore.listen(this.onChange); - WhitelabelStore.listen(this.onChange); - - UserActions.fetchCurrentUser(); - WhitelabelActions.fetchWhitelabel(); - }, - - componentWillUnmount() { - UserStore.unlisten(this.onChange); - WhitelabelStore.unlisten(this.onChange); - }, - - onChange(state) { - this.setState(state); - }, - render() { - const { customThumbnailPlaceholder, location } = this.props; const { currentUser: { email: userEmail }, + customThumbnailPlaceholder, whitelabel: { name: whitelabelName = 'Market', user: whitelabelAdminEmail - } } = this.state; + } } = this.props; let filterParams = null; let canLoadPieceList = false; @@ -77,12 +54,12 @@ let MarketPieceList = React.createClass({ return ( + filterParams={filterParams} /> ); } }); diff --git a/js/components/whitelabel/wallet/components/market/market_register_piece.js b/js/components/whitelabel/wallet/components/market/market_register_piece.js index 387934f9..927fed62 100644 --- a/js/components/whitelabel/wallet/components/market/market_register_piece.js +++ b/js/components/whitelabel/wallet/components/market/market_register_piece.js @@ -6,19 +6,15 @@ import { History } from 'react-router'; import Col from 'react-bootstrap/lib/Col'; import Row from 'react-bootstrap/lib/Row'; +import PieceActions from '../../../../../actions/piece_actions'; +import PieceListStore from '../../../../../stores/piece_list_store'; +import PieceListActions from '../../../../../actions/piece_list_actions'; + import MarketAdditionalDataForm from './market_forms/market_additional_data_form'; import Property from '../../../../ascribe_forms/property'; import RegisterPieceForm from '../../../../ascribe_forms/form_register_piece'; -import PieceActions from '../../../../../actions/piece_actions'; -import PieceListStore from '../../../../../stores/piece_list_store'; -import PieceListActions from '../../../../../actions/piece_list_actions'; -import UserStore from '../../../../../stores/user_store'; -import UserActions from '../../../../../actions/user_actions'; -import WhitelabelActions from '../../../../../actions/whitelabel_actions'; -import WhitelabelStore from '../../../../../stores/whitelabel_store'; - import SlidesContainer from '../../../../ascribe_slides_container/slides_container'; import { getLangText } from '../../../../../utils/lang_utils'; @@ -27,6 +23,11 @@ import { mergeOptions } from '../../../../../utils/general_utils'; let MarketRegisterPiece = React.createClass({ propTypes: { + // Provided from PrizeApp + currentUser: React.PropTypes.object, + whitelabel: React.PropTypes.object, + + // Provided from router location: React.PropTypes.object }, @@ -35,8 +36,6 @@ let MarketRegisterPiece = React.createClass({ getInitialState(){ return mergeOptions( PieceListStore.getState(), - UserStore.getState(), - WhitelabelStore.getState(), { step: 0 }); @@ -44,11 +43,6 @@ let MarketRegisterPiece = React.createClass({ componentDidMount() { PieceListStore.listen(this.onChange); - UserStore.listen(this.onChange); - WhitelabelStore.listen(this.onChange); - - UserActions.fetchCurrentUser(); - WhitelabelActions.fetchWhitelabel(); // Reset the piece store to make sure that we don't display old data // if the user repeatedly registers works @@ -57,8 +51,6 @@ let MarketRegisterPiece = React.createClass({ componentWillUnmount() { PieceListStore.unlisten(this.onChange); - UserStore.unlisten(this.onChange); - WhitelabelStore.unlisten(this.onChange); }, onChange(state) { @@ -115,10 +107,11 @@ let MarketRegisterPiece = React.createClass({ render() { const { - step, + location, whitelabel: { name: whitelabelName = 'Market' - } } = this.state; + } } = this.props + const { step } = this.state; setDocumentTitle(getLangText('Register a new piece')); @@ -130,7 +123,7 @@ let MarketRegisterPiece = React.createClass({ pending: 'glyphicon glyphicon-chevron-right', completed: 'glyphicon glyphicon-lock' }} - location={this.props.location}> + location={location}>
@@ -142,7 +135,7 @@ let MarketRegisterPiece = React.createClass({ isFineUploaderActive={true} enableSeparateThumbnail={false} handleSuccess={this.handleRegisterSuccess} - location={this.props.location}> + location={location}>