Skip to content

Commit

Permalink
feat: make blocked user and deleted content lighter
Browse files Browse the repository at this point in the history
  • Loading branch information
MrOrz committed Jun 10, 2024
1 parent 4145a7b commit df4909e
Show file tree
Hide file tree
Showing 3 changed files with 323 additions and 24 deletions.
4 changes: 4 additions & 0 deletions src/pages/EditorWorks/ReplyTable.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@ query ReplyListInReplyTable($after: String, $pageSize: Int, $createdAt: TimeRang
user {
id
name
blockedReason
}
createdAt
articleReplies {
status
}
}
}
}
Expand Down
19 changes: 17 additions & 2 deletions src/pages/EditorWorks/ReplyTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ const TextCell = styled('div')({
'-webkit-line-clamp': 3,
});

const Blocked = styled('del')(({ theme }) => ({
color: theme.palette.grey[300],
}));

const COLUMNS: GridColDef[] = [
{
field: 'author',
Expand All @@ -40,14 +44,19 @@ const COLUMNS: GridColDef[] = [
if (!user) return <div />;
return (
<RRLink
style={{ textDecoration: 'none' }}
to={`?${getSearchString({
workType: WorkType.REPLY,
day: 7,
userId: user.id,
showAll: true,
})}`}
>
{user.name}
{!user.blockedReason ? (
user.name
) : (
<Blocked title={user.blockedReason}>{user.name}</Blocked>
)}
</RRLink>
);
},
Expand All @@ -59,15 +68,21 @@ const COLUMNS: GridColDef[] = [
renderCell(params) {
const text = params.getValue(params.id, 'text');
const replyId = params.getValue(params.id, 'id');
const { status } = params.getValue(params.id, 'articleReplies')[0] || {};
if (!replyId || !text) return <div />;
return (
<TextCell>
<Link
style={{ textDecoration: 'none' }}
href={`${process.env.REACT_APP_SITE_URL}/reply/${replyId}`}
color="textPrimary"
variant="body2"
>
{text}
{status === 'NORMAL' ? (
text
) : (
<Blocked title={status}>{text}</Blocked>
)}
</Link>
</TextCell>
);
Expand Down
Loading

0 comments on commit df4909e

Please sign in to comment.