feat: add AccountTreeIcon component#1551
Conversation
Signed-off-by: Rudra2637 <singhrudra2637@gmail.com>
There was a problem hiding this comment.
Code Review
This pull request introduces the AccountTreeIcon component and updates the icon exports. Feedback suggests improving the component's consistency by using the DEFAULT_FILL constant, adjusting the indentation to two spaces as per the project's style guide, and fixing minor SVG formatting issues.
| import { DEFAULT_HEIGHT, DEFAULT_WIDTH } from '../../constants/constants'; | ||
| import { IconProps } from '../types'; | ||
|
|
||
| export const AccountTreeIcon = ({ | ||
| width = DEFAULT_WIDTH, | ||
| height = DEFAULT_HEIGHT, | ||
| ...props | ||
| }: IconProps): JSX.Element => { | ||
| return ( | ||
| <svg | ||
| width={width} | ||
| height={height} | ||
| xmlns="http://www.w3.org/2000/svg" | ||
| viewBox="0 0 24 24" | ||
| {...props} | ||
| > | ||
| <path d="M22 11V3h-7v3H9V3H2v8h7V8h2v10h4v3h7v-8h-7v3h-2V8h2v3z" /> | ||
| </svg> | ||
| ); | ||
| }; | ||
|
|
||
| export default AccountTreeIcon; No newline at end of file |
There was a problem hiding this comment.
The component has formatting inconsistencies and should use the DEFAULT_FILL constant for consistency with other icons in the library. Specifically, the closing > of the svg tag is on a new line, and the closing </svg> tag is incorrectly indented. Additionally, the indentation should be updated to 2 spaces to match the project's style guide as seen in constants.ts and types.ts.
import { DEFAULT_FILL, DEFAULT_HEIGHT, DEFAULT_WIDTH } from '../../constants/constants';
import { IconProps } from '../types';
export const AccountTreeIcon = ({
width = DEFAULT_WIDTH,
height = DEFAULT_HEIGHT,
fill = DEFAULT_FILL,
...props
}: IconProps): JSX.Element => {
return (
<svg
width={width}
height={height}
fill={fill}
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
{...props}>
<path d="M22 11V3h-7v3H9V3H2v8h7V8h2v10h4v3h7v-8h-7v3h-2V8h2v3z" />
</svg>
);
};
export default AccountTreeIcon;
References
- Use library constants for consistency and follow the project's 2-space indentation style guide. (link)
Description
This PR adds the
AccountTreeIconcomponent to Sistent to reduce dependency on@mui/icons-materialand ensure design consistency across Layer5 products. The icon preserves the exact UX in Meshery's index.ts component without visual regression.Changes Made
AccountTreeIconcomponent insrc/icons/AccountTree/src/icons/index.tsto export the new iconRelated Issues
Fixes #1548
Testing
npm run build- Build succeedsnpm test- All 266 tests passnpm run lint- Code formatting verifiedNotes for Reviewers
The AccountTreeIcon follows the existing Sistent icon pattern:
Signed commits
git commit -s