-
Notifications
You must be signed in to change notification settings - Fork 567
[SDK] ensure that the default spinner stroke color gets inherited from the parentnode #7157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SDK] ensure that the default spinner stroke color gets inherited from the parentnode #7157
Conversation
🦋 Changeset detectedLatest commit: be0f973 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
WalkthroughThis change makes the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Button
participant Spinner
User->>Button: Initiate loading state (e.g., get price quote)
Button->>Spinner: Render Spinner (size="sm", color optional)
Spinner->>Button: Display spinner (uses provided color or defaults)
Button->>User: Shows loading spinner with correct color
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@RobbyUitbeijerse is attempting to deploy a commit to the thirdweb Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a lil changeset?
pnpm changeset from the root of the repo, press enter until you get to enter the msg
Done! Will include that in every future PR. |
In a few cases the got an explicit color passed, eg
accentButtonText
, but this isn't great if the element in which is rendered has a variant or style prop that affects the color property of said element, as the Spinner will simply keep rendering in the color you passed it, unless you also dynamically switch the color property of the Spinner in similar fashion to the parent.In the case of the FiatScreenContent and SwapScreenContent, the Button component that's rendered switches between the 'accent' and 'outline' variant when the buttons are disabled, which causes the Spinner to render the 'accentButtonText' color even though the 'outline' variant of the Button was active.
I considered two ways of fixing this
1 Removing the variant switching
2 Simply allowing the Spinner to inherit the color of the parent node
The latter seemed like the most flexible solution. The current color property on the Spinner is required so there's no risk in breaking any existing instance of the Spinner component, and it allows for simpler usage without explicit color passing.
Let me know if you prefer option 1 here, or whenever you see a different solution, happy to adjust where needed.
PR-Codex overview
This PR focuses on updating the
Spinner
component by making thecolor
prop optional and setting its default stroke color tocurrentColor
. This change simplifies the usage of theSpinner
in different contexts, particularly in theFiatScreenContent
andSwapScreenContent
components.Detailed summary
Spinner
component to make thecolor
prop optional.Spinner
tocurrentColor
.color
prop fromSpinner
instances inFiatScreenContent.tsx
andSwapScreenContent.tsx
.Summary by CodeRabbit