From 73a5588bfd8c46978a83b8841a94d402a8ff8211 Mon Sep 17 00:00:00 2001 From: Joe Banks 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(-) 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 = { + "dot": DotLoader, + "hash": HashLoader, + "rotate": RotateLoader +} + function Loading() { + let Loader = loaders[localStorage.loader ? localStorage.loader : "dot"]; return
- +
} -- cgit v1.2.3 From a4e7f8304db77028d4809db90ee377f6989367c3 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Mon, 5 Oct 2020 13:57:10 +0100 Subject: Experiment concluded that hash the best choice --- src/pages/FormPage.tsx | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/pages/FormPage.tsx b/src/pages/FormPage.tsx index 90474f4..a675f8e 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, HashLoader, RotateLoader } from "react-spinners"; +import { HashLoader } from "react-spinners"; import { useParams } from "react-router"; import HeaderBar from "../components/HeaderBar"; @@ -13,18 +13,11 @@ interface PathParams { id: string } -const loaders: Record = { - "dot": DotLoader, - "hash": HashLoader, - "rotate": RotateLoader -} - function Loading() { - let Loader = loaders[localStorage.loader ? localStorage.loader : "dot"]; return
- +
} -- cgit v1.2.3