From 92643cb4cf6865837933bbe526963bf775cb1c1c Mon Sep 17 00:00:00 2001 From: Carson Full Date: Tue, 15 Oct 2024 22:08:35 -0500 Subject: [PATCH] New comments icons --- .../Comments/ToggleCommentButton.tsx | 29 +++++++++++++++++-- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/src/components/Comments/ToggleCommentButton.tsx b/src/components/Comments/ToggleCommentButton.tsx index 92be495ac..650607b96 100644 --- a/src/components/Comments/ToggleCommentButton.tsx +++ b/src/components/Comments/ToggleCommentButton.tsx @@ -1,6 +1,6 @@ import { useQuery } from '@apollo/client'; -import { Comment } from '@mui/icons-material'; -import { Badge, Tooltip } from '@mui/material'; +import { Badge, SvgIcon, SvgIconProps, Tooltip } from '@mui/material'; +import { forwardRef } from 'react'; import { Except } from 'type-fest'; import { Feature } from '../Feature'; import { IconButton, IconButtonProps } from '../IconButton'; @@ -22,15 +22,38 @@ export const ToggleCommentsButton = ({ }); const total = data?.commentable.commentThreads.total ?? 0; + const Icon = total === 0 ? NewCommentIcon : CommentIcon; + return ( toggleCommentsBar()} {...rest}> - + ); }; + +const NewCommentIcon = forwardRef( + function NewCommentIcon(props, ref) { + return ( + + + + + ); + } +); + +const CommentIcon = forwardRef( + function CommentIcon(props, ref) { + return ( + + + + ); + } +);