mirror of
https://github.com/zoriya/flood.git
synced 2025-12-20 06:05:15 +00:00
Rearrange app directory structure
This commit is contained in:
42
client/source/scripts/components/modals/Modals.js
Normal file
42
client/source/scripts/components/modals/Modals.js
Normal file
@@ -0,0 +1,42 @@
|
||||
import React from 'react';
|
||||
|
||||
import AddTorrent from './AddTorrent';
|
||||
import Icon from '../icons/Icon';
|
||||
import UIActions from '../../actions/UIActions';
|
||||
|
||||
export default class Modal extends React.Component {
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
handleModalClick(event) {
|
||||
event.stopPropagation();
|
||||
}
|
||||
|
||||
handleOverlayClick() {
|
||||
UIActions.dismissModals();
|
||||
}
|
||||
|
||||
render() {
|
||||
let modal = null;
|
||||
|
||||
switch (this.props.type) {
|
||||
case 'torrent-add':
|
||||
modal = <AddTorrent clickHandler={this._onModalClick} />;
|
||||
break;
|
||||
}
|
||||
|
||||
if (modal) {
|
||||
return (
|
||||
<div className="modal" onClick={this._onOverlayClick}>
|
||||
{modal}
|
||||
</div>
|
||||
);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user