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

574 swap usernames to full names on comments page #575

Merged
Merged
Show file tree
Hide file tree
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
9 changes: 8 additions & 1 deletion packages/api/src/types/CommentType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@ export type GetCommentsRequest = {
optionId: string;
};

export type GetCommentsResponse = (Comment & { user?: { id: string; username: string } })[];
export type GetCommentsResponse = (Comment & {
user?: {
id: string;
username: string;
firstName: string;
lastName: string;
};
})[];

export type PostCommentRequest = {
value: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
const currentUserLiked = commentLikes.some((like) => like.userId === user?.id);
setIsCommentLiked(currentUserLiked);
}
}, [commentLikes]);

Check warning on line 56 in packages/berlin/src/components/tables/comment-table/CommentsTable.tsx

View workflow job for this annotation

GitHub Actions / Check linting

React Hook useEffect has a missing dependency: 'user?.id'. Either include it or remove the dependency array

const { mutate: postLikeMutation } = useMutation({
mutationFn: postLike,
Expand Down Expand Up @@ -103,7 +103,9 @@
<FlexRow>
<Comment>{comment.value}</Comment>
</FlexRow>
<Author title={`@${comment.user?.username}`}>@{comment.user?.username}</Author>
<Author title={`@${comment.user?.username}`}>
{comment.user?.firstName} {comment.user?.lastName}
</Author>
<FormattedDate>{formattedDate}</FormattedDate>
<FlexRow
$gap="0.5rem"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function ResultsTable({ $expanded, option, onClick }: ResultsTableProps) {
<Bold>Distinct groups:</Bold> {option.distinctGroups}
</Body>
<Body>
<Bold>Group names:</Bold> {option.listOfGroupNames.join(', ')}
<Bold>Voter affiliations:</Bold> {option.listOfGroupNames.join(', ')}
</Body>
</FlexColumn>
</Card>
Expand Down
Loading