From 4b17225783b1fd4383213225e3c474e324294228 Mon Sep 17 00:00:00 2001 From: Brett Sun Date: Fri, 4 Dec 2015 13:32:29 +0100 Subject: [PATCH] Fix padding in InputContractAgreementCheckbox --- js/components/ascribe_forms/form_consign.js | 3 ++- js/components/ascribe_forms/form_loan.js | 3 ++- .../input_contract_agreement_checkbox.js | 12 +++++++----- js/components/ascribe_forms/property.js | 15 ++++++++++----- 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/js/components/ascribe_forms/form_consign.js b/js/components/ascribe_forms/form_consign.js index c4942f30..a7c8f016 100644 --- a/js/components/ascribe_forms/form_consign.js +++ b/js/components/ascribe_forms/form_consign.js @@ -115,7 +115,8 @@ let ConsignForm = React.createClass({ + className="ascribe-property-collapsible-toggle" + style={{paddingBottom: 0}}> diff --git a/js/components/ascribe_forms/form_loan.js b/js/components/ascribe_forms/form_loan.js index b8370016..eb709714 100644 --- a/js/components/ascribe_forms/form_loan.js +++ b/js/components/ascribe_forms/form_loan.js @@ -197,7 +197,8 @@ let LoanForm = React.createClass({ + className="ascribe-property-collapsible-toggle" + style={{paddingBottom: 0}}> diff --git a/js/components/ascribe_forms/input_contract_agreement_checkbox.js b/js/components/ascribe_forms/input_contract_agreement_checkbox.js index b5a2167a..c609786e 100644 --- a/js/components/ascribe_forms/input_contract_agreement_checkbox.js +++ b/js/components/ascribe_forms/input_contract_agreement_checkbox.js @@ -16,7 +16,7 @@ const InputContractAgreementCheckbox = React.createClass({ propTypes: { createPublicContractAgreement: React.PropTypes.bool, email: React.PropTypes.string, - + required: React.PropTypes.bool, // provided by Property @@ -69,7 +69,7 @@ const InputContractAgreementCheckbox = React.createClass({ }, onStoreChange(state) { - const contractAgreement = this.getContractAgreement(state.contractAgreementList); + const contractAgreement = this.getContractAgreement(state.contractAgreementList); this.props.setExpanded(!!contractAgreement); state = mergeOptions(state, { @@ -92,7 +92,7 @@ const InputContractAgreementCheckbox = React.createClass({ terms: !contractAgreement || !!contractAgreement.datetime_accepted } }); - + this.setState(state); }, @@ -149,7 +149,9 @@ const InputContractAgreementCheckbox = React.createClass({ if(datetimeAccepted) { return ( -
+
{this.props.footer} -
); +
+ ); } - style.paddingBottom = !this.state.expanded ? 0 : null; - style.cursor = !this.props.editable ? 'not-allowed' : null; + if (!this.state.expanded) { + style.paddingBottom = 0; + } + if (!this.props.editable) { + style.cursor = 'not-allowed'; + } return (