[MM-54791]: Convert email icon component to function component (#25548)

* refactor: convert email icon to rfc

* chore: update snapshot
This commit is contained in:
Jamin 2023-12-04 09:25:35 +00:00 committed by GitHub
parent c441f536b8
commit ddefb1f9c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 24 deletions

View File

@ -36,7 +36,7 @@ exports[`components/admin_console/system_user_detail should match default snapsh
Email
</span>
<div>
<EmailIcon
<Memo(EmailIcon)
className="SystemUserDetail__field-icon"
/>
<input
@ -272,7 +272,7 @@ exports[`components/admin_console/system_user_detail should match snapshot if LD
Email
</span>
<div>
<EmailIcon
<Memo(EmailIcon)
className="SystemUserDetail__field-icon"
/>
<input
@ -510,7 +510,7 @@ exports[`components/admin_console/system_user_detail should match snapshot if MF
Email
</span>
<div>
<EmailIcon
<Memo(EmailIcon)
className="SystemUserDetail__field-icon"
/>
<input
@ -754,7 +754,7 @@ exports[`components/admin_console/system_user_detail should match snapshot if SA
Email
</span>
<div>
<EmailIcon
<Memo(EmailIcon)
className="SystemUserDetail__field-icon"
/>
<input
@ -992,7 +992,7 @@ exports[`components/admin_console/system_user_detail should match snapshot if no
Email
</span>
<div>
<EmailIcon
<Memo(EmailIcon)
className="SystemUserDetail__field-icon"
/>
<input
@ -1228,7 +1228,7 @@ exports[`components/admin_console/system_user_detail should match snapshot if us
Email
</span>
<div>
<EmailIcon
<Memo(EmailIcon)
className="SystemUserDetail__field-icon"
/>
<input

View File

@ -3,21 +3,23 @@
import React from 'react';
export default class EmailIcon extends React.PureComponent<React.HTMLAttributes<HTMLSpanElement>> {
render() {
return (
<span {...this.props}>
<svg
width='100%'
height='100%'
viewBox='0 0 24 24'
>
<path
fill='inherit'
d='M22 6C22 4.9 21.1 4 20 4H4C2.9 4 2 4.9 2 6V18C2 19.1 2.9 20 4 20H20C21.1 20 22 19.1 22 18V6M20 6L12 11L4 6H20M20 18H4V8L12 13L20 8V18Z'
/>
</svg>
</span>
);
}
}
type Props = React.HTMLAttributes<HTMLSpanElement>;
const EmailIcon: React.FC<Props> = (props) => {
return (
<span {...props}>
<svg
width='100%'
height='100%'
viewBox='0 0 24 24'
>
<path
fill='inherit'
d='M22 6C22 4.9 21.1 4 20 4H4C2.9 4 2 4.9 2 6V18C2 19.1 2.9 20 4 20H20C21.1 20 22 19.1 22 18V6M20 6L12 11L4 6H20M20 18H4V8L12 13L20 8V18Z'
/>
</svg>
</span>
);
};
export default React.memo(EmailIcon);