mastodon/app/javascript/flavours/glitch/components/avatar_overlay.js

31 lines
857 B
JavaScript
Raw Normal View History

import React from 'react';
2017-08-06 18:59:19 +00:00
import ImmutablePropTypes from 'react-immutable-proptypes';
export default class AvatarOverlay extends React.PureComponent {
static propTypes = {
2017-08-06 18:59:19 +00:00
account: ImmutablePropTypes.map.isRequired,
friend: ImmutablePropTypes.map.isRequired,
};
render() {
2017-08-06 18:59:19 +00:00
const { account, friend } = this.props;
const baseStyle = {
2017-08-06 18:59:19 +00:00
backgroundImage: `url(${account.get('avatar_static')})`,
};
const overlayStyle = {
2017-08-06 18:59:19 +00:00
backgroundImage: `url(${friend.get('avatar_static')})`,
};
return (
<div className='account__avatar-overlay'>
<div className='account__avatar-overlay-base' style={baseStyle} data-avatar-of={`@${account.get('acct')}`} />
<div className='account__avatar-overlay-overlay' style={overlayStyle} data-avatar-of={`@${friend.get('acct')}`} />
</div>
);
}
}