This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
mastodon/app/javascript/themes/glitch/components/avatar_overlay.js

31 lines
857 B
JavaScript
Raw Normal View History

import React from 'react';
2017-08-06 11:59:19 -07:00
import ImmutablePropTypes from 'react-immutable-proptypes';
export default class AvatarOverlay extends React.PureComponent {
static propTypes = {
2017-08-06 11:59:19 -07:00
account: ImmutablePropTypes.map.isRequired,
friend: ImmutablePropTypes.map.isRequired,
};
render() {
2017-08-06 11:59:19 -07:00
const { account, friend } = this.props;
const baseStyle = {
2017-08-06 11:59:19 -07:00
backgroundImage: `url(${account.get('avatar_static')})`,
};
const overlayStyle = {
2017-08-06 11:59:19 -07: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>
);
}
}