mirror of
https://github.com/ascribe/onion.git
synced 2025-02-14 21:10:27 +01:00
finishing boilerplate for wallet app + prefixing whitelabel specific files
This commit is contained in:
parent
f086bece71
commit
eb6e3cb20a
@ -44,7 +44,6 @@ requests.defaults({
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class AppGateway {
|
class AppGateway {
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import AppPrizeConstants from './application_prize_constants';
|
import AppPrizeConstants from './prize_application_constants';
|
||||||
|
|
||||||
function getApiUrls(subdomain) {
|
function getPrizeApiUrls(subdomain) {
|
||||||
return {
|
return {
|
||||||
'pieces_list': AppPrizeConstants.prizeApiEndpoint + subdomain + '/pieces/',
|
'pieces_list': AppPrizeConstants.prizeApiEndpoint + subdomain + '/pieces/',
|
||||||
'users_login': AppPrizeConstants.prizeApiEndpoint + subdomain + '/users/login/',
|
'users_login': AppPrizeConstants.prizeApiEndpoint + subdomain + '/users/login/',
|
||||||
@ -20,4 +20,4 @@ function getApiUrls(subdomain) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export default getApiUrls;
|
export default getPrizeApiUrls;
|
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
import AppConstants from '../../../../constants/application_constants';
|
import AppConstants from '../../../../constants/application_constants';
|
||||||
|
|
||||||
let constants = {
|
let prizeConstants = {
|
||||||
prizeApiEndpoint: AppConstants.apiEndpoint + 'prizes/'
|
prizeApiEndpoint: AppConstants.apiEndpoint + 'prizes/'
|
||||||
};
|
};
|
||||||
|
|
||||||
export default constants;
|
export default prizeConstants;
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import Router from 'react-router';
|
import Router from 'react-router';
|
||||||
import Hero from './components/hero';
|
import Hero from './components/prize_hero';
|
||||||
import Header from '../../header';
|
import Header from '../../header';
|
||||||
// import Footer from '../../footer';
|
// import Footer from '../../footer';
|
||||||
import GlobalNotification from '../../global_notification';
|
import GlobalNotification from '../../global_notification';
|
@ -3,18 +3,18 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import Router from 'react-router';
|
import Router from 'react-router';
|
||||||
|
|
||||||
import Landing from './components/landing';
|
import Landing from './components/prize_landing';
|
||||||
import LoginContainer from './components/login_container';
|
import LoginContainer from './components/prize_login_container';
|
||||||
import LogoutContainer from '../../../components/logout_container';
|
import LogoutContainer from '../../../components/logout_container';
|
||||||
import SignupContainer from './components/signup_container';
|
import SignupContainer from './components/prize_signup_container';
|
||||||
import PasswordResetContainer from '../../../components/password_reset_container';
|
import PasswordResetContainer from '../../../components/password_reset_container';
|
||||||
import PrizeRegisterPiece from './components/register_piece';
|
import PrizeRegisterPiece from './components/prize_register_piece';
|
||||||
import PrizePieceList from './components/piece_list';
|
import PrizePieceList from './components/prize_piece_list';
|
||||||
import PrizePieceContainer from './components/ascribe_detail/piece_container';
|
import PrizePieceContainer from './components/ascribe_detail/prize_piece_container';
|
||||||
import EditionContainer from '../../ascribe_detail/edition_container';
|
import EditionContainer from '../../ascribe_detail/edition_container';
|
||||||
import SettingsContainer from './components/settings_container';
|
import SettingsContainer from './components/prize_settings_container';
|
||||||
|
|
||||||
import App from './app';
|
import App from './prize_app';
|
||||||
import AppConstants from '../../../constants/application_constants';
|
import AppConstants from '../../../constants/application_constants';
|
||||||
|
|
||||||
let Route = Router.Route;
|
let Route = Router.Route;
|
@ -0,0 +1,57 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
import RegisterPiece from '../../../register_piece';
|
||||||
|
import Property from '../../../ascribe_forms/property';
|
||||||
|
import InputTextAreaToggable from '../../../ascribe_forms/input_textarea_toggable';
|
||||||
|
import InputCheckbox from '../../../ascribe_forms/input_checkbox';
|
||||||
|
|
||||||
|
import { getLangText } from '../../../../utils/lang_utils';
|
||||||
|
|
||||||
|
|
||||||
|
let WalletRegisterPiece = React.createClass({
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<RegisterPiece
|
||||||
|
enableLocalHashing={false}
|
||||||
|
headerMessage={getLangText('Submit to Cyland')}
|
||||||
|
submitMessage={getLangText('Submit')}>
|
||||||
|
<Property
|
||||||
|
name='loan'
|
||||||
|
label={getLangText('Loan to')}
|
||||||
|
editable={true}>
|
||||||
|
<InputTextAreaToggable
|
||||||
|
rows={1}
|
||||||
|
editable={true}
|
||||||
|
placeholder={getLangText('videoarchive@cyland.org')}
|
||||||
|
required="required"/>
|
||||||
|
</Property>
|
||||||
|
<Property
|
||||||
|
name='gallery'
|
||||||
|
label={getLangText('Gallery')}
|
||||||
|
editable={true}>
|
||||||
|
<InputTextAreaToggable
|
||||||
|
rows={1}
|
||||||
|
editable={true}
|
||||||
|
placeholder={getLangText('Cyland Archive')}
|
||||||
|
required="required"/>
|
||||||
|
</Property>
|
||||||
|
<Property
|
||||||
|
name="terms"
|
||||||
|
className="ascribe-settings-property-collapsible-toggle"
|
||||||
|
style={{paddingBottom: 0}}>
|
||||||
|
<InputCheckbox>
|
||||||
|
<span>
|
||||||
|
{' ' + getLangText('I agree to the Terms of Service the art price') + ' '}
|
||||||
|
(<a href="https://s3-us-west-2.amazonaws.com/ascribe0/whitelabel/sluice/terms.pdf" target="_blank" style={{fontSize: '0.9em', color: 'rgba(0,0,0,0.7)'}}>
|
||||||
|
{getLangText('read')}
|
||||||
|
</a>)
|
||||||
|
</span>
|
||||||
|
</InputCheckbox>
|
||||||
|
</Property>
|
||||||
|
</RegisterPiece>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export default WalletRegisterPiece;
|
11
js/components/whitelabel/wallet/constants/wallet_api_urls.js
Normal file
11
js/components/whitelabel/wallet/constants/wallet_api_urls.js
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
import WalletAppConstants from './wallet_application_constants';
|
||||||
|
|
||||||
|
function getPrizeApiUrls(subdomain) {
|
||||||
|
return {
|
||||||
|
'pieces_list': WalletAppConstants.walletApiEndpoint + subdomain + '/pieces/'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export default getPrizeApiUrls;
|
@ -0,0 +1,9 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
import AppConstants from '../../../../constants/application_constants';
|
||||||
|
|
||||||
|
let walletConstants = {
|
||||||
|
walletApiEndpoint: AppConstants.apiEndpoint + 'wallets/'
|
||||||
|
};
|
||||||
|
|
||||||
|
export default walletConstants;
|
@ -3,17 +3,17 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import Router from 'react-router';
|
import Router from 'react-router';
|
||||||
|
|
||||||
import LoginContainer from './components/login_container';
|
import LoginContainer from '../../../components/login_container';
|
||||||
import LogoutContainer from '../../../components/logout_container';
|
import LogoutContainer from '../../../components/logout_container';
|
||||||
import SignupContainer from './components/signup_container';
|
import SignupContainer from '../../../components/signup_container';
|
||||||
import PasswordResetContainer from '../../../components/password_reset_container';
|
import PasswordResetContainer from '../../../components/password_reset_container';
|
||||||
import WalletRegisterPiece from './components/wallet_register_piece';
|
import WalletRegisterPiece from './components/wallet_register_piece';
|
||||||
import PieceList from '../../piece_list';
|
import PieceList from '../../../components/piece_list';
|
||||||
import PieceContainer from '../../ascribe_detail/piece_container';
|
import PieceContainer from '../../../components/ascribe_detail/piece_container';
|
||||||
import EditionContainer from '../../ascribe_detail/edition_container';
|
import EditionContainer from '../../../components/ascribe_detail/edition_container';
|
||||||
import SettingsContainer from './components/settings_container';
|
import SettingsContainer from '../../../components/settings_container';
|
||||||
|
|
||||||
import App from './app';
|
import WalletApp from './wallet_app';
|
||||||
import AppConstants from '../../../constants/application_constants';
|
import AppConstants from '../../../constants/application_constants';
|
||||||
|
|
||||||
let Route = Router.Route;
|
let Route = Router.Route;
|
||||||
@ -22,7 +22,7 @@ let baseUrl = AppConstants.baseUrl;
|
|||||||
|
|
||||||
function getRoutes() {
|
function getRoutes() {
|
||||||
return (
|
return (
|
||||||
<Route name="app" path={baseUrl} handler={App}>
|
<Route name="app" path={baseUrl} handler={WalletApp}>
|
||||||
<Route name="landing" path={baseUrl} handler={WalletRegisterPiece} />
|
<Route name="landing" path={baseUrl} handler={WalletRegisterPiece} />
|
||||||
<Route name="login" path="login" handler={LoginContainer} />
|
<Route name="login" path="login" handler={LoginContainer} />
|
||||||
<Route name="logout" path="logout" handler={LogoutContainer} />
|
<Route name="logout" path="logout" handler={LogoutContainer} />
|
@ -1,7 +1,10 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import AppConstants from './application_constants';
|
import AppConstants from './application_constants';
|
||||||
import getPrizeApiUrls from '../components/whitelabel/prize/constants/api_urls';
|
|
||||||
|
import getPrizeApiUrls from '../components/whitelabel/prize/constants/prize_api_urls';
|
||||||
|
import getWalletApiUrls from '../components/whitelabel/wallet/constants/wallet_api_urls';
|
||||||
|
|
||||||
import { update } from '../utils/general_utils';
|
import { update } from '../utils/general_utils';
|
||||||
|
|
||||||
|
|
||||||
@ -62,6 +65,8 @@ export function updateApiUrls(type, subdomain) {
|
|||||||
|
|
||||||
if (type === 'prize') {
|
if (type === 'prize') {
|
||||||
newUrls = getPrizeApiUrls(subdomain);
|
newUrls = getPrizeApiUrls(subdomain);
|
||||||
|
} else if(type === 'wallet') {
|
||||||
|
newUrls = getWalletApiUrls(subdomain);
|
||||||
}
|
}
|
||||||
update(ApiUrls, newUrls);
|
update(ApiUrls, newUrls);
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,8 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import Router from 'react-router';
|
import Router from 'react-router';
|
||||||
|
|
||||||
import getPrizeRoutes from './components/whitelabel/prize/routes';
|
import getPrizeRoutes from './components/whitelabel/prize/prize_routes';
|
||||||
|
import getWalletRoutes from './components/whitelabel/wallet/wallet_routes';
|
||||||
import getDefaultRoutes from './components/routes';
|
import getDefaultRoutes from './components/routes';
|
||||||
|
|
||||||
import PieceList from './components/piece_list';
|
import PieceList from './components/piece_list';
|
||||||
@ -47,6 +48,8 @@ function getRoutes(type) {
|
|||||||
|
|
||||||
if (type === 'prize') {
|
if (type === 'prize') {
|
||||||
routes = getPrizeRoutes(COMMON_ROUTES);
|
routes = getPrizeRoutes(COMMON_ROUTES);
|
||||||
|
} else if(type === 'wallet') {
|
||||||
|
routes = getWalletRoutes(COMMON_ROUTES);
|
||||||
} else {
|
} else {
|
||||||
routes = getDefaultRoutes(COMMON_ROUTES);
|
routes = getDefaultRoutes(COMMON_ROUTES);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user