Skip to content

fix(ui-alerts): fix Alert border radius override and add new prop for…#2023

Merged
ToMESSKa merged 1 commit into
masterfrom
INSTUI-4572-clx-allow-to-customize-the-border-radius-and-icon-in-alert-component
Jul 3, 2025
Merged

fix(ui-alerts): fix Alert border radius override and add new prop for…#2023
ToMESSKa merged 1 commit into
masterfrom
INSTUI-4572-clx-allow-to-customize-the-border-radius-and-icon-in-alert-component

Conversation

@ToMESSKa

@ToMESSKa ToMESSKa commented Jun 13, 2025

Copy link
Copy Markdown
Contributor

… custom icon

INSTUI-4572

ISSUE:

  • overriding the border radius of Alert results the icon's border not changing
  • the icon cannot be customized

TEST PLAN:

  • go over the examples in Alert by overriding borderRadius e.g.:
themeOverride={{
    borderRadius: '1rem'
  }}
  • the icons border radius should also change (previously is was unaffected)
  • it should work in RTL too
  • try adding a custom icon by using the renderCustomIcon prop e.g.:
renderCustomIcon={()=> <IconUserLine />}
  • the icon should change

@ToMESSKa ToMESSKa self-assigned this Jun 13, 2025
@ToMESSKa ToMESSKa marked this pull request as draft June 13, 2025 14:09
@ToMESSKa ToMESSKa force-pushed the INSTUI-4572-clx-allow-to-customize-the-border-radius-and-icon-in-alert-component branch 2 times, most recently from 90dc893 to 3b26407 Compare June 13, 2025 15:02
@github-actions

github-actions Bot commented Jun 13, 2025

Copy link
Copy Markdown
PR Preview Action v1.6.1
Preview removed because the pull request was closed.
2025-07-03 10:08 UTC

@ToMESSKa ToMESSKa marked this pull request as ready for review June 13, 2025 15:12
@ToMESSKa ToMESSKa requested a review from Copilot June 13, 2025 15:13

Copilot AI left a comment

Copy link
Copy Markdown

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 fixes an issue with the Alert component where overriding the border radius did not affect the icon's border and adds a new prop to allow for rendering a custom icon.

  • Updated the Alert styles to include new border radius styles for the icon container.
  • Added the renderCustomIcon prop in the Alert props and integrated it in the Alert component.
  • Updated tests to validate the custom icon functionality.

Reviewed Changes

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

File Description
packages/ui-alerts/src/Alert/styles.ts Added negative margin and border radius overrides to adjust the alert icon styling.
packages/ui-alerts/src/Alert/props.ts Added renderCustomIcon property with associated propTypes and allowedProps update.
packages/ui-alerts/src/Alert/index.tsx Modified renderIcon to support renderCustomIcon, rendering it when provided.
packages/ui-alerts/src/Alert/tests/Alert.test.tsx Added a test to ensure a custom icon is rendered via renderCustomIcon prop.
Comments suppressed due to low confidence (1)

packages/ui-alerts/src/Alert/tests/Alert.test.tsx:167

  • The test description still references renderIcon; please update it to renderCustomIcon to match the updated prop name and avoid confusion.
it('should render an icon when provided as the `renderIcon` prop', () => {

Comment thread packages/ui-alerts/src/Alert/styles.ts Outdated
Comment thread packages/ui-alerts/src/Alert/styles.ts Outdated

@ToMESSKa ToMESSKa Jun 13, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this is needed to make a white line between the Alert's and the icon's border to disappear

@ToMESSKa ToMESSKa requested review from HerrTopi and matyasf June 13, 2025 15:18

@matyasf matyasf left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nice work!

@ToMESSKa ToMESSKa force-pushed the INSTUI-4572-clx-allow-to-customize-the-border-radius-and-icon-in-alert-component branch from 3b26407 to 1466c53 Compare July 3, 2025 09:57
@ToMESSKa ToMESSKa merged commit 78ef567 into master Jul 3, 2025
11 checks passed
@ToMESSKa ToMESSKa deleted the INSTUI-4572-clx-allow-to-customize-the-border-radius-and-icon-in-alert-component branch July 3, 2025 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants