From 73a5588bfd8c46978a83b8841a94d402a8ff8211 Mon Sep 17 00:00:00 2001
From: Joe Banks <joseph@josephbanks.me>
Date: Mon, 5 Oct 2020 13:52:15 +0100
Subject: Add experiment for loading pages

---
 src/pages/FormPage.tsx | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

(limited to 'src/pages/FormPage.tsx')

diff --git a/src/pages/FormPage.tsx b/src/pages/FormPage.tsx
index 45c093a..90474f4 100644
--- a/src/pages/FormPage.tsx
+++ b/src/pages/FormPage.tsx
@@ -2,7 +2,7 @@
 import { jsx } from "@emotion/core";
 import { Link } from "react-router-dom";
 
-import { DotLoader } from "react-spinners";
+import { DotLoader, HashLoader, RotateLoader } from "react-spinners";
 
 import { useParams } from "react-router";
 import HeaderBar from "../components/HeaderBar";
@@ -13,11 +13,18 @@ interface PathParams {
     id: string
 }
 
+const loaders: Record<string, any> = {
+    "dot": DotLoader,
+    "hash": HashLoader,
+    "rotate": RotateLoader
+}
+
 function Loading() {
+    let Loader = loaders[localStorage.loader ? localStorage.loader : "dot"];
     return <div>
         <HeaderBar title={"Loading..."}/>
         <div css={{display: "flex", justifyContent: "center"}}>
-            <DotLoader color="white"/>
+            <Loader color="white"/>
         </div>
     </div>
 }
-- 
cgit v1.2.3

