AppLoading.jsx 613 B

1234567891011121314151617181920212223242526272829
  1. import React from "react";
  2. import { Spin } from "antd";
  3. const AppLoading = (props) => {
  4. const { text, loading, children: ChildComponents } = props;
  5. return (
  6. <div
  7. style={{
  8. display: "flex",
  9. justifyContent: "center",
  10. alignItems: "center",
  11. height: "100vh",
  12. }}
  13. >
  14. <Spin
  15. spinning={loading}
  16. size="large"
  17. delay={5}
  18. tip={text || "Cargando aplicación..."}
  19. >
  20. {loading ? <div style={{ height: "100vh" }} /> : ChildComponents}
  21. </Spin>
  22. </div>
  23. );
  24. };
  25. export default AppLoading;