convert EmojiIcon component from class based to function based component (#24792)
* convert EmojiIcon comp to functional comp * comment resolved * memoization added * snapshot updated --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
b4f3816f0c
Коммит
cb83bd154b
@@ -47,7 +47,7 @@ exports[`components/post_view/PostReaction should match snapshot 1`] = `
|
|||||||
id="CENTER_reaction_post_id_1"
|
id="CENTER_reaction_post_id_1"
|
||||||
onClick={[MockFunction]}
|
onClick={[MockFunction]}
|
||||||
>
|
>
|
||||||
<EmojiIcon
|
<Memo(EmojiIcon)
|
||||||
className="icon icon--small"
|
className="icon icon--small"
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -631,7 +631,7 @@ exports[`components/StatusDropdown should match snapshot with custom status enab
|
|||||||
<span
|
<span
|
||||||
className="custom_status__icon"
|
className="custom_status__icon"
|
||||||
>
|
>
|
||||||
<EmojiIcon
|
<Memo(EmojiIcon)
|
||||||
className="custom-status-emoji"
|
className="custom-status-emoji"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
@@ -898,7 +898,7 @@ exports[`components/StatusDropdown should match snapshot with custom status expi
|
|||||||
<span
|
<span
|
||||||
className="custom_status__icon"
|
className="custom_status__icon"
|
||||||
>
|
>
|
||||||
<EmojiIcon
|
<Memo(EmojiIcon)
|
||||||
className="custom-status-emoji"
|
className="custom-status-emoji"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
@@ -1165,7 +1165,7 @@ exports[`components/StatusDropdown should match snapshot with custom status puls
|
|||||||
<span
|
<span
|
||||||
className="custom_status__icon"
|
className="custom_status__icon"
|
||||||
>
|
>
|
||||||
<EmojiIcon
|
<Memo(EmojiIcon)
|
||||||
className="custom-status-emoji"
|
className="custom-status-emoji"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
@@ -1909,7 +1909,7 @@ exports[`components/StatusDropdown should not show clear status button when cust
|
|||||||
<span
|
<span
|
||||||
className="custom_status__icon"
|
className="custom_status__icon"
|
||||||
>
|
>
|
||||||
<EmojiIcon
|
<Memo(EmojiIcon)
|
||||||
className="custom-status-emoji"
|
className="custom-status-emoji"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||||
// See LICENSE.txt for license information.
|
// See LICENSE.txt for license information.
|
||||||
|
|
||||||
import React from 'react';
|
import React, {memo} from 'react';
|
||||||
|
|
||||||
export default class EmojiIcon extends React.PureComponent<React.HTMLAttributes<HTMLSpanElement>> {
|
type Props = React.HTMLAttributes<HTMLSpanElement>;
|
||||||
render() {
|
|
||||||
|
const EmojiIcon = (props: Props) => {
|
||||||
return (
|
return (
|
||||||
<span {...this.props}>
|
<span {...props}>
|
||||||
<svg
|
<svg
|
||||||
width='16px'
|
width='16px'
|
||||||
height='16px'
|
height='16px'
|
||||||
@@ -18,5 +19,6 @@ export default class EmojiIcon extends React.PureComponent<React.HTMLAttributes<
|
|||||||
</svg>
|
</svg>
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
}
|
|
||||||
|
export default memo(EmojiIcon);
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user