Add a refresh button and make it spinable.
This also adds a HOC that makes icons spinable.master
parent
199cc5771c
commit
6687758a3a
@ -0,0 +1,15 @@
|
||||
.withSpin-spin {
|
||||
animation: withSpin-spin 2s infinite linear;
|
||||
}
|
||||
|
||||
@keyframes withSpin-spin {
|
||||
0% {
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: rotate(359deg);
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,18 @@
|
||||
import * as React from 'react';
|
||||
import { pure } from 'recompose';
|
||||
|
||||
import './withSpin.css';
|
||||
|
||||
const withSpin = (Component: any) => {
|
||||
return pure((_props: any) => {
|
||||
const {
|
||||
spin,
|
||||
...props,
|
||||
} = _props;
|
||||
return (
|
||||
<Component {...props} className={spin ? 'withSpin-spin' : ''} />
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
export default withSpin;
|
Loading…
Reference in New Issue