From 85e4c5349b674e308552e894cf09a88830043c61 Mon Sep 17 00:00:00 2001 From: Thomas Ruoff Date: Fri, 25 Dec 2020 00:22:02 +0100 Subject: [PATCH] add spinner and loading wrapper --- components/loading.tsx | 20 ++++++++++++++++++++ components/spinner.tsx | 24 ++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 components/loading.tsx create mode 100644 components/spinner.tsx diff --git a/components/loading.tsx b/components/loading.tsx new file mode 100644 index 0000000..fb53a3d --- /dev/null +++ b/components/loading.tsx @@ -0,0 +1,20 @@ +import Spinner from './spinner' + +export default function Loading({ + loading, + children, +}: { + loading: boolean + children: any +}) { + return ( +
+
{children}
+ {loading && ( +
+ +
+ )} +
+ ) +} diff --git a/components/spinner.tsx b/components/spinner.tsx new file mode 100644 index 0000000..4adcc23 --- /dev/null +++ b/components/spinner.tsx @@ -0,0 +1,24 @@ +export default function Spinner() { + return ( + + + + + ) +}