aboutsummaryrefslogtreecommitdiff
path: root/src/shared/loader.hoc.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/loader.hoc.js')
-rw-r--r--src/shared/loader.hoc.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/shared/loader.hoc.js b/src/shared/loader.hoc.js
new file mode 100644
index 0000000..c60089e
--- /dev/null
+++ b/src/shared/loader.hoc.js
@@ -0,0 +1,16 @@
+import React from 'react';
+import "./loader.css";
+const WithLoader = HocComponent => {
+ return function ({ ...props }) {
+ return (
+ <div className="loader-container">
+ {props.isLoading && (
+ <div className="loader"></div>
+ )}
+ <HocComponent {...props} />
+ </div>
+ );
+ };
+};
+
+export default WithLoader; \ No newline at end of file