From e88612704f95fc4eca8a1b308b6e206abeedc9f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Tue, 18 Aug 2015 13:39:06 +0200 Subject: [PATCH] cyland loan form for accordion list --- .../ascribe_buttons/cyland_submit_button.js | 46 ++++++++-- .../ascribe_forms/cyland_form_submit.js | 89 ------------------- 2 files changed, 41 insertions(+), 94 deletions(-) delete mode 100644 js/components/whitelabel/wallet/components/cyland/ascribe_forms/cyland_form_submit.js diff --git a/js/components/whitelabel/wallet/components/cyland/ascribe_buttons/cyland_submit_button.js b/js/components/whitelabel/wallet/components/cyland/ascribe_buttons/cyland_submit_button.js index a19a73c6..2bb35719 100644 --- a/js/components/whitelabel/wallet/components/cyland/ascribe_buttons/cyland_submit_button.js +++ b/js/components/whitelabel/wallet/components/cyland/ascribe_buttons/cyland_submit_button.js @@ -3,16 +3,42 @@ import React from 'react'; import classNames from 'classnames'; +import Moment from 'moment'; + +import WhitelabelActions from '../../../../../../actions/whitelabel_actions'; +import WhitelabelStore from '../../../../../../stores/whitelabel_store'; + import ModalWrapper from '../../../../../ascribe_modal/modal_wrapper'; -import CylandPieceSubmitForm from '../ascribe_forms/cyland_form_submit'; +import LoanForm from '../../../../../ascribe_forms/form_loan'; + +import ApiUrls from '../../../../../../constants/api_urls'; import { getLangText } from '../../../../../../utils/lang_utils'; +import { getAclFormMessage } from '../../../../../../utils/form_utils'; let CylandSubmitButton = React.createClass({ propTypes: { className: React.PropTypes.string, handleSuccess: React.PropTypes.func, - piece: React.PropTypes.object.isRequired + piece: React.PropTypes.object.isRequired, + username: React.PropTypes.string + }, + + getInitialState() { + return WhitelabelStore.getState(); + }, + + componentDidMount() { + WhitelabelStore.listen(this.onChange); + WhitelabelActions.fetchWhitelabel(); + }, + + componentWillUnmount() { + WhitelabelStore.unlisten(this.onChange); + }, + + onChange(state) { + this.setState(state); }, getSubmitButton() { @@ -25,16 +51,26 @@ let CylandSubmitButton = React.createClass({ }, render() { + let today = new Moment(); + let loanEndDate = new Moment(); + loanEndDate.add(1000, 'years'); + return ( - - ); } }); diff --git a/js/components/whitelabel/wallet/components/cyland/ascribe_forms/cyland_form_submit.js b/js/components/whitelabel/wallet/components/cyland/ascribe_forms/cyland_form_submit.js deleted file mode 100644 index bbc5f889..00000000 --- a/js/components/whitelabel/wallet/components/cyland/ascribe_forms/cyland_form_submit.js +++ /dev/null @@ -1,89 +0,0 @@ -'use strict'; - -import React from 'react'; - -import Form from '../../../../../ascribe_forms/form'; -import Property from '../../../../../ascribe_forms/property'; -import InputTextAreaToggable from '../../../../../ascribe_forms/input_textarea_toggable'; -import InputCheckbox from '../../../../../ascribe_forms/input_checkbox'; - -import Alert from 'react-bootstrap/lib/Alert'; - -import AppConstants from '../../../../../../constants/application_constants'; -import ApiUrls from '../../../../../../constants/api_urls'; - -import { getLangText } from '../../../../../../utils/lang_utils.js'; - -import requests from '../../../../../../utils/requests'; - -let CylandPieceSubmitForm = React.createClass({ - propTypes: { - piece: React.PropTypes.object, - handleSuccess: React.PropTypes.func - }, - - render() { - //return ( - //
- //

- // - //

- // } - // spinner={ - //
- // - //
}> - // - // - // - // - // - // - // - // - // - // {' ' + getLangText('I agree to the Terms of Service the art price') + ' '} - // ( - // {getLangText('read')} - // ) - // - // - // - // - //

{getLangText('Are you sure you want to submit to the prize?')}

- //

{getLangText('This is an irrevocable action%s', '.')}

- //
- //
- //); - return null; - } -}); - - -export default CylandPieceSubmitForm;