From c82574af014860b5265f94716331a61391475b81 Mon Sep 17 00:00:00 2001 From: AmirReza Jamali Date: Sat, 2 May 2026 12:49:58 +0330 Subject: [PATCH] refactor(contacts-footer-hero-section): remove placeholder text from input fields for cleaner UI - Removed placeholder text from various input fields in ContactsStep, FooterStep, HeroStep, and SectionStep components to streamline the user interface. - Updated MarketingForm to enhance form field handling and validation logic. - Improved default values in useMarketingForm for better initial state management. --- .../marketing/_components/ContactsStep.tsx | 5 - src/app/marketing/_components/FooterStep.tsx | 4 - src/app/marketing/_components/HeroStep.tsx | 1 - .../marketing/_components/MarketingForm.tsx | 208 ++++++++++-------- src/app/marketing/_components/SectionStep.tsx | 2 - .../marketing/_components/useMarketingForm.ts | 9 +- .../FormElements/InputGroup/index.tsx | 5 +- 7 files changed, 122 insertions(+), 112 deletions(-) diff --git a/src/app/marketing/_components/ContactsStep.tsx b/src/app/marketing/_components/ContactsStep.tsx index b5da004..eedf84c 100644 --- a/src/app/marketing/_components/ContactsStep.tsx +++ b/src/app/marketing/_components/ContactsStep.tsx @@ -45,14 +45,12 @@ const ContactsStep = forwardRef( label="Description" {...register("description")} name="description" - placeholder="Enter Description" /> @@ -67,7 +65,6 @@ const ContactsStep = forwardRef( label="Field Name" name={`fields.${index}.name`} type="text" - placeholder="Field Name" disabled /> ( label="Label" name={`fields.${index}.label`} type="text" - placeholder="Enter Label" /> ( label="Phone Number" name="phone" type="text" - placeholder="Enter Phone Number" /> diff --git a/src/app/marketing/_components/HeroStep.tsx b/src/app/marketing/_components/HeroStep.tsx index 243b7dd..7df278b 100644 --- a/src/app/marketing/_components/HeroStep.tsx +++ b/src/app/marketing/_components/HeroStep.tsx @@ -61,7 +61,6 @@ const HeroStep = forwardRef(({ initialData }, ref) => { }, })} name="description" - placeholder="Enter Description" /> {errors.description && (

diff --git a/src/app/marketing/_components/MarketingForm.tsx b/src/app/marketing/_components/MarketingForm.tsx index 83dce9d..b3a9ae8 100644 --- a/src/app/marketing/_components/MarketingForm.tsx +++ b/src/app/marketing/_components/MarketingForm.tsx @@ -40,6 +40,7 @@ const MarketingForm = ({ handleStepChange, handleSubmitAll, registerPageType, + watchPageType, pageTypeErrors, isCompany, setValue, @@ -55,106 +56,123 @@ const MarketingForm = ({ <> -

+

Page Configuration

- +
- } - disabled={!isCompany} - required={isCompany} - placeholder="Please select country" - onClear={() => setValue("country", undefined)} - /> - {pageTypeErrors.country && ( -

- {pageTypeErrors.country.message} -

- )} - - {pageTypeErrors.key && ( -

- {pageTypeErrors.key.message} -

- )} +
+ + !isCompany || + (typeof v === "string" && v.length > 0) || + FormErrorMessages.required, + })} + errors={pageTypeErrors} + name="country" + label="Country" + items={Countries} + defaultValue="USA" + value={watchPageType("country")} + clearable + prefixIcon={} + disabled={!isCompany} + required={isCompany} + placeholder={isCompany ? "Please select country" : undefined} + onClear={() => setValue("country", "")} + /> +
+
+ + {pageTypeErrors.key && ( +

+ {pageTypeErrors.key.message} +

+ )} +
diff --git a/src/app/marketing/_components/SectionStep.tsx b/src/app/marketing/_components/SectionStep.tsx index 087794a..f5d59b1 100644 --- a/src/app/marketing/_components/SectionStep.tsx +++ b/src/app/marketing/_components/SectionStep.tsx @@ -71,7 +71,6 @@ const SectionStep = ({ label="Section Description" {...register("description" as Path)} name="description" - placeholder="Enter Section Description" /> ({ {...register(`cards.${index}.description` as Path)} label="Description" name={`cards.${index}.description`} - placeholder="Enter Description" className="sm:col-span-2" />