diff --git a/src/js/components/Navigation/HeaderBackTo.jsx b/src/js/components/Navigation/HeaderBackTo.jsx index ec605df33..8173bebae 100644 --- a/src/js/components/Navigation/HeaderBackTo.jsx +++ b/src/js/components/Navigation/HeaderBackTo.jsx @@ -4,10 +4,12 @@ import styled from 'styled-components'; import { AccountCircle } from '@material-ui/icons'; import { AppBar, IconButton, Toolbar, Button } from '@material-ui/core'; import { withStyles } from '@material-ui/core/styles'; +import anonymous from '../../../img/global/icons/avatar-generic.png'; import AppStore from '../../stores/AppStore'; import AppActions from '../../actions/AppActions'; import { dumpCssFromId } from '../../utils/appleSiliconUtils'; import { hasIPhoneNotch, historyPush, isIOSAppOnMac, isCordova, isWebApp, isIPad } from '../../utils/cordovaUtils'; +import LazyImage from '../../utils/LazyImage'; import HeaderBackToButton from './HeaderBackToButton'; import HeaderBarProfilePopUp from './HeaderBarProfilePopUp'; import HeaderNotificationMenu from './HeaderNotificationMenu'; @@ -255,9 +257,10 @@ class HeaderBackTo extends Component { className={`header-nav__avatar-container ${isCordova() ? 'header-nav__avatar-cordova' : undefined}`} onClick={this.toggleProfilePopUp} > - Your Settings - - - - generic avatar - generic avatar {voterPhotoUrlMedium ? (
- Signed in voter { + console.log('LazyImage loaded src:', src); + this.setState({ src }); + }; + } + + render () { + const { placeholder, className, height, width, alt } = this.props; + const { src } = this.state; + return ( + {alt} + ); + } +} + +LazyImage.propTypes = { + src: PropTypes.string, + placeholder: PropTypes.string, + className: PropTypes.string, + height: PropTypes.number, + width: PropTypes.number, + alt: PropTypes.string, +};