refactor (forms): add form footer buttons
This commit is contained in:
@@ -1,10 +1,11 @@
|
|||||||
"use client";
|
"use client";
|
||||||
import InputGroup from "@/components/FormElements/InputGroup";
|
import InputGroup from "@/components/FormElements/InputGroup";
|
||||||
import { ShowcaseSection } from "@/components/Layouts/showcase-section";
|
import { ShowcaseSection } from "@/components/Layouts/showcase-section";
|
||||||
import useCreateAdminPresenter from "./useCreateAdminPresenter";
|
import FormFooter from "@/components/ui/FormFooter";
|
||||||
import { FormErrorMessages } from "@/constants/Texts";
|
import { FormErrorMessages } from "@/constants/Texts";
|
||||||
import { ICreateAdminCredentials } from "@/lib/api";
|
import { ICreateAdminCredentials } from "@/lib/api";
|
||||||
import { FC, useEffect } from "react";
|
import { FC } from "react";
|
||||||
|
import useCreateAdminPresenter from "./useCreateAdminPresenter";
|
||||||
interface IProps {
|
interface IProps {
|
||||||
editMode?: boolean;
|
editMode?: boolean;
|
||||||
defaultValues?: ICreateAdminCredentials;
|
defaultValues?: ICreateAdminCredentials;
|
||||||
@@ -234,21 +235,7 @@ const CreateAdminForm: FC<IProps> = ({ defaultValues, editMode, id }) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-span-2 flex gap-6">
|
<FormFooter />
|
||||||
<button
|
|
||||||
type="submit"
|
|
||||||
className="mt-6 flex w-fit justify-center rounded-lg bg-primary p-[13px] font-medium text-white hover:bg-opacity-90"
|
|
||||||
>
|
|
||||||
Submit
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
onClick={router.back}
|
|
||||||
className="mt-6 flex w-fit justify-center rounded-lg bg-error p-[13px] font-medium text-white hover:bg-opacity-90"
|
|
||||||
>
|
|
||||||
Opt out
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</ShowcaseSection>
|
</ShowcaseSection>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -528,25 +528,7 @@ const CreateCompany = ({ defaultValues, editMode, id }: IProps) => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<FormFooter />
|
<FormFooter />
|
||||||
{/* <div className="col-span-2 flex gap-6">
|
|
||||||
<button
|
|
||||||
type="submit"
|
|
||||||
className="mt-6 flex w-fit items-center justify-center rounded-lg bg-primary p-[13px] font-medium text-white hover:bg-opacity-90"
|
|
||||||
>
|
|
||||||
{isMutating ? (
|
|
||||||
<div className="h-5 w-5 animate-spin rounded-full border-b-2 border-gray-1"></div>
|
|
||||||
) : (
|
|
||||||
"Submit"
|
|
||||||
)}
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
onClick={router.back}
|
|
||||||
className="mt-6 flex w-fit justify-center rounded-lg bg-error p-[13px] font-medium text-white hover:bg-opacity-90"
|
|
||||||
>
|
|
||||||
Opt out
|
|
||||||
</button>
|
|
||||||
</div> */}
|
|
||||||
</form>
|
</form>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import InputGroup from "@/components/FormElements/InputGroup";
|
|||||||
import MultiSelect from "@/components/FormElements/MultiSelect";
|
import MultiSelect from "@/components/FormElements/MultiSelect";
|
||||||
import { Select } from "@/components/FormElements/select";
|
import { Select } from "@/components/FormElements/select";
|
||||||
import { ShowcaseSection } from "@/components/Layouts/showcase-section";
|
import { ShowcaseSection } from "@/components/Layouts/showcase-section";
|
||||||
|
import FormFooter from "@/components/ui/FormFooter";
|
||||||
import { FormErrorMessages } from "@/constants/Texts";
|
import { FormErrorMessages } from "@/constants/Texts";
|
||||||
import { CreateCustomerCredentials } from "@/lib/api";
|
import { CreateCustomerCredentials } from "@/lib/api";
|
||||||
import useCreateCustomerPresenter from "./useCreateCustomerPresenter";
|
import useCreateCustomerPresenter from "./useCreateCustomerPresenter";
|
||||||
@@ -203,21 +204,7 @@ const CreateCustomer = ({ defaultValues, editMode, id }: IProps) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-span-2 flex gap-6">
|
<FormFooter />
|
||||||
<button
|
|
||||||
type="submit"
|
|
||||||
className="mt-6 flex w-fit justify-center rounded-lg bg-primary p-[13px] font-medium text-white hover:bg-opacity-90"
|
|
||||||
>
|
|
||||||
Submit
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
onClick={router.back}
|
|
||||||
className="mt-6 flex w-fit justify-center rounded-lg bg-error p-[13px] font-medium text-white hover:bg-opacity-90"
|
|
||||||
>
|
|
||||||
Opt out
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</ShowcaseSection>
|
</ShowcaseSection>
|
||||||
</form>
|
</form>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user