1
0
mirror of https://github.com/ascribe/onion.git synced 2025-01-03 10:25:08 +01:00

Fix padding in InputContractAgreementCheckbox

This commit is contained in:
Brett Sun 2015-12-04 13:32:29 +01:00
parent 510318c319
commit 4b17225783
4 changed files with 21 additions and 12 deletions

View File

@ -115,7 +115,8 @@ let ConsignForm = React.createClass({
<Property <Property
name='contract_agreement' name='contract_agreement'
label={getLangText('Consign Contract')} label={getLangText('Consign Contract')}
className="ascribe-property-collapsible-toggle"> className="ascribe-property-collapsible-toggle"
style={{paddingBottom: 0}}>
<InputContractAgreementCheckbox <InputContractAgreementCheckbox
createPublicContractAgreement={createPublicContractAgreement} createPublicContractAgreement={createPublicContractAgreement}
email={email} /> email={email} />

View File

@ -197,7 +197,8 @@ let LoanForm = React.createClass({
<Property <Property
name='contract_agreement' name='contract_agreement'
label={getLangText('Loan Contract')} label={getLangText('Loan Contract')}
className="ascribe-property-collapsible-toggle"> className="ascribe-property-collapsible-toggle"
style={{paddingBottom: 0}}>
<InputContractAgreementCheckbox <InputContractAgreementCheckbox
createPublicContractAgreement={createPublicContractAgreement} createPublicContractAgreement={createPublicContractAgreement}
email={email} /> email={email} />

View File

@ -16,7 +16,7 @@ const InputContractAgreementCheckbox = React.createClass({
propTypes: { propTypes: {
createPublicContractAgreement: React.PropTypes.bool, createPublicContractAgreement: React.PropTypes.bool,
email: React.PropTypes.string, email: React.PropTypes.string,
required: React.PropTypes.bool, required: React.PropTypes.bool,
// provided by Property // provided by Property
@ -69,7 +69,7 @@ const InputContractAgreementCheckbox = React.createClass({
}, },
onStoreChange(state) { onStoreChange(state) {
const contractAgreement = this.getContractAgreement(state.contractAgreementList); const contractAgreement = this.getContractAgreement(state.contractAgreementList);
this.props.setExpanded(!!contractAgreement); this.props.setExpanded(!!contractAgreement);
state = mergeOptions(state, { state = mergeOptions(state, {
@ -92,7 +92,7 @@ const InputContractAgreementCheckbox = React.createClass({
terms: !contractAgreement || !!contractAgreement.datetime_accepted terms: !contractAgreement || !!contractAgreement.datetime_accepted
} }
}); });
this.setState(state); this.setState(state);
}, },
@ -149,7 +149,9 @@ const InputContractAgreementCheckbox = React.createClass({
if(datetimeAccepted) { if(datetimeAccepted) {
return ( return (
<div className="notification-contract-pdf"> <div
className="notification-contract-pdf"
style={{paddingBottom: '1em'}}>
<embed <embed
className="embed-form" className="embed-form"
src={contractUrl} src={contractUrl}
@ -196,4 +198,4 @@ const InputContractAgreementCheckbox = React.createClass({
} }
}); });
export default InputContractAgreementCheckbox; export default InputContractAgreementCheckbox;

View File

@ -307,17 +307,22 @@ const Property = React.createClass({
render() { render() {
let footer = null; let footer = null;
let style = this.props.style ? mergeOptions({}, this.props.style) : {}; let style = Object.assign({}, this.props.style);
if(this.props.footer){ if(this.props.footer){
footer = ( footer = (
<div className="ascribe-property-footer"> <div className="ascribe-property-footer">
{this.props.footer} {this.props.footer}
</div>); </div>
);
} }
style.paddingBottom = !this.state.expanded ? 0 : null; if (!this.state.expanded) {
style.cursor = !this.props.editable ? 'not-allowed' : null; style.paddingBottom = 0;
}
if (!this.props.editable) {
style.cursor = 'not-allowed';
}
return ( return (
<div <div
@ -340,4 +345,4 @@ const Property = React.createClass({
} }
}); });
export default Property; export default Property;