bigbuffet-rw/app/soapbox/features/edit_profile/components/profile_preview.js

38 lines
1.3 KiB
JavaScript
Raw Normal View History

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';
import StillImage from 'soapbox/components/still_image';
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'>
<StillImage alt='' src={account.get('header')} />
2020-04-22 14:26:44 -07:00
</div>
<div className='card__bar'>
<div className='avatar'>
<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>
<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 />}
</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;