mirror of
https://github.com/ascribe/onion.git
synced 2025-02-14 21:10:27 +01:00
remove close button from modals
This commit is contained in:
parent
4c88f88d56
commit
1ae77d5157
@ -18,7 +18,6 @@ let ConsignForm = React.createClass({
|
||||
url: React.PropTypes.string,
|
||||
id: React.PropTypes.object,
|
||||
message: React.PropTypes.string,
|
||||
onRequestHide: React.PropTypes.func,
|
||||
handleSuccess: React.PropTypes.func
|
||||
},
|
||||
|
||||
@ -39,11 +38,9 @@ let ConsignForm = React.createClass({
|
||||
<p className="pull-right">
|
||||
<Button
|
||||
className="btn btn-default btn-sm ascribe-margin-1px"
|
||||
type="submit">{getLangText('CONSIGN')}</Button>
|
||||
<Button
|
||||
className="btn btn-danger btn-delete btn-sm ascribe-margin-1px"
|
||||
style={{marginLeft: '0'}}
|
||||
onClick={this.props.onRequestHide}>{getLangText('CLOSE')}</Button>
|
||||
type="submit">
|
||||
{getLangText('CONSIGN')}
|
||||
</Button>
|
||||
</p>
|
||||
</div>}
|
||||
spinner={
|
||||
|
@ -24,9 +24,12 @@ let EditionDeleteForm = React.createClass({
|
||||
<p>{getLangText('Are you sure you would like to permanently delete this edition')}?</p>
|
||||
<p>{getLangText('This is an irrevocable action%s', '.')}</p>
|
||||
<div className="modal-footer">
|
||||
<button type="submit" className="btn btn-danger btn-delete btn-sm ascribe-margin-1px" onClick={this.submit}>{getLangText('YES, DELETE')}</button>
|
||||
<button className="btn btn-default btn-sm ascribe-margin-1px" style={{marginLeft: '0'}}
|
||||
onClick={this.props.onRequestHide}>{getLangText('CLOSE')}</button>
|
||||
<button
|
||||
type="submit"
|
||||
className="btn btn-danger btn-delete btn-sm ascribe-margin-1px"
|
||||
onClick={this.submit}>
|
||||
{getLangText('YES, DELETE')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
@ -28,9 +28,12 @@ let PieceDeleteForm = React.createClass({
|
||||
<p>{getLangText('Are you sure you would like to permanently delete this piece')}?</p>
|
||||
<p>{getLangText('This is an irrevocable action%s', '.')}</p>
|
||||
<div className="modal-footer">
|
||||
<button type="submit" className="btn btn-danger btn-delete btn-sm ascribe-margin-1px" onClick={this.submit}>{getLangText('YES, DELETE')}</button>
|
||||
<button className="btn btn-default btn-sm ascribe-margin-1px" style={{marginLeft: '0'}}
|
||||
onClick={this.props.onRequestHide}>{getLangText('CLOSE')}</button>
|
||||
<button
|
||||
type="submit"
|
||||
className="btn btn-danger btn-delete btn-sm ascribe-margin-1px"
|
||||
onClick={this.submit}>
|
||||
{getLangText('YES, DELETE')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
@ -23,7 +23,6 @@ let LoanForm = React.createClass({
|
||||
url: React.PropTypes.string,
|
||||
id: React.PropTypes.object,
|
||||
message: React.PropTypes.string,
|
||||
onRequestHide: React.PropTypes.func,
|
||||
handleSuccess: React.PropTypes.func
|
||||
},
|
||||
|
||||
@ -101,11 +100,9 @@ let LoanForm = React.createClass({
|
||||
<p className="pull-right">
|
||||
<Button
|
||||
className="btn btn-default btn-sm ascribe-margin-1px"
|
||||
type="submit">{getLangText('LOAN')}</Button>
|
||||
<Button
|
||||
className="btn btn-danger btn-delete btn-sm ascribe-margin-1px"
|
||||
style={{marginLeft: '0'}}
|
||||
onClick={this.props.onRequestHide}>{getLangText('CLOSE')}</Button>
|
||||
type="submit">
|
||||
{getLangText('LOAN')}
|
||||
</Button>
|
||||
</p>
|
||||
</div>}
|
||||
spinner={
|
||||
|
@ -25,9 +25,9 @@ let EditionRemoveFromCollectionForm = React.createClass({
|
||||
<p>{getLangText('Are you sure you would like to remove these editions from your collection')}?</p>
|
||||
<p>{getLangText('This is an irrevocable action%s', '.')}</p>
|
||||
<div className="modal-footer">
|
||||
<button type="submit" className="btn btn-danger btn-delete btn-sm ascribe-margin-1px" onClick={this.submit}>{getLangText('YES, REMOVE')}</button>
|
||||
<button className="btn btn-default btn-sm ascribe-margin-1px" style={{marginLeft: '0'}}
|
||||
onClick={this.props.onRequestHide}>{getLangText('CLOSE')}</button>
|
||||
<button type="submit" className="btn btn-danger btn-delete btn-sm ascribe-margin-1px" onClick={this.submit}>
|
||||
{getLangText('YES, REMOVE')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
@ -2,8 +2,6 @@
|
||||
|
||||
import React from 'react';
|
||||
|
||||
|
||||
|
||||
import Form from './form';
|
||||
import Property from './property';
|
||||
import InputTextAreaToggable from './input_textarea_toggable';
|
||||
@ -20,7 +18,6 @@ let ShareForm = React.createClass({
|
||||
message: React.PropTypes.string,
|
||||
editions: React.PropTypes.array,
|
||||
currentUser: React.PropTypes.object,
|
||||
onRequestHide: React.PropTypes.func,
|
||||
handleSuccess: React.PropTypes.func
|
||||
},
|
||||
|
||||
@ -41,11 +38,9 @@ let ShareForm = React.createClass({
|
||||
<p className="pull-right">
|
||||
<Button
|
||||
className="btn btn-default btn-sm ascribe-margin-1px"
|
||||
type="submit">SHARE</Button>
|
||||
<Button
|
||||
className="btn btn-danger btn-delete btn-sm ascribe-margin-1px"
|
||||
style={{marginLeft: '0'}}
|
||||
onClick={this.props.onRequestHide}>CLOSE</Button>
|
||||
type="submit">
|
||||
SHARE
|
||||
</Button>
|
||||
</p>
|
||||
</div>}
|
||||
spinner={
|
||||
|
@ -19,10 +19,7 @@ import requests from '../../utils/requests';
|
||||
let PieceSubmitToPrizeForm = React.createClass({
|
||||
propTypes: {
|
||||
piece: React.PropTypes.object,
|
||||
handleSuccess: React.PropTypes.func,
|
||||
|
||||
// this is set by ModalWrapper automatically
|
||||
onRequestHide: React.PropTypes.func
|
||||
handleSuccess: React.PropTypes.func
|
||||
},
|
||||
|
||||
render() {
|
||||
@ -36,7 +33,9 @@ let PieceSubmitToPrizeForm = React.createClass({
|
||||
<p className="pull-right">
|
||||
<button
|
||||
className="btn btn-default btn-sm ascribe-margin-1px"
|
||||
type="submit">{getLangText('SUBMIT TO PRIZE')}</button>
|
||||
type="submit">
|
||||
{getLangText('SUBMIT TO PRIZE')}
|
||||
</button>
|
||||
</p>
|
||||
</div>}
|
||||
spinner={
|
||||
@ -80,7 +79,6 @@ let PieceSubmitToPrizeForm = React.createClass({
|
||||
<p>{getLangText('Are you sure you want to submit to the prize?')}</p>
|
||||
<p>{getLangText('This is an irrevocable action%s', '.')}</p>
|
||||
</Alert>
|
||||
|
||||
</Form>
|
||||
);
|
||||
}
|
||||
|
@ -21,7 +21,6 @@ let TransferForm = React.createClass({
|
||||
message: React.PropTypes.string,
|
||||
editions: React.PropTypes.array,
|
||||
currentUser: React.PropTypes.object,
|
||||
onRequestHide: React.PropTypes.func,
|
||||
handleSuccess: React.PropTypes.func
|
||||
},
|
||||
|
||||
@ -42,11 +41,9 @@ let TransferForm = React.createClass({
|
||||
<p className="pull-right">
|
||||
<Button
|
||||
className="btn btn-default btn-sm ascribe-margin-1px"
|
||||
type="submit">{getLangText('TRANSFER')}</Button>
|
||||
<Button
|
||||
className="btn btn-danger btn-delete btn-sm ascribe-margin-1px"
|
||||
style={{marginLeft: '0'}}
|
||||
onClick={this.props.onRequestHide}>{getLangText('CLOSE')}</Button>
|
||||
type="submit">
|
||||
{getLangText('TRANSFER')}
|
||||
</Button>
|
||||
</p>
|
||||
</div>}
|
||||
spinner={
|
||||
|
@ -18,7 +18,6 @@ let UnConsignForm = React.createClass({
|
||||
id: React.PropTypes.object,
|
||||
message: React.PropTypes.string,
|
||||
editions: React.PropTypes.array,
|
||||
onRequestHide: React.PropTypes.func,
|
||||
handleSuccess: React.PropTypes.func
|
||||
},
|
||||
|
||||
@ -39,11 +38,9 @@ let UnConsignForm = React.createClass({
|
||||
<p className="pull-right">
|
||||
<Button
|
||||
className="btn btn-default btn-sm ascribe-margin-1px"
|
||||
type="submit">{getLangText('UNCONSIGN')}</Button>
|
||||
<Button
|
||||
className="btn btn-danger btn-delete btn-sm ascribe-margin-1px"
|
||||
style={{marginLeft: '0'}}
|
||||
onClick={this.props.onRequestHide}>{getLangText('CLOSE')}</Button>
|
||||
type="submit">
|
||||
{getLangText('UNCONSIGN')}
|
||||
</Button>
|
||||
</p>
|
||||
</div>}
|
||||
spinner={
|
||||
|
@ -19,7 +19,6 @@ let UnConsignRequestForm = React.createClass({
|
||||
url: React.PropTypes.string,
|
||||
id: React.PropTypes.object,
|
||||
message: React.PropTypes.string,
|
||||
onRequestHide: React.PropTypes.func,
|
||||
handleSuccess: React.PropTypes.func
|
||||
},
|
||||
|
||||
@ -40,11 +39,9 @@ let UnConsignRequestForm = React.createClass({
|
||||
<p className="pull-right">
|
||||
<Button
|
||||
className="btn btn-default btn-sm ascribe-margin-1px"
|
||||
type="submit">{getLangText('REQUEST UNCONSIGN')}</Button>
|
||||
<Button
|
||||
className="btn btn-danger btn-delete btn-sm ascribe-margin-1px"
|
||||
style={{marginLeft: '0'}}
|
||||
onClick={this.props.onRequestHide}>{getLangText('CLOSE')}</Button>
|
||||
type="submit">
|
||||
{getLangText('REQUEST UNCONSIGN')}
|
||||
</Button>
|
||||
</p>
|
||||
</div>}
|
||||
spinner={
|
||||
|
@ -46,13 +46,14 @@ let ModalWrapper = React.createClass({
|
||||
renderChildren() {
|
||||
return ReactAddons.Children.map(this.props.children, (child) => {
|
||||
return ReactAddons.addons.cloneWithProps(child, {
|
||||
onRequestHide: this.hide,
|
||||
handleSuccess: this.handleSuccess
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
render() {
|
||||
// this adds the onClick method show of modal_wrapper to the trigger component
|
||||
// which is in most cases a button.
|
||||
let trigger = React.cloneElement(this.props.trigger, {onClick: this.show});
|
||||
|
||||
return (
|
||||
|
@ -1,43 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import Button from 'react-bootstrap/lib/Button';
|
||||
import Modal from 'react-bootstrap/lib/Modal';
|
||||
import OverlayMixin from 'react-bootstrap/lib/OverlayMixin';
|
||||
import { getLangText } from '../utils/lang_utils.js';
|
||||
|
||||
let LoginModalHandler = React.createClass({
|
||||
mixins: [OverlayMixin],
|
||||
|
||||
getInitialState() {
|
||||
return {
|
||||
isModalOpen: true
|
||||
};
|
||||
},
|
||||
|
||||
handleToggle() {
|
||||
this.setState({
|
||||
isModalOpen: !this.state.isModalOpen
|
||||
});
|
||||
},
|
||||
|
||||
render() {
|
||||
if(!this.state.isModalOpen || !(this.props.query.login === '')) {
|
||||
return <span/>;
|
||||
}
|
||||
|
||||
return (
|
||||
<Modal title='Modal heading' onRequestHide={this.handleToggle}>
|
||||
<div className='modal-body'>
|
||||
This modal is controlled by our custom trigger component.
|
||||
</div>
|
||||
<div className='modal-footer'>
|
||||
<Button onClick={this.handleToggle}>{getLangText('Close')}</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
export default LoginModalHandler;
|
Loading…
Reference in New Issue
Block a user