Add gravatar image to new comment form

This commit is contained in:
riccardo
2019-10-02 15:26:32 +02:00
parent 034a5ab708
commit e8d7fcc359
6 changed files with 23 additions and 0 deletions

View File

@@ -1,4 +1,5 @@
import * as React from 'react';
import Gravatar from 'react-gravatar';
import Button from '../shared/Button';
import Spinner from '../shared/Spinner';
@@ -13,6 +14,7 @@ interface Props {
handleSubmit(body: string, parentId: number): void;
isLoggedIn: boolean;
userEmail: string;
}
const NewComment = ({
@@ -24,12 +26,14 @@ const NewComment = ({
handleSubmit,
isLoggedIn,
userEmail,
}: Props) => (
<React.Fragment>
<div className="newCommentForm">
{
isLoggedIn ?
<React.Fragment>
<Gravatar email={userEmail} size={36} className="currentUserAvatar" />
<textarea
value={body}
onChange={handleChange}