reactioncommerce/redoc

View on GitHub
packages/redoc-core/components/avatar.jsx

Summary

Maintainability
A
0 mins
Test Coverage
import React from "react";

class Avatar extends React.Component {
  render() {
    if (this.props.githubUserId) {
      const imageUrl = `https://avatars.githubusercontent.com/u/${this.props.githubUserId}?s=460`;
      return (
        <div className="redoc profile-image">
          <img src={imageUrl} />
        </div>
      );
    }

    return (
      <div className="redoc profile-image blank"></div>
    );
  }
}

export default Avatar;