import { ActivityState } from '@ulangi/ulangi-common/enums' ; import { IObservableValue } from 'mobx' ; import { observer } from 'mobx-react' ; import * as React from 'react' ; import { ActivityIndicator , ActivityIndicatorProperties } from 'react-native' ; export type DefaultActivityIndicatorProps = { activityState : IObservableValue < ActivityState > ; isRefreshing ? : IObservableValue < boolean > ; } & ActivityIndicatorProperties ; @ observer export class DefaultActivityIndicator extends React . Component < DefaultActivityIndicatorProps > { public render ( ) { if ( this . props . activityState . get ( ) === ActivityState . ACTIVE && ( typeof this . props . isRefreshing === 'undefined' || this . props . isRefreshing . get ( ) === false ) ) { return < ActivityIndicator { ... this . props } / > ; } else { return null ; } } }