Skip to content

Commit

Permalink
Add tooltip for comment toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
CarsonF committed Oct 10, 2024
1 parent 0b4310b commit 347ead7
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/components/Comments/ToggleCommentButton.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useQuery } from '@apollo/client';
import { Comment } from '@mui/icons-material';
import { Badge } from '@mui/material';
import { Badge, Tooltip } from '@mui/material';
import { Except } from 'type-fest';
import { Feature } from '../Feature';
import { IconButton, IconButtonProps } from '../IconButton';
Expand All @@ -24,11 +24,13 @@ export const ToggleCommentsButton = ({

return (
<Feature flag="comments" match={true}>
<IconButton onClick={() => toggleCommentsBar()} {...rest}>
<Badge badgeContent={total} color="primary">
<Comment />
</Badge>
</IconButton>
<Tooltip title={`${isCommentsBarOpen ? 'Hide' : 'Show'} Comments`}>
<IconButton onClick={() => toggleCommentsBar()} {...rest}>
<Badge badgeContent={total} color="primary">
<Comment />
</Badge>
</IconButton>
</Tooltip>
</Feature>
);
};

0 comments on commit 347ead7

Please sign in to comment.