1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-07-11 14:13:56 +00:00

[add] draft modalPortal (#3009)

This commit is contained in:
Michael An 2019-02-28 07:57:47 +08:00 committed by Daniel Pan
parent e2ad2fd023
commit 4b45da628d

View File

@ -23,6 +23,7 @@ import { Nav, NavItem, NavLink, TabContent, TabPane } from 'reactstrap';
import classnames from 'classnames'; import classnames from 'classnames';
import HistoryList from './pages/review/history-list'; import HistoryList from './pages/review/history-list';
import { Value, Document, Block } from 'slate'; import { Value, Document, Block } from 'slate';
import ModalPortal from './components/modal-portal';
import './assets/css/fa-solid.css'; import './assets/css/fa-solid.css';
import './assets/css/fa-regular.css'; import './assets/css/fa-regular.css';
@ -58,6 +59,7 @@ class DraftReview extends React.Component {
isShowCommentDialog: false, isShowCommentDialog: false,
activeItem: null, activeItem: null,
originRepoName: '', originRepoName: '',
showDraftReviewDialog: false,
}; };
this.quote = ''; this.quote = '';
this.newIndex = null; this.newIndex = null;
@ -313,7 +315,8 @@ class DraftReview extends React.Component {
this.listReviewers(); this.listReviewers();
} }
this.setState({ this.setState({
showReviewerDialog: !this.state.showReviewerDialog showReviewerDialog: !this.state.showReviewerDialog,
showDraftReviewDialog: !this.state.showDraftReviewDialog,
}); });
} }
@ -920,22 +923,30 @@ class DraftReview extends React.Component {
</div> </div>
</div> </div>
</div> </div>
{ this.state.showReviewerDialog && {this.state.showDraftReviewDialog &&
<AddReviewerDialog <React.Fragment>
showReviewerDialog={this.state.showReviewerDialog} {this.state.showReviewerDialog &&
toggleAddReviewerDialog={this.toggleAddReviewerDialog} <ModalPortal>
reviewID={reviewID} <AddReviewerDialog
reviewers={this.state.reviewers} showReviewerDialog={this.state.showReviewerDialog}
/> toggleAddReviewerDialog={this.toggleAddReviewerDialog}
reviewID={reviewID}
reviewers={this.state.reviewers}
/>
</ModalPortal>
}
</React.Fragment>
} }
{this.state.isShowCommentDialog && {this.state.isShowCommentDialog &&
<ReviewCommentDialog <ModalPortal>
toggleCommentDialog={this.toggleCommentDialog} <ReviewCommentDialog
onCommentAdded={this.onCommentAdded} toggleCommentDialog={this.toggleCommentDialog}
quote={this.quote} onCommentAdded={this.onCommentAdded}
newIndex={this.newIndex} quote={this.quote}
oldIndex={this.oldIndex} newIndex={this.newIndex}
/> oldIndex={this.oldIndex}
/>
</ModalPortal>
} }
</div> </div>
); );