From a092b4e9c8ca1a042e42d96ece57096636e3c513 Mon Sep 17 00:00:00 2001 From: Viktor Barzin Date: Tue, 17 Jun 2025 19:15:18 +0000 Subject: [PATCH] disable login button whilst logging in --- crawler/frontend/Dockerfile | 2 +- crawler/frontend/src/components/LoginModal.tsx | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/crawler/frontend/Dockerfile b/crawler/frontend/Dockerfile index 616beca..a1a7089 100644 --- a/crawler/frontend/Dockerfile +++ b/crawler/frontend/Dockerfile @@ -12,7 +12,7 @@ RUN npm ci # Copy all files and build COPY . . -RUN npm run build # TODO: MOVE ME BELOW +RUN npm run build FROM nginx:alpine diff --git a/crawler/frontend/src/components/LoginModal.tsx b/crawler/frontend/src/components/LoginModal.tsx index 36f69f0..be6377c 100644 --- a/crawler/frontend/src/components/LoginModal.tsx +++ b/crawler/frontend/src/components/LoginModal.tsx @@ -1,6 +1,6 @@ import { login } from '@/auth/authService'; import { Button } from "@/components/ui/button"; -import React from 'react'; +import React, { useState } from 'react'; import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from './ui/dialog'; interface ModalProps { @@ -11,6 +11,7 @@ const Modal: React.FC = ({ isOpen, }) => { if (!isOpen) return null; + const [isLoading, setIsLoading] = useState(false) return ( @@ -20,7 +21,15 @@ const Modal: React.FC = ({ Login to Wrongmove - + {isLoading && ( +
Signing in. Please wait...
+ ) + } +