2020-04-22 14:26:44 -07:00
|
|
|
import React from 'react';
|
|
|
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
2020-05-28 15:52:07 -07:00
|
|
|
import { acctFull } from 'soapbox/utils/accounts';
|
2020-06-10 06:30:33 -07:00
|
|
|
import StillImage from 'soapbox/components/still_image';
|
2020-08-05 10:47:45 -07:00
|
|
|
import VerificationBadge from 'soapbox/components/verification_badge';
|
2020-08-07 15:01:15 -07:00
|
|
|
import { List as ImmutableList } from 'immutable';
|
2020-04-22 14:26:44 -07:00
|
|
|
|
|
|
|
const ProfilePreview = ({ account }) => (
|
|
|
|
<div className='card h-card'>
|
|
|
|
<a target='_blank' rel='noopener' href={account.get('url')}>
|
|
|
|
<div className='card__img'>
|
2020-06-10 06:30:33 -07:00
|
|
|
<StillImage alt='' src={account.get('header')} />
|
2020-04-22 14:26:44 -07:00
|
|
|
</div>
|
|
|
|
<div className='card__bar'>
|
|
|
|
<div className='avatar'>
|
2020-06-10 06:30:33 -07:00
|
|
|
<StillImage alt='' className='u-photo' src={account.get('avatar')} width='48' height='48' />
|
2020-04-22 14:26:44 -07:00
|
|
|
</div>
|
|
|
|
<div className='display-name'>
|
|
|
|
<span style={{ display: 'none' }}>{account.get('username')}</span>
|
|
|
|
<bdi>
|
2020-08-05 10:47:45 -07:00
|
|
|
<strong className='emojify p-name'>
|
|
|
|
{account.get('display_name')}
|
2020-08-07 15:01:15 -07:00
|
|
|
{account.getIn(['pleroma', 'tags'], ImmutableList()).includes('verified') && <VerificationBadge />}
|
2020-08-05 10:47:45 -07:00
|
|
|
</strong>
|
2020-04-22 14:26:44 -07:00
|
|
|
</bdi>
|
|
|
|
<span>{acctFull(account)}</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
|
|
|
|
ProfilePreview.propTypes = {
|
|
|
|
account: ImmutablePropTypes.map,
|
|
|
|
};
|
|
|
|
|
|
|
|
export default ProfilePreview;
|