From 1a251ac12b4d048ce630a6b50a62025c1931758b Mon Sep 17 00:00:00 2001 From: Jaydeep Dave Date: Tue, 2 Dec 2025 14:19:42 +0530 Subject: [PATCH 1/2] few fixed --- src/components/LoginForm.tsx | 14 +++++- src/pages/Scenarios.tsx | 84 ++++++++++++++++++++++++++++-------- 2 files changed, 78 insertions(+), 20 deletions(-) diff --git a/src/components/LoginForm.tsx b/src/components/LoginForm.tsx index cf7faef..1157367 100644 --- a/src/components/LoginForm.tsx +++ b/src/components/LoginForm.tsx @@ -12,6 +12,7 @@ const LoginForm: React.FC = () => { const [showPassword, setShowPassword] = useState(false); const [isLoading, setIsLoading] = useState(false); const [selectedUser, setSelectedUser] = useState(''); + const [errorMessage, setErrorMessage] = useState(null); const { login } = useUser(); const navigate = useNavigate(); @@ -23,15 +24,16 @@ const LoginForm: React.FC = () => { const matchedUser = userProfiles.find(u => u.email === email && u.password === password); if (!matchedUser) { setIsLoading(false); - alert('Login failed. Please check your credentials.'); + setErrorMessage('Login failed. Please check your credentials.'); return; } const success = await login(matchedUser.userId.toString(), email); setIsLoading(false); if (success) { + setErrorMessage(null); navigate('/products'); } else { - alert('Login failed. Please check your credentials.'); + setErrorMessage('Login failed. Please check your credentials.'); } }; @@ -51,6 +53,14 @@ const LoginForm: React.FC = () => { {/* Quick user selector keeps demo credentials handy */}
+ {errorMessage && ( +
+ {errorMessage} +
+ )}
{ title: 'Demo notification', description: 'Content Description button clicked!', className: toastStyles, - duration: 500 + duration: 5000 })} > Submit @@ -116,22 +166,20 @@ const Scenarios: React.FC = () => {
+ {lastCopiedLink && ( +
+ Last copied: {lastCopiedLink} +
+ )} From 8519bed3b70dc36e2989b7f4783e0262415fdb8e Mon Sep 17 00:00:00 2001 From: Jaydeep Dave Date: Tue, 2 Dec 2025 20:34:30 +0530 Subject: [PATCH 2/2] fixing redirection issue --- public/404.html | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/public/404.html b/public/404.html index e31cd0b..8f017f3 100644 --- a/public/404.html +++ b/public/404.html @@ -3,22 +3,24 @@ - Redirecting... + Loading... -

Redirecting to the app...

+

Loading the application…