feat: tweak ui for redirect screen (#23)

This commit is contained in:
Dominic Elm
2024-07-31 14:13:52 +02:00
committed by GitHub
parent e5ed23c33d
commit 836f46b34d
2 changed files with 37 additions and 5 deletions

View File

@@ -8,6 +8,7 @@ import {
import { useFetcher, useLoaderData } from '@remix-run/react';
import { auth, type AuthAPI } from '@webcontainer/api';
import { useEffect, useState } from 'react';
import { LoadingDots } from '~/components/ui/LoadingDots';
import { createUserSession, isAuthenticated, validateAccessToken } from '~/lib/.server/sessions';
import { CLIENT_ID, CLIENT_ORIGIN } from '~/lib/constants';
import { request as doRequest } from '~/lib/fetch';
@@ -96,12 +97,16 @@ export default function Login() {
return (
<div className="min-h-screen flex items-center justify-center">
<div className="max-w-md w-full space-y-8 p-10 bg-white rounded-lg shadow">
<div>
<h2 className="mt-6 text-center text-3xl font-extrabold text-gray-900">Login</h2>
{redirected ? (
<LoadingDots text="Authenticating" />
) : (
<div className="max-w-md w-full space-y-8 p-10 bg-white rounded-lg shadow">
<div>
<h2 className="mt-6 text-center text-3xl font-extrabold text-gray-900">Login</h2>
</div>
<LoginForm />
</div>
{redirected ? 'Processing auth...' : <LoginForm />}
</div>
)}
</div>
);
}