1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-12 13:24:52 +00:00

fix-comment-dialog-username

This commit is contained in:
Michael18811380328
2018-12-26 13:54:54 +08:00
parent b21f10d61d
commit b6981bb7aa

View File

@@ -2,7 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Button } from 'reactstrap'; import { Button } from 'reactstrap';
import { seafileAPI } from '../../utils/seafile-api'; import { seafileAPI } from '../../utils/seafile-api';
import { reviewID, gettext } from '../../utils/constants'; import { reviewID, gettext, name } from '../../utils/constants';
import { processor } from '../../utils/seafile-markdown2html'; import { processor } from '../../utils/seafile-markdown2html';
import '../../css/review-comment-dialog.css'; import '../../css/review-comment-dialog.css';
@@ -21,7 +21,6 @@ class ReviewCommentDialog extends React.Component {
super(props); super(props);
this.state = { this.state = {
comment: '', comment: '',
userName: '',
quote: '', quote: '',
}; };
} }
@@ -33,14 +32,6 @@ class ReviewCommentDialog extends React.Component {
}); });
} }
getUserName = () => {
seafileAPI.getAccountInfo().then((res) => {
this.setState({
userName: res.data.name
});
});
}
submitComment = () => { submitComment = () => {
let comment = this.state.comment.trim(); let comment = this.state.comment.trim();
if (comment.length > 0) { if (comment.length > 0) {
@@ -77,10 +68,6 @@ class ReviewCommentDialog extends React.Component {
); );
} }
componentWillMount() {
this.getUserName();
}
componentDidMount() { componentDidMount() {
this.setQuoteText(this.props.quote); this.setQuoteText(this.props.quote);
} }
@@ -94,7 +81,7 @@ class ReviewCommentDialog extends React.Component {
render() { render() {
return ( return (
<div className="review-comment-dialog"> <div className="review-comment-dialog">
<div>{this.state.userName}</div> <div>{name}</div>
<blockquote className="review-comment-dialog-quote"> <blockquote className="review-comment-dialog-quote">
<div dangerouslySetInnerHTML={{ __html: this.state.quote}}></div> <div dangerouslySetInnerHTML={{ __html: this.state.quote}}></div>
</blockquote> </blockquote>