Skip to content
Snippets Groups Projects
Unverified Commit 140aa6b0 authored by fusagiko / takayamaki's avatar fusagiko / takayamaki Committed by GitHub
Browse files

Rewrite VerifiedBadge component as function component (#24892)

parent f877aa9d
No related branches found
No related tags found
No related merge requests found
......@@ -151,7 +151,7 @@ class Account extends ImmutablePureComponent {
const firstVerifiedField = account.get('fields').find(item => !!item.get('verified_at'));
if (firstVerifiedField) {
verification = <>· <VerifiedBadge link={firstVerifiedField.get('value')} verifiedAt={firstVerifiedField.get('verified_at')} /></>;
verification = <>· <VerifiedBadge link={firstVerifiedField.get('value')} /></>;
}
return (
......
import React from 'react';
import PropTypes from 'prop-types';
import Icon from 'mastodon/components/icon';
class VerifiedBadge extends React.PureComponent {
static propTypes = {
link: PropTypes.string.isRequired,
verifiedAt: PropTypes.string.isRequired,
};
render () {
const { link } = this.props;
return (
<span className='verified-badge'>
<Icon id='check' className='verified-badge__mark' />
<span dangerouslySetInnerHTML={{ __html: link }} />
</span>
);
}
}
export default VerifiedBadge;
\ No newline at end of file
import React from 'react';
import { Icon } from './icon';
type Props = {
link: string;
};
export const VerifiedBadge: React.FC<Props> = ({ link }) => (
<span className='verified-badge'>
<Icon id='check' className='verified-badge__mark' />
<span dangerouslySetInnerHTML={{ __html: link }} />
</span>
);
export default VerifiedBadge;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment