1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 09:35:10 +01:00
onion/js/components/ascribe_modal/modal_share.js

47 lines
1.5 KiB
JavaScript
Raw Normal View History

2015-05-27 09:34:49 +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-05-28 18:18:13 +02:00
import ShareForm from '../ascribe_forms/form_share_email'
2015-05-27 09:34:49 +02:00
let ShareModalButton = React.createClass({
render() {
return (
<OverlayTrigger delay={500} placement="left" overlay={<Tooltip>Share the artwork</Tooltip>}>
<ModalTrigger modal={<ShareModal edition={this.props.edition}
currentUser={this.props.currentUser}/>}>
2015-05-27 09:34:49 +02:00
<div className="btn btn-ascribe-inv btn-glyph-ascribe">
<span className="glyph-ascribe-share2"></span>
</div>
</ModalTrigger>
</OverlayTrigger>
)
}
});
let ShareModal = React.createClass({
2015-05-28 10:16:58 +02:00
onRequestHide(e){
if (e)
e.preventDefault();
2015-05-28 10:16:58 +02:00
this.props.onRequestHide();
},
2015-05-27 09:34:49 +02:00
render() {
return (
<Modal {...this.props} title="Share artwork">
<div className="modal-body">
2015-05-27 15:53:26 +02:00
<ShareForm edition={this.props.edition}
2015-05-28 18:18:13 +02:00
currentUser={this.props.currentUser}
onRequestHide={this.onRequestHide}/>
2015-05-27 09:34:49 +02:00
</div>
</Modal>
2015-05-27 15:53:26 +02:00
)
}
});
2015-05-28 10:16:58 +02:00
2015-05-27 17:55:09 +02:00
export default ShareModalButton;