Skip to content

[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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fast-onions-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"thirdweb": patch
---

default the spinner stroke color to currentColor and make the color prop optional
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ export function FiatScreenContent(props: {
{fiatQuoteQuery.isLoading ? (
<>
Getting price quote
<Spinner size="sm" color="accentButtonText" />
<Spinner size="sm" />
</>
) : (
"Continue"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ export function SwapScreenContent(props: {
{quoteQuery.isLoading ? (
<>
Getting price quote
<Spinner size="sm" color="accentButtonText" />
<Spinner size="sm" />
</>
) : (
"Continue"
Expand Down
4 changes: 2 additions & 2 deletions packages/thirdweb/src/react/web/ui/components/Spinner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { StyledCircle, StyledSvg } from "../design-system/elements.js";
* @internal
*/
export const Spinner: React.FC<{
color: keyof Theme["colors"];
size: keyof typeof iconSize;
color?: keyof Theme["colors"];
}> = (props) => {
const theme = useCustomTheme();
return (
Expand All @@ -26,7 +26,7 @@ export const Spinner: React.FC<{
cy="25"
r="20"
fill="none"
stroke={theme.colors[props.color]}
stroke={props.color ? theme.colors[props.color] : "currentColor"}
strokeWidth={Number(iconSize[props.size]) > 64 ? "2" : "4"}
/>
</Svg>
Expand Down