import React from 'react'; import PropTypes from 'prop-types'; import { Link } from 'react-router-dom'; import { UserType } from './Types'; import Icon from './Icon'; import { fetchUserUri } from '../api'; import './Avatar.css'; class Avatar extends React.Component { constructor(props) { super(props); this.state = { user: props.user }; } componentDidMount() { let user = this.state.user; if (!user.uid && user.uri) { fetchUserUri(user.uri).then(response => { this.setState({ user: response.data }); }); } } render() { let user = this.state.user; return (