1
0
puyopuyotetr.is/app/javascript/mastodon/components/avatar_overlay.js

31 lines
857 B
JavaScript
Raw Normal View History

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