fix(component): loading in button should be white for primary variant (#10073)

close AF-2178
This commit is contained in:
CatsJuice
2025-02-13 08:55:11 +00:00
parent 312f9b1ecd
commit 7c04ef4f4e
2 changed files with 19 additions and 3 deletions
@@ -8,12 +8,14 @@ export interface LoadingProps {
size?: number | string;
speed?: number;
progress?: number;
strokeColor?: string;
}
export const Loading = ({
size,
speed = 1.2,
progress = 0.2,
strokeColor,
}: LoadingProps) => {
// allow `string` such as `16px` | `100%` | `1em`
const sizeWithUnit = size ? withUnit(size, 'px') : '16px';
@@ -43,10 +45,11 @@ export const Loading = ({
cy={12}
r={8}
strokeWidth={4}
stroke="var(--affine-primary-color)"
stroke={strokeColor || 'var(--affine-primary-color)'}
strokeDasharray={`${2 * Math.PI * 8 * progress} ${
2 * Math.PI * 8 * (1 - progress)
}`}
strokeLinecap="round"
/>
</svg>
);