From 57da79392a02f904ed6d14d2807499cf87cfb54c Mon Sep 17 00:00:00 2001 From: Prateek Shourya Date: Wed, 1 May 2024 18:35:02 +0530 Subject: [PATCH] chore: minor ui updates and validation fix. --- admin/app/login/components/sign-in-form.tsx | 1 + admin/app/setup/components/sign-up-form.tsx | 2 +- space/components/accounts/auth-forms/unique-code.tsx | 10 +++++----- web/components/account/auth-forms/sign-up-root.tsx | 2 +- web/components/onboarding/create-workspace.tsx | 5 +++-- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/admin/app/login/components/sign-in-form.tsx b/admin/app/login/components/sign-in-form.tsx index ba0883c83..c28d0f27b 100644 --- a/admin/app/login/components/sign-in-form.tsx +++ b/admin/app/login/components/sign-in-form.tsx @@ -113,6 +113,7 @@ export const InstanceSignInForm: FC = (props) => { placeholder="name@company.com" value={formData.email} onChange={(e) => handleFormChange("email", e.target.value)} + autoFocus /> diff --git a/admin/app/setup/components/sign-up-form.tsx b/admin/app/setup/components/sign-up-form.tsx index a8bb8982e..8ef8add62 100644 --- a/admin/app/setup/components/sign-up-form.tsx +++ b/admin/app/setup/components/sign-up-form.tsx @@ -291,7 +291,7 @@ export const InstanceSignUpForm: FC = (props) => { - + See More diff --git a/space/components/accounts/auth-forms/unique-code.tsx b/space/components/accounts/auth-forms/unique-code.tsx index 9bbf392a7..525430bc6 100644 --- a/space/components/accounts/auth-forms/unique-code.tsx +++ b/space/components/accounts/auth-forms/unique-code.tsx @@ -1,7 +1,10 @@ import React, { useEffect, useState } from "react"; // hooks -// types +import useTimer from "hooks/use-timer"; +import useToast from "hooks/use-toast"; import { useRouter } from "next/router"; +// types +import { IEmailCheckData } from "types/auth"; // icons import { CircleCheck, XCircle } from "lucide-react"; // ui @@ -10,9 +13,6 @@ import { Button, Input } from "@plane/ui"; import { API_BASE_URL } from "@/helpers/common.helper"; // services import { AuthService } from "@/services/authentication.service"; -import useTimer from "hooks/use-timer"; -import useToast from "hooks/use-toast"; -import { IEmailCheckData } from "types/auth"; import { EAuthModes } from "./root"; type Props = { @@ -175,8 +175,8 @@ export const UniqueCodeForm: React.FC = (props) => { variant="primary" className="w-full" size="lg" - // disabled={!isValid || hasEmailChanged} loading={isRequestingNewCode} + disabled={isRequestingNewCode || !uniqueCodeFormData.code} > {isRequestingNewCode ? "Sending code" : submitButtonText} diff --git a/web/components/account/auth-forms/sign-up-root.tsx b/web/components/account/auth-forms/sign-up-root.tsx index 1be27e38c..55f3ffc99 100644 --- a/web/components/account/auth-forms/sign-up-root.tsx +++ b/web/components/account/auth-forms/sign-up-root.tsx @@ -91,7 +91,7 @@ export const SignUpAuthRoot: FC = observer(() => { ); return ( -
+
= (props) => { handleSubmit, control, setValue, - formState: { errors, isSubmitting }, + formState: { errors, isSubmitting, isValid }, } = useForm({ defaultValues: { name: "", @@ -177,6 +177,7 @@ export const CreateWorkspace: React.FC = (props) => { ref={ref} hasError={Boolean(errors.name)} className="w-full border-onboarding-border-100 placeholder:text-custom-text-400" + autoFocus />
)} @@ -255,7 +256,7 @@ export const CreateWorkspace: React.FC = (props) => { )}
-