bugfix - resolved modal form ui issue

This commit is contained in:
James Wyndham 2024-02-22 05:26:01 +08:00
parent 2e621d0d6c
commit 0cd8f39a40
2 changed files with 146 additions and 136 deletions

View File

@ -44,7 +44,8 @@ const FormLeftDescriptionRightContactUs = () => {
<h2 className="mb-8 text-xl font-semibold text-base-content "> <h2 className="mb-8 text-xl font-semibold text-base-content ">
Fill in the form Fill in the form
</h2> </h2>
{!localStorage.getItem("contactus") ? ( {typeof window !== "undefined" &&
!localStorage.getItem("contactus") ? (
<form onSubmit={handleSubmit(onSubmit)}> <form onSubmit={handleSubmit(onSubmit)}>
<div className="grid gap-4 gap-y-0"> <div className="grid gap-4 gap-y-0">
{/* Grid */} {/* Grid */}

View File

@ -38,7 +38,7 @@ function ModalSignUp() {
<div className="flex justify-end pb-2 select-none"> <div className="flex justify-end pb-2 select-none">
<label <label
htmlFor="sign-up-modal" htmlFor="sign-up-modal"
className="cursor-pointer" className="cursor-pointer text-base-content"
onClick={() => { onClick={() => {
reset(); reset();
}} }}
@ -46,8 +46,9 @@ function ModalSignUp() {
<Icon name="Dismiss20Filled" size="medium" /> <Icon name="Dismiss20Filled" size="medium" />
</label> </label>
</div> </div>
<div className="flex flex-grow flex-col h-[30rem] lg:h-full overflow-y-scroll">
<div <div
className="w-[100%] bg-gradient-to-r from-primary to-secondary px-6 pt-2 mt-3 pb-6 rounded-lg" className="w-[100%] bg-gradient-to-r from-primary to-secondary px-6 mt-3 pb-6 rounded-lg"
data-aos="fade-up" data-aos="fade-up"
> >
<h3 className="pb-1 text-3xl font-bold md:text-3xl pt-6"> <h3 className="pb-1 text-3xl font-bold md:text-3xl pt-6">
@ -66,27 +67,29 @@ function ModalSignUp() {
> >
<div className="relative mt-6"> <div className="relative mt-6">
<input <input
{...register("email")}
type="text" type="text"
id="SignUpEmail" id="SignUpEmail"
className="py-3 px-4 block w-full bg-base-200 text-base-content border-white rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none " className="py-3 px-4 block w-full bg-base-200 text-base-content border-white rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none "
placeholder="Email…" placeholder="Email…"
aria-label="Email…" aria-label="Email…"
autoComplete="on" autoComplete="on"
{...register("email")}
/> />
<div className="text-start text-sm italic text-error-content"> <div className="text-start text-sm italic text-error-content">
{errors.email?.message}&nbsp; {errors.email?.message}&nbsp;
</div> </div>
</div> </div>
<div className="flex flex-row gap-4">
<div className="relative mt-1"> <div className="relative mt-1">
<input <input
{...register("firstName")}
id="SignUpFirstName" id="SignUpFirstName"
type="text" type="text"
className="py-3 px-4 block w-full bg-base-200 text-base-content border-white rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none " className="py-3 px-4 block w-full bg-base-200 text-base-content border-white rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none "
placeholder="First Name…" placeholder="First Name…"
aria-label="First Name…" aria-label="First Name…"
autoComplete="on" autoComplete="on"
{...register("firstName")}
/> />
<div className="text-start text-sm italic text-error-content"> <div className="text-start text-sm italic text-error-content">
{errors.firstName?.message}&nbsp; {errors.firstName?.message}&nbsp;
@ -94,39 +97,41 @@ function ModalSignUp() {
</div> </div>
<div className="relative mt-1"> <div className="relative mt-1">
<input <input
{...register("lastName")}
id="SignUpLastName" id="SignUpLastName"
type="text" type="text"
className="py-3 px-4 block w-full bg-base-200 text-base-content border-white rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none " className="py-3 px-4 block w-full bg-base-200 text-base-content border-white rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none "
placeholder="Last Name…" placeholder="Last Name…"
aria-label="Last Name…" aria-label="Last Name…"
{...register("lastName")}
/> />
<div className="text-start text-sm italic text-error-content"> <div className="text-start text-sm italic text-error-content">
{errors.lastName?.message}&nbsp; {errors.lastName?.message}&nbsp;
</div> </div>
</div> </div>
</div>
<div className="relative mt-1"> <div className="relative mt-1">
<input <input
{...register("phoneNumber")}
id="SignUpPhoneNumber" id="SignUpPhoneNumber"
type="text" type="text"
className="py-3 px-4 block w-full bg-base-200 text-base-content border-white rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none " className="py-3 px-4 block w-full bg-base-200 text-base-content border-white rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none "
placeholder="Phone Number…" placeholder="Phone Number…"
aria-label="Phone Number…" aria-label="Phone Number…"
{...register("phoneNumber")}
/> />
<div className="text-start text-sm italic text-error-content"> <div className="text-start text-sm italic text-error-content">
{errors.phoneNumber?.message}&nbsp; {errors.phoneNumber?.message}&nbsp;
</div> </div>
</div> </div>
<div className="flex flex-row gap-4">
<div className="relative mt-1"> <div className="relative mt-1">
<input <input
{...register("organisation")}
id="SignUpOrganisation" id="SignUpOrganisation"
type="text" type="text"
className="py-3 px-4 block w-full bg-base-200 text-base-content border-white rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none " className="py-3 px-4 block w-full bg-base-200 text-base-content border-white rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none "
placeholder="Organisation…" placeholder="Organisation…"
aria-label="Organisation…" aria-label="Organisation…"
{...register("organisation")}
/> />
<div className="text-start text-sm italic text-error-content"> <div className="text-start text-sm italic text-error-content">
{errors.organisation?.message}&nbsp; {errors.organisation?.message}&nbsp;
@ -134,10 +139,10 @@ function ModalSignUp() {
</div> </div>
<div className="relative mt-1"> <div className="relative mt-1">
<select <select
{...register("organisationSize")}
id="SignUpCompanySize" id="SignUpCompanySize"
defaultValue={""} defaultValue={""}
className="py-3 px-4 block w-full bg-base-200 text-base-content border-white rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none " className="py-3 px-4 block w-full bg-base-200 text-base-content border-white rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none "
{...register("organisationSize")}
> >
<option className="bg-gray-850" value={""} disabled> <option className="bg-gray-850" value={""} disabled>
Company Size Company Size
@ -158,14 +163,16 @@ function ModalSignUp() {
{errors.organisationSize?.message}&nbsp; {errors.organisationSize?.message}&nbsp;
</div> </div>
</div> </div>
</div>
<div className="flex flex-row gap-4">
<div className="relative mt-1"> <div className="relative mt-1">
<input <input
{...register("password")}
id="SignUpPwd" id="SignUpPwd"
type="password" type="password"
className="py-3 px-4 block w-full bg-base-200 text-base-content border-white rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none " className="py-3 px-4 block w-full bg-base-200 text-base-content border-white rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none "
placeholder="Password..." placeholder="Password..."
aria-label="Password" aria-label="Password"
{...register("password")}
/> />
<div className="text-start text-sm italic text-error-content"> <div className="text-start text-sm italic text-error-content">
{errors.password?.message}&nbsp; {errors.password?.message}&nbsp;
@ -173,22 +180,24 @@ function ModalSignUp() {
</div> </div>
<div className="relative mt-1 mb-2"> <div className="relative mt-1 mb-2">
<input <input
{...register("passwordConfirmation")}
id="SignUpPwdConfirm" id="SignUpPwdConfirm"
type="password" type="password"
className="py-3 px-4 block w-full bg-base-200 text-base-content border-white rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none " className="py-3 px-4 block w-full bg-base-200 text-base-content border-white rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none "
placeholder="Confirmed Password..." placeholder="Confirm Password..."
aria-label="Confirmed Password" aria-label="Confirmed Password"
{...register("passwordConfirmation")}
/> />
<div className="text-start text-sm italic text-error-content"> <div className="text-start text-sm italic text-error-content">
{errors.passwordConfirmation?.message}&nbsp; {errors.passwordConfirmation?.message}&nbsp;
</div> </div>
</div> </div>
</div>
<button type="submit" className="btn btn-primary"> <button type="submit" className="btn btn-primary">
Sign Up Sign Up
</button> </button>
</form> </form>
</div>
</label> </label>
</label> </label>
</> </>