280dc51d85
reorganization, linting, updating file imports, consolidation warning: there will be errors in this commit todo: update webpack, add missing styles, scss files, consolidate the rest of components within features/*
34 lines
917 B
JavaScript
34 lines
917 B
JavaScript
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
import ImmutablePureComponent from 'react-immutable-pure-component';
|
|
import { autoPlayGif } from '../../initial_state';
|
|
|
|
import './avatar_overlay.scss';
|
|
|
|
export default class AvatarOverlay extends ImmutablePureComponent {
|
|
|
|
static propTypes = {
|
|
account: ImmutablePropTypes.map.isRequired,
|
|
friend: ImmutablePropTypes.map.isRequired,
|
|
animate: PropTypes.bool,
|
|
};
|
|
|
|
static defaultProps = {
|
|
animate: autoPlayGif,
|
|
};
|
|
|
|
render() {
|
|
const { account, friend, animate } = this.props;
|
|
|
|
const baseSrc = account.get(animate ? 'avatar' : 'avatar_static');
|
|
const overlaySrc = friend.get(animate ? 'avatar' : 'avatar_static');
|
|
|
|
return (
|
|
<div className='avatar-overlay'>
|
|
<img className='avatar-overlay__base' src={baseSrc} />
|
|
<img className='avatar-overlay__overlay' src={overlaySrc} />
|
|
</div>
|
|
);
|
|
}
|
|
|
|
}
|