Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

Commit d53defa

Browse files
author
soliury
committed
some refactor
1 parent c206316 commit d53defa

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

app/components/comment/CommentUp.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ class CommentUp extends Component {
2525

2626

2727
_onUpPress() {
28+
if (this.props.user.loginname == this.props.authorName) {
29+
return window.alert('不能给自己点赞哦!')
30+
}
2831
if (this.state.isLoading) return
2932

3033
this.setState({

app/components/htmlRender/HtmlContent.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,11 @@ class HtmlContent extends Component {
9090
uri = 'https:' + uri
9191
}
9292
return (
93-
<View
93+
<Image
9494
key={index}
95-
style={styles.imgWrapper}>
96-
<Image source={{uri:uri}}
97-
style={styles.img}>
98-
</Image>
99-
</View>
95+
source={{uri:uri}}
96+
style={styles.img}>
97+
</Image>
10098
)
10199
}
102100
}

app/containers/Comments.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,6 @@ class Comments extends Component {
241241
}
242242

243243

244-
_onUpPress() {
245-
246-
}
247-
248-
249244
_onCommentTitlePress() {
250245
this._listView.setNativeProps({
251246
contentOffset: {
@@ -275,6 +270,7 @@ class Comments extends Component {
275270
<View style={styles.commentFooter}>
276271
<CommentUp
277272
replyId={comment.id}
273+
authorName={authorName}
278274
ups={comment.ups}
279275
user={this.props.state.user}
280276
style={styles.up}

0 commit comments

Comments
 (0)