From 94b6c521ea29059b1ad134a3e57fa3ee3c452cda Mon Sep 17 00:00:00 2001 From: Michael Fatemi Date: Sat, 3 Jul 2021 01:10:57 -0400 Subject: [PATCH] center text in authenticator --- .../Authentication/Authenticator.tsx | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/components/Authentication/Authenticator.tsx b/src/components/Authentication/Authenticator.tsx index 58ad628..641ce30 100644 --- a/src/components/Authentication/Authenticator.tsx +++ b/src/components/Authentication/Authenticator.tsx @@ -40,14 +40,26 @@ export default function Authenticator() { refresh(); }, [token, refresh]); + let children: JSX.Element; + if (pending) { - return

Signing In

; + children =

Signing In

; + } else if (token) { + children = ; + } else { + // If we aren't pending anymore, but don't have a token, we must have errored + children =

Sign In Error

; } - if (token) { - return ; - } - - // If we aren't pending anymore, but don't have a token, we must have errored - return

Sign In Error

; + return ( +
+ {children} +
+ ); }