ソースを参照

Add new status for spinner animation

The loading spinner component can now have the alert color when using
the “DELETING” status for it.
Sergiu Miclea 4 年 前
コミット
3e278d8d02
1 ファイル変更6 行追加1 行削除
  1. 6 1
      src/components/atoms/StatusIcon/StatusIcon.tsx

+ 6 - 1
src/components/atoms/StatusIcon/StatusIcon.tsx

@@ -41,7 +41,7 @@ type Props = {
 
 const getSpinnerUrl = (
   smallCircleColor: string,
-  useWhiteBackground: boolean | null | undefined,
+  useWhiteBackground?: boolean | null,
 ) => `url('data:image/svg+xml;utf8,${encodeURIComponent(progressImage(Palette.grayscale[3], smallCircleColor, useWhiteBackground))}');`
 
 const getRunningImageUrl = (props: Props) => {
@@ -65,6 +65,11 @@ const statuses = (status: any, props: Props) => {
         background-image: ${getRunningImageUrl(props)};
         ${StyleProps.animations.rotation}
       `
+    case 'DELETING':
+      return css`
+        background-image: ${getSpinnerUrl(Palette.alert)};
+        ${StyleProps.animations.rotation}
+      `
     case 'CANCELLING':
     case 'CANCELLING_AFTER_COMPLETION':
       return css`