Minor refactoring for better maintainibility
Этот коммит содержится в:
@@ -3,9 +3,19 @@
|
|||||||
|
|
||||||
module.exports = React.createClass({
|
module.exports = React.createClass({
|
||||||
displayName: 'FileUploadOverlay',
|
displayName: 'FileUploadOverlay',
|
||||||
|
propTypes: {
|
||||||
|
overlayType: React.PropTypes.string
|
||||||
|
},
|
||||||
render: function() {
|
render: function() {
|
||||||
|
var overlayClass = 'file-overlay invisible';
|
||||||
|
if (this.props.overlayType === 'right') {
|
||||||
|
overlayClass += ' right-file-overlay';
|
||||||
|
} else if (this.props.overlayType === 'center') {
|
||||||
|
overlayClass += ' center-file-overlay';
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='file-overlay center-file-overlay invisible'>
|
<div className={overlayClass}>
|
||||||
<div>
|
<div>
|
||||||
<i className='fa fa-upload'></i>
|
<i className='fa fa-upload'></i>
|
||||||
<span>Drop a file to upload it.</span>
|
<span>Drop a file to upload it.</span>
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ var SearchBox =require('./search_bar.jsx');
|
|||||||
var CreateComment = require( './create_comment.jsx' );
|
var CreateComment = require( './create_comment.jsx' );
|
||||||
var Constants = require('../utils/constants.jsx');
|
var Constants = require('../utils/constants.jsx');
|
||||||
var FileAttachmentList = require('./file_attachment_list.jsx');
|
var FileAttachmentList = require('./file_attachment_list.jsx');
|
||||||
|
var FileUploadOverlay = require('./file_upload_overlay.jsx');
|
||||||
var ActionTypes = Constants.ActionTypes;
|
var ActionTypes = Constants.ActionTypes;
|
||||||
|
|
||||||
RhsHeaderPost = React.createClass({
|
RhsHeaderPost = React.createClass({
|
||||||
@@ -296,12 +297,8 @@ module.exports = React.createClass({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="post-right__container">
|
<div className="post-right__container">
|
||||||
<div className='file-overlay right-file-overlay invisible'>
|
<FileUploadOverlay
|
||||||
<div>
|
overlayType='right' />
|
||||||
<i className="fa fa-upload"></i>
|
|
||||||
<span>Drop a file to upload it.</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="search-bar__container sidebar--right__search-header">{searchForm}</div>
|
<div className="search-bar__container sidebar--right__search-header">{searchForm}</div>
|
||||||
<div className="sidebar-right__body">
|
<div className="sidebar-right__body">
|
||||||
<RhsHeaderPost fromSearch={this.props.fromSearch} isMentionSearch={this.props.isMentionSearch} />
|
<RhsHeaderPost fromSearch={this.props.fromSearch} isMentionSearch={this.props.isMentionSearch} />
|
||||||
|
|||||||
@@ -225,7 +225,8 @@ global.window.setup_channel_page = function(team_name, team_type, team_id, chann
|
|||||||
);
|
);
|
||||||
|
|
||||||
React.render(
|
React.render(
|
||||||
<FileUploadOverlay />,
|
<FileUploadOverlay
|
||||||
|
overlayType='center' />,
|
||||||
document.getElementById('file_upload_overlay')
|
document.getElementById('file_upload_overlay')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user