From bd1877d262b3ce6350ebf48f17df91dc3fe497d1 Mon Sep 17 00:00:00 2001 From: Anand Suthar Date: Wed, 14 Aug 2024 22:42:46 +0530 Subject: [PATCH] feat(auth/login): Display toast message for role selection during demo login --- app/(pages)/(auth)/login/page.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/(pages)/(auth)/login/page.tsx b/app/(pages)/(auth)/login/page.tsx index ae05991..e8dfaf9 100644 --- a/app/(pages)/(auth)/login/page.tsx +++ b/app/(pages)/(auth)/login/page.tsx @@ -231,10 +231,15 @@ export default function Login() { type="button" className="w-full sm:w-1/3 bg-white text-black font-semibold py-3 rounded-lg border-2 border-black transition duration-300 ease-in-out hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-opacity-50" onClick={() => - handleDemoUserLogin( - Array.from(role)[0] as string, - redirectDemoUser - ) + !isRoleValid + ? toast.error("Please select a role to try the demo.", { + position: "bottom-center", + duration: 2000, + }) + : handleDemoUserLogin( + Array.from(role)[0] as string, + redirectDemoUser + ) } > Try Demo