[Glitch] Rewrite VerifiedBadge component as function component
Port 140aa6b054
to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
pull/2492/head
parent
00db5c8ade
commit
2efb22f455
|
@ -155,7 +155,7 @@ class Account extends ImmutablePureComponent {
|
||||||
const firstVerifiedField = account.get('fields').find(item => !!item.get('verified_at'));
|
const firstVerifiedField = account.get('fields').find(item => !!item.get('verified_at'));
|
||||||
|
|
||||||
if (firstVerifiedField) {
|
if (firstVerifiedField) {
|
||||||
verification = <>· <VerifiedBadge link={firstVerifiedField.get('value')} verifiedAt={firstVerifiedField.get('verified_at')} /></>;
|
verification = <>· <VerifiedBadge link={firstVerifiedField.get('value')} /></>;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -1,25 +0,0 @@
|
||||||
import React from 'react';
|
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import Icon from 'flavours/glitch/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;
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
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;
|
Loading…
Reference in New Issue