You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.1 KiB
38 lines
1.1 KiB
8 years ago
|
import React from 'react';
|
||
7 years ago
|
import PropTypes from 'prop-types';
|
||
7 years ago
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||
2 years ago
|
import { autoPlayGif } from 'flavours/glitch/initial_state';
|
||
8 years ago
|
|
||
8 years ago
|
export default class AvatarOverlay extends React.PureComponent {
|
||
8 years ago
|
|
||
8 years ago
|
static propTypes = {
|
||
7 years ago
|
account: ImmutablePropTypes.map.isRequired,
|
||
|
friend: ImmutablePropTypes.map.isRequired,
|
||
7 years ago
|
animate: PropTypes.bool,
|
||
|
};
|
||
|
|
||
|
static defaultProps = {
|
||
|
animate: autoPlayGif,
|
||
8 years ago
|
};
|
||
|
|
||
8 years ago
|
render() {
|
||
7 years ago
|
const { account, friend, animate } = this.props;
|
||
8 years ago
|
|
||
|
const baseStyle = {
|
||
7 years ago
|
backgroundImage: `url(${account.get(animate ? 'avatar' : 'avatar_static')})`,
|
||
8 years ago
|
};
|
||
|
|
||
|
const overlayStyle = {
|
||
7 years ago
|
backgroundImage: `url(${friend.get(animate ? 'avatar' : 'avatar_static')})`,
|
||
8 years ago
|
};
|
||
|
|
||
|
return (
|
||
|
<div className='account__avatar-overlay'>
|
||
7 years ago
|
<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')}`} />
|
||
8 years ago
|
</div>
|
||
|
);
|
||
|
}
|
||
|
|
||
8 years ago
|
}
|