catstodon/app/javascript/mastodon/components/avatar_overlay.js

31 lines
772 B
JavaScript
Raw Normal View History

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