43 lines
1.1 KiB
JavaScript
Executable file
43 lines
1.1 KiB
JavaScript
Executable file
import React from 'react';
|
|
import classNames from 'classnames';
|
|
import Scroller from './common/Scroller';
|
|
import '../styles/markdown_modal.styl';
|
|
|
|
const MarkdownModal = React.createClass({
|
|
getDefaultProps() {
|
|
return {
|
|
selectable: false,
|
|
};
|
|
},
|
|
|
|
getScrollerNode() {
|
|
return this.refs['scroller'].getScrollerNode();
|
|
},
|
|
|
|
render() {
|
|
const {renderFooter, selectable, renderHeader, className, onClose, children} = this.props;
|
|
let footer;
|
|
if (renderFooter) {
|
|
footer = <div className="markdown-modal-footer">{renderFooter()}</div>;
|
|
}
|
|
return (
|
|
<div className={classNames('markdown-modal', {selectable}, className)}>
|
|
<div className="markdown-modal-header">
|
|
{renderHeader()}
|
|
<button className="markdown-modal-close" onClick={onClose} />
|
|
</div>
|
|
<Scroller ref="scroller" fade={true} onScroll={this.props.onScroll}>
|
|
{children}
|
|
</Scroller>
|
|
{footer}
|
|
</div>
|
|
);
|
|
},
|
|
});
|
|
|
|
export default MarkdownModal;
|
|
|
|
|
|
|
|
// WEBPACK FOOTER //
|
|
// ./discord_app/components/MarkdownModal.js
|