docs(comment): like and dislike number event binding #25437 (#25444)

* fix(comment): like and dislike number cursor style(#25437)

* docs: modify like and dislike DOM order and onclick event binding

* fix: key missing for actions array

* fix: add test snapshot

* fix: modify test snapshot
This commit is contained in:
zxyao 2020-07-06 16:03:12 +08:00 committed by GitHub
parent 6a32e8a40b
commit b06e2567b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 18 deletions

View File

@ -56,7 +56,6 @@ exports[`renders ./components/comment/demo/basic.md correctly 1`] = `
aria-label="like"
class="anticon anticon-like"
role="img"
tabindex="-1"
>
<svg
aria-hidden="true"
@ -86,7 +85,6 @@ exports[`renders ./components/comment/demo/basic.md correctly 1`] = `
aria-label="dislike"
class="anticon anticon-dislike"
role="img"
tabindex="-1"
>
<svg
aria-hidden="true"

View File

@ -37,22 +37,18 @@ const Demo = () => {
};
const actions = [
<span key="comment-basic-like">
<Tooltip title="Like">
{createElement(action === 'liked' ? LikeFilled : LikeOutlined, {
onClick: like,
})}
</Tooltip>
<Tooltip key="comment-basic-like" title="Like">
<span onClick={like}>
{createElement(action === 'liked' ? LikeFilled : LikeOutlined)}
<span className="comment-action">{likes}</span>
</span>,
<span key="comment-basic-dislike">
<Tooltip title="Dislike">
{React.createElement(action === 'disliked' ? DislikeFilled : DislikeOutlined, {
onClick: dislike,
})}
</Tooltip>
</span>
</Tooltip>,
<Tooltip key="comment-basic-dislike" title="Dislike">
<span onClick={dislike}>
{React.createElement(action === 'disliked' ? DislikeFilled : DislikeOutlined)}
<span className="comment-action">{dislikes}</span>
</span>,
</span>
</Tooltip>,
<span key="comment-basic-reply-to">Reply to</span>,
];