2018-02-08 17:51:15 +00:00
import React from 'react' ;
import { CSSTransition } from 'react-transition-group' ;
import { Spinner } from 'components/ui' ;
import './InlineSpinner.scss' ;
2018-02-08 23:44:30 +00:00
interface Props {
2018-02-08 17:51:15 +00:00
active : boolean ;
text? : string ;
2018-02-08 23:44:30 +00:00
}
export const InlineSpinner : React.SFC < Props > = ( { active , text } ) = > (
< CSSTransition in = { active } timeout = { 300 } classNames = "InlineSpinner--fade" >
2018-02-08 17:51:15 +00:00
{ /* TODO: when react-transition-group v2.3 releases, use '-done' classes instead of conditional 'active' class https://github.com/reactjs/react-transition-group/issues/274 */ }
2018-02-08 23:44:30 +00:00
< div className = "InlineSpinner small" >
2018-02-08 17:51:15 +00:00
{ text }
< Spinner / >
< / div >
< / CSSTransition >
) ;