Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test and header style #574

Merged
merged 3 commits into from
Jul 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions components/ReplyRequestReason/ReplyRequestReason.js
Original file line number Diff line number Diff line change
@@ -1,11 +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 Link from 'next/link';
import { ProfileTooltip } from 'components/ProfileLink';

import { ThumbUpIcon, ThumbDownIcon } from 'components/icons';
import Avatar from 'components/AppLayout/Widgets/Avatar';
Expand Down Expand Up @@ -37,6 +38,9 @@ const useStyles = makeStyles(theme => ({
reason: {
marginTop: 0,
},
time: {
color: theme.palette.secondary[200],
},
vote: {
borderRadius: 45,
marginRight: 3,
Expand Down Expand Up @@ -119,15 +123,23 @@ 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>
<TimeInfo time={replyRequest.updatedAt}/>
<p className={classes.user}>{authorElem}</p>
<TimeInfo time={replyRequest.updatedAt}>
{str => <span className={classes.time}>{str}</span>}
</TimeInfo>
</Box>
<p className={classes.reason}>{replyRequestReason}</p>
<Box display="flex" justifyContent="space-between">
Expand Down
Loading