Add delete forever icon#1540
Merged
Merged
Conversation
Signed-off-by: Shivam Tyagi <tyagishivam.dev@gmail.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a new DeleteForeverIcon component to the icon library, along with its corresponding export files. The reviewer suggested enhancing the component by wrapping it in React.forwardRef to allow consumers to access the underlying SVG element, which is a best practice for supporting integrations like tooltips.
Comment on lines
+1
to
+25
| import { DEFAULT_FILL_NONE, DEFAULT_HEIGHT, DEFAULT_WIDTH } from '../../constants/constants'; | ||
| import { IconProps } from '../types'; | ||
|
|
||
| export const DeleteForeverIcon = ({ | ||
| width = DEFAULT_WIDTH, | ||
| height = DEFAULT_HEIGHT, | ||
| fill = DEFAULT_FILL_NONE, | ||
| ...props | ||
| }: IconProps): JSX.Element => { | ||
| return ( | ||
| <svg | ||
| width={width} | ||
| height={height} | ||
| xmlns="http://www.w3.org/2000/svg" | ||
| viewBox="0 0 24 24" | ||
| data-testid="delete-forever-icon-svg" | ||
| {...props} | ||
| > | ||
| <path | ||
| d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zm2.46-7.12 1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14zM15.5 4l-1-1h-5l-1 1H5v2h14V4z" | ||
| fill={fill} | ||
| /> | ||
| </svg> | ||
| ); | ||
| }; |
Contributor
There was a problem hiding this comment.
For components in an icon library, it is a best practice to use React.forwardRef to allow consumers to access the underlying SVG element. This is particularly important for integrations with other libraries (like tooltips) that require a ref to the DOM element. Additionally, ensure React is imported to support forwardRef and JSX.
import React from 'react';
import { DEFAULT_FILL_NONE, DEFAULT_HEIGHT, DEFAULT_WIDTH } from '../../constants/constants';
import { IconProps } from '../types';
export const DeleteForeverIcon = React.forwardRef<SVGSVGElement, IconProps>(({
width = DEFAULT_WIDTH,
height = DEFAULT_HEIGHT,
fill = DEFAULT_FILL_NONE,
...props
}, ref): JSX.Element => {
return (
<svg
width={width}
height={height}
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
data-testid="delete-forever-icon-svg"
ref={ref}
{...props}
>
<path
d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zm2.46-7.12 1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"
fill={fill}
/>
</svg>
);
});
rishiraj38
approved these changes
May 12, 2026
Rajesh-Nagarajan-11
approved these changes
May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Notes for Reviewers
This PR fixes #1491
Signed commits