Add new Icon parameter to BitProPanel (#12246)#12247
Add new Icon parameter to BitProPanel (#12246)#12247msynk merged 3 commits intobitfoundation:developfrom
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThe changes implement a new icon customization feature for the BitProPanel component's close button, introducing two new parameters ( Changes
Poem
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR adds close-button icon customization to the BitProPanel component (extras), aligning it with the existing BitIconInfo-based icon extensibility pattern used across Bit.BlazorUI, and updates the demo page to document and showcase the new capability.
Changes:
- Added
CloseIcon(BitIconInfo?) andCloseIconName(string?) parameters toBitProPanel, withCloseIcontaking precedence and a"Cancel"fallback. - Updated
BitProPanelrendering to useBitIconInfo.From(...)for the close icon. - Extended the ProPanel demo documentation and added an “External Icon” example.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/ProPanel/BitProPanelDemo.razor.cs |
Documents new parameters and adds a demo code snippet for using an external close icon. |
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/ProPanel/BitProPanelDemo.razor |
Adds a new “External Icon” demo example rendering a ProPanel with a FontAwesome close icon. |
src/BlazorUI/Bit.BlazorUI.Extras/Components/ProPanel/BitProPanel.razor.cs |
Introduces the new CloseIcon/CloseIconName public parameters and XML docs. |
src/BlazorUI/Bit.BlazorUI.Extras/Components/ProPanel/BitProPanel.razor |
Switches close icon markup to use resolved BitIconInfo CSS classes. |
.../Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/ProPanel/BitProPanelDemo.razor
Show resolved
Hide resolved
...ient/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/ProPanel/BitProPanelDemo.razor.cs
Outdated
Show resolved
Hide resolved
src/BlazorUI/Bit.BlazorUI.Extras/Components/ProPanel/BitProPanel.razor.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/BlazorUI/Bit.BlazorUI.Extras/Components/ProPanel/BitProPanel.razor`:
- Around line 45-49: In BitProPanel.razor the CloseIcon fallback only handles
null which allows empty/whitespace CloseIconName to produce a null icon; update
the BitIconInfo.From call to use a whitespace-safe fallback by passing
CloseIconName when not string.IsNullOrWhiteSpace(CloseIconName) and "Cancel"
otherwise (i.e., replace the CloseIconName ?? "Cancel" usage), so
BitIconInfo.From always receives a valid name and the close button icon won't be
blank.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: f060dd73-2205-47ef-8dea-f5f5a64c3042
📒 Files selected for processing (4)
src/BlazorUI/Bit.BlazorUI.Extras/Components/ProPanel/BitProPanel.razorsrc/BlazorUI/Bit.BlazorUI.Extras/Components/ProPanel/BitProPanel.razor.cssrc/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/ProPanel/BitProPanelDemo.razorsrc/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/ProPanel/BitProPanelDemo.razor.cs
closes #12246
Summary by CodeRabbit
CloseIconandCloseIconNameparameters