From 1ea89313ff9876010c62f582e65599b233d7f3e3 Mon Sep 17 00:00:00 2001 From: Brett Sun Date: Wed, 16 Dec 2015 12:43:03 +0100 Subject: [PATCH] Add custom buttons to loan form for Cyland registration --- js/components/ascribe_forms/form_loan.js | 7 ++- .../cyland/cyland_register_piece.js | 51 +++++++++++++++---- .../wallet/cyland/cyland_custom_style.scss | 7 +-- 3 files changed, 50 insertions(+), 15 deletions(-) diff --git a/js/components/ascribe_forms/form_loan.js b/js/components/ascribe_forms/form_loan.js index a204fb87..53a3bb80 100644 --- a/js/components/ascribe_forms/form_loan.js +++ b/js/components/ascribe_forms/form_loan.js @@ -25,6 +25,7 @@ import { mergeOptions } from '../../utils/general_utils'; let LoanForm = React.createClass({ propTypes: { loanHeading: React.PropTypes.string, + buttons: React.PropTypes.element, email: React.PropTypes.string, gallery: React.PropTypes.string, startDate: React.PropTypes.object, @@ -80,7 +81,11 @@ let LoanForm = React.createClass({ }, getButtons() { - if(this.props.loanHeading) { + const { buttons, loanHeading } = this.props; + + if (buttons) { + return buttons; + } else if (loanHeading) { return ( + + +
+ +
+ + ); + setDocumentTitle(getLangText('Register a new piece')); return ( @@ -174,18 +202,18 @@ let CylandRegisterPiece = React.createClass({ pending: 'glyphicon glyphicon-chevron-right', completed: 'glyphicon glyphicon-lock' }} - location={this.props.location}> + location={location}>
0} + disabled={step > 0} enableLocalHashing={false} headerMessage={getLangText('Submit to Cyland Archive')} submitMessage={getLangText('Submit')} isFineUploaderActive={true} handleSuccess={this.handleRegisterSuccess} - location={this.props.location}/> + location={location}/>
@@ -193,9 +221,9 @@ let CylandRegisterPiece = React.createClass({ 1} + disabled={step > 1} handleSuccess={this.handleAdditionalDataSuccess} - piece={this.state.piece} /> + piece={piece} /> @@ -204,15 +232,16 @@ let CylandRegisterPiece = React.createClass({ span { color: $cyland--button-color; -} \ No newline at end of file +}