Skip to content

Commit

Permalink
fix(ReplyRequestReason): show author of reply request
Browse files Browse the repository at this point in the history
  • Loading branch information
MrOrz committed Jul 21, 2024
1 parent af868e9 commit 020c9e8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion components/ReplyRequestReason/ReplyRequestReason.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import React from 'react';
import { t } from 'ttag';
import gql from 'graphql-tag';
import PropTypes from 'prop-types';
import { useMutation } from '@apollo/react-hooks';
import { makeStyles } from '@material-ui/core/styles';
import { Box, Button } from '@material-ui/core';
import TimeInfo from 'components/Infos/TimeInfo';
import { ProfileTooltip } from 'components/ProfileLink';

import { ThumbUpIcon, ThumbDownIcon } from 'components/icons';
import Avatar from 'components/AppLayout/Widgets/Avatar';
Expand Down Expand Up @@ -118,14 +120,20 @@ function ReplyRequestReason({ replyRequest, articleId }) {

const isOwnReplyRequest = user && currentUser && user.id === currentUser.id;

const authorElem = (
<ProfileTooltip key="editor" user={user}>
<span>{user?.name || t`Someone`}</span>
</ProfileTooltip>
);

return (
<div className={classes.root}>
<Box color="primary.main" pr={2}>
<Avatar user={user} size={40} />
</Box>
<Box flex={1} className={classes.reasonBody}>
<Box className={classes.header}>
<p className={classes.user}>{user.id}</p>
<p className={classes.user}>{authorElem}</p>
<TimeInfo time={replyRequest.updatedAt} />
</Box>
<p className={classes.reason}>{replyRequestReason}</p>
Expand Down

0 comments on commit 020c9e8

Please sign in to comment.