Skip to content

feat:action icon allow to hide bg color T1366#2312

Merged
hammond-lj merged 1 commit intodevelopfrom
feat/action-icon-bg-props
Dec 22, 2025
Merged

feat:action icon allow to hide bg color T1366#2312
hammond-lj merged 1 commit intodevelopfrom
feat/action-icon-bg-props

Conversation

@hammond-lj
Copy link
Copy Markdown
Contributor

@hammond-lj hammond-lj commented Dec 22, 2025

Related Issues: T1366

Copy link
Copy Markdown
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 adds a withBackground prop to four action icon components, allowing consumers to conditionally hide the background rectangle. The prop defaults to true to maintain backward compatibility.

  • Added optional withBackground prop to ActionUpdateRecord, ActionSendEmail, ActionHttpRequest, and ActionAI components
  • Wrapped background rect elements in conditional rendering based on the withBackground prop
  • Maintained backward compatibility by defaulting withBackground to true

Reviewed changes

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

File Description
packages/icons/src/components/ActionUpdateRecord.tsx Added withBackground prop with conditional rendering for the background rect
packages/icons/src/components/ActionSendEmail.tsx Added withBackground prop with conditional rendering for the background rect
packages/icons/src/components/ActionHttpRequest.tsx Added withBackground prop with conditional rendering for the background rect
packages/icons/src/components/ActionAI.tsx Added withBackground prop with conditional rendering for the background rect

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

{...props}
>
<rect width="24" height="24" fill="#FEE2E2" fillOpacity="0.1" />
{withBackground && <rect width={24} height={24} fill="#FEE2E2" fillOpacity="0.1" />}
Copy link

Copilot AI Dec 22, 2025

Choose a reason for hiding this comment

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

The width and height attributes on the rect element should use string values ("24") instead of expression values ({24}) for consistency with the other updated files (ActionUpdateRecord, ActionSendEmail, and ActionAI). In JSX, both forms work, but string values are preferred for static numeric values and maintain consistency across the codebase.

Suggested change
{withBackground && <rect width={24} height={24} fill="#FEE2E2" fillOpacity="0.1" />}
{withBackground && <rect width="24" height="24" fill="#FEE2E2" fillOpacity="0.1" />}

Copilot uses AI. Check for mistakes.
@hammond-lj hammond-lj closed this Dec 22, 2025
@github-actions
Copy link
Copy Markdown
Contributor

🧹 Preview Environment Cleanup

@Sky-FE Sky-FE reopened this Dec 22, 2025
@hammond-lj hammond-lj merged commit 15ff75e into develop Dec 22, 2025
18 checks passed
@hammond-lj hammond-lj deleted the feat/action-icon-bg-props branch December 22, 2025 08:11
@github-actions
Copy link
Copy Markdown
Contributor

🧹 Preview Environment Cleanup

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.

3 participants