Skip to content

Conversation

@eugenebelov
Copy link
Member

<WarningMessage /> marked as redundunt. Add modifications to <Alert /> that we can use it in same way as <WarningMessage />

@eugenebelov eugenebelov self-assigned this Aug 13, 2025
@eugenebelov eugenebelov added the bug Something isn't working label Aug 13, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR deprecates the WarningMessage component by marking it as redundant and enhances the Alert component to support custom icons, making it a suitable replacement. The changes ensure that existing WarningMessage functionality can be replicated using the Alert component.

  • Deprecated WarningMessage component with a JSDoc comment recommending Alert with iconSrc prop
  • Enhanced Alert component to accept custom icons via iconSrc prop
  • Removed WarningMessage Storybook stories and updated Alert stories to demonstrate custom icon usage

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
warning-message.tsx Added deprecation comment and minor formatting fixes
warning-message.stories.tsx Completely removed Storybook stories for deprecated component
alert.tsx Added iconSrc prop support and styling improvements
alert.stories.tsx Updated to modern Storybook format with custom icon example
account-info-row.tsx Code formatting improvements and added text variation properties

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

<SvgIcon src={iconPath} alt={`Alert icon with ${status} status`} />
<SvgIcon
src={iconPath}
alt={`Alert icon with ${statusAlert} status`}
Copy link

Copilot AI Aug 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When statusAlert is an empty string (custom icon case), the alt text becomes 'Alert icon with status' which contains extra whitespace and is unclear. Consider providing a more descriptive alt text for custom icons or using the original status value.

Suggested change
alt={`Alert icon with ${statusAlert} status`}
alt={props.iconSrc ? 'Custom alert icon' : `Alert icon with ${statusAlert} status`}

Copilot uses AI. Check for mistakes.
@eugenebelov eugenebelov merged commit b38624c into master Aug 14, 2025
2 checks passed
@eugenebelov eugenebelov deleted the add-redundunt-to-warning-message branch August 14, 2025 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants