2015-06-15 15:46:33 +02:00
|
|
|
'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';
|
2015-07-09 12:06:09 +02:00
|
|
|
import { getLangText } from '../utils/lang_utils.js';
|
2015-06-15 15:46:33 +02:00
|
|
|
|
|
|
|
let LoginModalHandler = React.createClass({
|
2015-07-09 12:06:09 +02:00
|
|
|
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>
|
|
|
|
);
|
2015-06-15 15:46:33 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export default LoginModalHandler;
|