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

[improve] comment style (#2864)

This commit is contained in:
Michael An
2019-01-22 13:54:08 +08:00
committed by Daniel Pan
parent 963c4f94b5
commit ccc51fa1e4
2 changed files with 4 additions and 23 deletions

View File

@@ -22,7 +22,6 @@ class ReviewComments extends React.Component {
super(props); super(props);
this.state = { this.state = {
commentsList: [], commentsList: [],
userAvatar: '',
inResizing: false, inResizing: false,
commentFooterHeight: 30, commentFooterHeight: 30,
showResolvedComment: true, showResolvedComment: true,
@@ -48,15 +47,6 @@ class ReviewComments extends React.Component {
}); });
} }
getUserAvatar = () => {
seafileAPI.getAccountInfo().then((res) => {
this.accountInfo = res.data;
this.setState({
userAvatar: res.data.avatar_url,
});
});
}
handleCommentChange = (event) => { handleCommentChange = (event) => {
this.setState({ this.setState({
comment: event.target.value, comment: event.target.value,
@@ -140,7 +130,6 @@ class ReviewComments extends React.Component {
} }
componentWillMount() { componentWillMount() {
this.getUserAvatar();
this.listComments(); this.listComments();
} }
@@ -193,9 +182,6 @@ class ReviewComments extends React.Component {
</div> </div>
<div className="seafile-comment-footer" style={{height:this.state.commentFooterHeight+'%'}}> <div className="seafile-comment-footer" style={{height:this.state.commentFooterHeight+'%'}}>
<div className="seafile-comment-row-resize" onMouseDown={this.onResizeMouseDown}></div> <div className="seafile-comment-row-resize" onMouseDown={this.onResizeMouseDown}></div>
<div className="user-header">
<img className="avatar" src={this.state.userAvatar} alt="avatar"/>
</div>
<div className="seafile-add-comment"> <div className="seafile-add-comment">
<textarea className="add-comment-input" value={this.state.comment} <textarea className="add-comment-input" value={this.state.comment}
placeholder={gettext('Add a comment.')} onChange={this.handleCommentChange} placeholder={gettext('Add a comment.')} onChange={this.handleCommentChange}

View File

@@ -39,7 +39,7 @@
} }
.seafile-comment-item { .seafile-comment-item {
overflow-y: hidden; overflow-y: hidden;
padding: 15px 10px; padding: 15px;
} }
.seafile-comment-item-resolved { .seafile-comment-item-resolved {
background-color: #e6ffed; background-color: #e6ffed;
@@ -84,7 +84,7 @@
color: #555; color: #555;
} }
.seafile-comment-item .seafile-comment-content { .seafile-comment-item .seafile-comment-content {
margin: 10px 0 0 42px; margin-top: 10px;
} }
.seafile-comment-item .seafile-comment-content ol, .seafile-comment-item .seafile-comment-content ol,
.seafile-comment-item .seafile-comment-content ul, .seafile-comment-item .seafile-comment-content ul,
@@ -99,7 +99,7 @@
.seafile-comment-item blockquote { .seafile-comment-item blockquote {
word-wrap: break-word; word-wrap: break-word;
overflow: hidden; overflow: hidden;
margin-right: 10px; padding-left: 1rem;
cursor: pointer; cursor: pointer;
} }
.seafile-comment-row-resize { .seafile-comment-row-resize {
@@ -114,7 +114,6 @@
} }
.seafile-comment-footer { .seafile-comment-footer {
background-color: #fafaf9; background-color: #fafaf9;
padding: 10px;
border-top: 1px solid #e5e5e5; border-top: 1px solid #e5e5e5;
min-height: 170px; min-height: 170px;
position: absolute; position: absolute;
@@ -122,12 +121,8 @@
padding-top: 0; padding-top: 0;
width: 100%; width: 100%;
} }
.seafile-comment-footer .user-header {
margin-top: 10px;
position: absolute;
}
.seafile-comment-footer .seafile-add-comment { .seafile-comment-footer .seafile-add-comment {
margin: 10px 10px 5px 40px; margin: 10px 20px 5px 15px;
height: 100%; height: 100%;
} }
.seafile-comment-footer .seafile-add-comment .add-comment-input { .seafile-comment-footer .seafile-add-comment .add-comment-input {