Skip to content
Snippets Groups Projects
  • Joel Jeremy Marquez's avatar
    6fae7956
    Some typescript migration (#1532) · 6fae7956
    Joel Jeremy Marquez authored
    * Typescript migration
    
    * Release notes
    
    * Update error boundary
    
    * Breakup sidebar components
    
    * Account and Sidebar props
    
    * Remove button in Item component + exports cleanup
    
    * Put accountNameStyle to Account
    
    * Revert component ports (separated to another PR)
    
    * Export cleanup
    
    * Remove ErrorBoundary (separated to another PR)
    
    * Sidebar budgetName as ReactNode
    Some typescript migration (#1532)
    Joel Jeremy Marquez authored
    * Typescript migration
    
    * Release notes
    
    * Update error boundary
    
    * Breakup sidebar components
    
    * Account and Sidebar props
    
    * Remove button in Item component + exports cleanup
    
    * Put accountNameStyle to Account
    
    * Revert component ports (separated to another PR)
    
    * Export cleanup
    
    * Remove ErrorBoundary (separated to another PR)
    
    * Sidebar budgetName as ReactNode
AnimatedRefresh.tsx 644 B
import React, { type CSSProperties } from 'react';

import { keyframes } from 'glamor';

import Refresh from '../icons/v1/Refresh';

import View from './common/View';

let spin = keyframes({
  '0%': { transform: 'rotateZ(0deg)' },
  '100%': { transform: 'rotateZ(360deg)' },
});

type AnimatedRefreshProps = {
  animating: boolean;
  iconStyle?: CSSProperties;
};

export default function AnimatedRefresh({
  animating,
  iconStyle,
}: AnimatedRefreshProps) {
  return (
    <View
      style={[{ animation: animating ? `${spin} 1s infinite linear` : null }]}
    >
      <Refresh width={14} height={14} style={iconStyle} />
    </View>
  );
}