Parcourir la source

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 il y a 4 ans
Parent
commit
3e278d8d02
1 fichiers modifiés avec 6 ajouts et 1 suppressions
  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 = (
 const getSpinnerUrl = (
   smallCircleColor: string,
   smallCircleColor: string,
-  useWhiteBackground: boolean | null | undefined,
+  useWhiteBackground?: boolean | null,
 ) => `url('data:image/svg+xml;utf8,${encodeURIComponent(progressImage(Palette.grayscale[3], smallCircleColor, useWhiteBackground))}');`
 ) => `url('data:image/svg+xml;utf8,${encodeURIComponent(progressImage(Palette.grayscale[3], smallCircleColor, useWhiteBackground))}');`
 
 
 const getRunningImageUrl = (props: Props) => {
 const getRunningImageUrl = (props: Props) => {
@@ -65,6 +65,11 @@ const statuses = (status: any, props: Props) => {
         background-image: ${getRunningImageUrl(props)};
         background-image: ${getRunningImageUrl(props)};
         ${StyleProps.animations.rotation}
         ${StyleProps.animations.rotation}
       `
       `
+    case 'DELETING':
+      return css`
+        background-image: ${getSpinnerUrl(Palette.alert)};
+        ${StyleProps.animations.rotation}
+      `
     case 'CANCELLING':
     case 'CANCELLING':
     case 'CANCELLING_AFTER_COMPLETION':
     case 'CANCELLING_AFTER_COMPLETION':
       return css`
       return css`