2015-06-05 11:06:36 +02:00
|
|
|
'use strict';
|
|
|
|
|
2015-05-29 16:53:30 +02:00
|
|
|
import React from 'react';
|
|
|
|
import Modal from 'react-bootstrap/lib/Modal';
|
|
|
|
import OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger';
|
|
|
|
import ModalTrigger from 'react-bootstrap/lib/ModalTrigger';
|
|
|
|
import Tooltip from 'react-bootstrap/lib/Tooltip';
|
|
|
|
|
2015-06-05 11:06:36 +02:00
|
|
|
import LoanForm from '../ascribe_forms/form_loan';
|
|
|
|
import ModalMixin from '../../mixins/modal_mixin';
|
2015-05-29 16:53:30 +02:00
|
|
|
|
2015-06-01 13:02:53 +02:00
|
|
|
let LoanModalButton = React.createClass({
|
2015-05-29 16:53:30 +02:00
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<OverlayTrigger delay={500} placement="left"
|
2015-06-01 13:02:53 +02:00
|
|
|
overlay={<Tooltip>Loan your artwork for a limited period of time</Tooltip>}>
|
|
|
|
<ModalTrigger modal={<LoanModal edition={this.props.edition}
|
|
|
|
currentUser={this.props.currentUser}/>}>
|
2015-05-29 16:53:30 +02:00
|
|
|
<div className="btn btn-ascribe-inv">
|
2015-06-01 13:02:53 +02:00
|
|
|
LOAN
|
2015-05-29 16:53:30 +02:00
|
|
|
</div>
|
|
|
|
</ModalTrigger>
|
|
|
|
</OverlayTrigger>
|
2015-06-05 11:06:36 +02:00
|
|
|
);
|
2015-05-29 16:53:30 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2015-06-01 13:02:53 +02:00
|
|
|
let LoanModal = React.createClass({
|
2015-06-05 11:06:36 +02:00
|
|
|
mixins: [ModalMixin],
|
2015-05-29 16:53:30 +02:00
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
2015-06-01 13:02:53 +02:00
|
|
|
<Modal {...this.props} title="Loan artwork">
|
2015-05-29 16:53:30 +02:00
|
|
|
<div className="modal-body">
|
2015-06-01 13:02:53 +02:00
|
|
|
<LoanForm edition={this.props.edition}
|
|
|
|
currentUser={this.props.currentUser}
|
|
|
|
onRequestHide={this.onRequestHide}/>
|
2015-05-29 16:53:30 +02:00
|
|
|
</div>
|
|
|
|
</Modal>
|
2015-06-05 11:06:36 +02:00
|
|
|
);
|
2015-05-29 16:53:30 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
|
2015-06-01 13:02:53 +02:00
|
|
|
export default LoanModalButton;
|