This commit is contained in:
Vyacheslav Matyukhin 2022-07-23 22:03:50 +04:00
parent ce31dc62c2
commit 111b4975ee
No known key found for this signature in database
GPG Key ID: 3D2A774C5489F96C
2 changed files with 16 additions and 14 deletions

View File

@ -3,13 +3,15 @@ import { RefreshIcon } from "@heroicons/react/solid";
import styles from "./FallbackSpinner.module.css"; import styles from "./FallbackSpinner.module.css";
export const FallbackSpinner = ({ height }) => { export const FallbackSpinner = ({ height }) => {
const [show, setShow] = useState(false); const [show, setShow] = useState(false);
useEffect(() => { useEffect(() => {
setTimeout(() => { setTimeout(() => {
setShow(true); setShow(true);
}, 500); }, 500);
}, []); }, []);
return <div className={styles.container} style={{height}}>{ return (
show ? <RefreshIcon className={styles.icon} /> : null <div className={styles.container} style={{ height }}>
}</div>; {show ? <RefreshIcon className={styles.icon} /> : null}
</div>
);
}; };

View File

@ -1,9 +1,9 @@
.container { .container {
/* height must be set explicitly */ /* height must be set explicitly */
width: 100%; width: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.icon { .icon {