forked from nutomic/lemmy
Change action sizes. Add better tippy updating.
This commit is contained in:
parent
ae9242a5c3
commit
6da1e1b931
2 changed files with 25 additions and 6 deletions
13
ui/src/components/comment-node.tsx
vendored
13
ui/src/components/comment-node.tsx
vendored
|
@ -103,9 +103,17 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
|
||||||
this.handleCommentDownvote = this.handleCommentDownvote.bind(this);
|
this.handleCommentDownvote = this.handleCommentDownvote.bind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate() {
|
componentDidUpdate(prevProps: CommentNodeProps) {
|
||||||
|
let prevComment = prevProps.node.comment;
|
||||||
|
let comment = this.props.node.comment;
|
||||||
|
if (
|
||||||
|
prevComment.saved !== comment.saved ||
|
||||||
|
prevComment.deleted !== comment.deleted ||
|
||||||
|
prevComment.read !== comment.read
|
||||||
|
) {
|
||||||
setupTippy();
|
setupTippy();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
componentWillReceiveProps(nextProps: CommentNodeProps) {
|
componentWillReceiveProps(nextProps: CommentNodeProps) {
|
||||||
this.state.my_vote = nextProps.node.comment.my_vote;
|
this.state.my_vote = nextProps.node.comment.my_vote;
|
||||||
|
@ -256,7 +264,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
|
||||||
dangerouslySetInnerHTML={mdToHtml(this.commentUnlessRemoved)}
|
dangerouslySetInnerHTML={mdToHtml(this.commentUnlessRemoved)}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<ul class="list-inline mb-1 text-muted font-weight-bold h6">
|
<ul class="list-inline mb-1 text-muted font-weight-bold h5">
|
||||||
{this.props.markable && (
|
{this.props.markable && (
|
||||||
<li className="list-inline-item-action">
|
<li className="list-inline-item-action">
|
||||||
<span
|
<span
|
||||||
|
@ -1110,5 +1118,6 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
|
||||||
handleShowAdvanced(i: CommentNode) {
|
handleShowAdvanced(i: CommentNode) {
|
||||||
i.state.showAdvanced = !i.state.showAdvanced;
|
i.state.showAdvanced = !i.state.showAdvanced;
|
||||||
i.setState(i.state);
|
i.setState(i.state);
|
||||||
|
setupTippy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
14
ui/src/components/post-listing.tsx
vendored
14
ui/src/components/post-listing.tsx
vendored
|
@ -102,9 +102,18 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate() {
|
componentDidUpdate(prevProps: PostListingProps) {
|
||||||
|
let prevPost = prevProps.post;
|
||||||
|
let post = this.props.post;
|
||||||
|
if (
|
||||||
|
prevPost.saved !== post.saved ||
|
||||||
|
prevPost.deleted !== post.deleted ||
|
||||||
|
prevPost.locked !== post.locked ||
|
||||||
|
prevPost.stickied !== post.stickied
|
||||||
|
) {
|
||||||
setupTippy();
|
setupTippy();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
componentWillReceiveProps(nextProps: PostListingProps) {
|
componentWillReceiveProps(nextProps: PostListingProps) {
|
||||||
this.state.my_vote = nextProps.post.my_vote;
|
this.state.my_vote = nextProps.post.my_vote;
|
||||||
|
@ -492,7 +501,7 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="list-inline mb-1 text-muted h6 font-weight-bold">
|
<ul class="list-inline mb-1 text-muted h5 font-weight-bold">
|
||||||
{UserService.Instance.user && (
|
{UserService.Instance.user && (
|
||||||
<>
|
<>
|
||||||
{this.props.showBody && (
|
{this.props.showBody && (
|
||||||
|
@ -1305,5 +1314,6 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
||||||
handleShowAdvanced(i: PostListing) {
|
handleShowAdvanced(i: PostListing) {
|
||||||
i.state.showAdvanced = !i.state.showAdvanced;
|
i.state.showAdvanced = !i.state.showAdvanced;
|
||||||
i.setState(i.state);
|
i.setState(i.state);
|
||||||
|
setupTippy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue