diff --git a/.vscode/settings.json b/.vscode/settings.json index 7a73a41..0967ef4 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,2 +1 @@ -{ -} \ No newline at end of file +{} diff --git a/src/app/marketing/create/_components/BenefitsStep.tsx b/src/app/marketing/_components/BenefitsStep.tsx similarity index 100% rename from src/app/marketing/create/_components/BenefitsStep.tsx rename to src/app/marketing/_components/BenefitsStep.tsx diff --git a/src/app/marketing/create/_components/ChallengesStep.tsx b/src/app/marketing/_components/ChallengesStep.tsx similarity index 100% rename from src/app/marketing/create/_components/ChallengesStep.tsx rename to src/app/marketing/_components/ChallengesStep.tsx diff --git a/src/app/marketing/create/_components/ChartPreview.tsx b/src/app/marketing/_components/ChartPreview.tsx similarity index 100% rename from src/app/marketing/create/_components/ChartPreview.tsx rename to src/app/marketing/_components/ChartPreview.tsx diff --git a/src/app/marketing/create/_components/ChartStep.tsx b/src/app/marketing/_components/ChartStep.tsx similarity index 100% rename from src/app/marketing/create/_components/ChartStep.tsx rename to src/app/marketing/_components/ChartStep.tsx diff --git a/src/app/marketing/create/_components/ContactsStep.tsx b/src/app/marketing/_components/ContactsStep.tsx similarity index 100% rename from src/app/marketing/create/_components/ContactsStep.tsx rename to src/app/marketing/_components/ContactsStep.tsx diff --git a/src/app/marketing/create/_components/FeaturesStep.tsx b/src/app/marketing/_components/FeaturesStep.tsx similarity index 100% rename from src/app/marketing/create/_components/FeaturesStep.tsx rename to src/app/marketing/_components/FeaturesStep.tsx diff --git a/src/app/marketing/create/_components/FooterStep.tsx b/src/app/marketing/_components/FooterStep.tsx similarity index 100% rename from src/app/marketing/create/_components/FooterStep.tsx rename to src/app/marketing/_components/FooterStep.tsx diff --git a/src/app/marketing/create/_components/HeroStep.tsx b/src/app/marketing/_components/HeroStep.tsx similarity index 100% rename from src/app/marketing/create/_components/HeroStep.tsx rename to src/app/marketing/_components/HeroStep.tsx diff --git a/src/app/marketing/create/_components/SectionStep.tsx b/src/app/marketing/_components/SectionStep.tsx similarity index 100% rename from src/app/marketing/create/_components/SectionStep.tsx rename to src/app/marketing/_components/SectionStep.tsx diff --git a/src/app/marketing/create/_components/useBenefitsStepPresenter.ts b/src/app/marketing/_components/useBenefitsStepPresenter.ts similarity index 100% rename from src/app/marketing/create/_components/useBenefitsStepPresenter.ts rename to src/app/marketing/_components/useBenefitsStepPresenter.ts diff --git a/src/app/marketing/create/_components/useChallengesStepPresenter.ts b/src/app/marketing/_components/useChallengesStepPresenter.ts similarity index 100% rename from src/app/marketing/create/_components/useChallengesStepPresenter.ts rename to src/app/marketing/_components/useChallengesStepPresenter.ts diff --git a/src/app/marketing/create/_components/useChartStepPresenter.ts b/src/app/marketing/_components/useChartStepPresenter.ts similarity index 100% rename from src/app/marketing/create/_components/useChartStepPresenter.ts rename to src/app/marketing/_components/useChartStepPresenter.ts diff --git a/src/app/marketing/create/_components/useContactsStepPresenter.ts b/src/app/marketing/_components/useContactsStepPresenter.ts similarity index 100% rename from src/app/marketing/create/_components/useContactsStepPresenter.ts rename to src/app/marketing/_components/useContactsStepPresenter.ts diff --git a/src/app/marketing/create/_components/useFeaturesStepPresenter.ts b/src/app/marketing/_components/useFeaturesStepPresenter.ts similarity index 100% rename from src/app/marketing/create/_components/useFeaturesStepPresenter.ts rename to src/app/marketing/_components/useFeaturesStepPresenter.ts diff --git a/src/app/marketing/create/_components/useFooterStepPresenter.ts b/src/app/marketing/_components/useFooterStepPresenter.ts similarity index 100% rename from src/app/marketing/create/_components/useFooterStepPresenter.ts rename to src/app/marketing/_components/useFooterStepPresenter.ts diff --git a/src/app/marketing/create/_components/useHeroStepPresenter.ts b/src/app/marketing/_components/useHeroStepPresenter.ts similarity index 100% rename from src/app/marketing/create/_components/useHeroStepPresenter.ts rename to src/app/marketing/_components/useHeroStepPresenter.ts diff --git a/src/app/marketing/create/page.tsx b/src/app/marketing/create/page.tsx index 7002749..632ed8a 100644 --- a/src/app/marketing/create/page.tsx +++ b/src/app/marketing/create/page.tsx @@ -1,24 +1,26 @@ "use client"; +import { GlobeIcon } from "@/assets/icons"; import Breadcrumb from "@/components/Breadcrumbs/Breadcrumb"; import InputGroup from "@/components/FormElements/InputGroup"; import { Select } from "@/components/FormElements/select"; import { ShowcaseSection } from "@/components/Layouts/showcase-section"; import Stepper, { Step } from "@/components/ui/Stepper"; +import { Countries } from "@/constants/countries"; import { FormErrorMessages } from "@/constants/Texts"; import { useCreateCms } from "@/hooks/queries/useCmsQueries"; import { BreadcrumbItem } from "@/types/shared"; import { useRef, useState } from "react"; import { useForm } from "react-hook-form"; -import BenefitsStep from "./_components/BenefitsStep"; -import ChallengesStep from "./_components/ChallengesStep"; -import ChartStep from "./_components/ChartStep"; -import ContactsStep from "./_components/ContactsStep"; -import FeaturesStep from "./_components/FeaturesStep"; -import FooterStep from "./_components/FooterStep"; -import HeroStep from "./_components/HeroStep"; +import BenefitsStep from "../_components/BenefitsStep"; +import ChallengesStep from "../_components/ChallengesStep"; +import ChartStep from "../_components/ChartStep"; +import ContactsStep from "../_components/ContactsStep"; +import FeaturesStep from "../_components/FeaturesStep"; +import FooterStep from "../_components/FooterStep"; +import HeroStep from "../_components/HeroStep"; interface IPageTypeFields { - page_type: "company" | "organization"; + type: "company" | "organization"; language?: string; company_name?: string; country?: string; @@ -40,13 +42,14 @@ const Marketing = () => { watch: watchPageType, formState: { errors: pageTypeErrors }, getValues: getPageTypeValues, + setValue, } = useForm({ defaultValues: { - page_type: "company", + type: "company", }, }); - const pageType = watchPageType("page_type"); + const pageType = watchPageType("type"); const isCompany = pageType === "company"; const { mutate: createCms, isPending } = useCreateCms(); @@ -146,11 +149,11 @@ const Marketing = () => { const handleSubmitAll = async () => { const allData = await collectAllStepsData(); const pageTypeData = getPageTypeValues(); - + const finalData = { ...allData, - page_type: pageTypeData.page_type, - ...(pageTypeData.page_type === "company" && { + page_type: pageTypeData.type, + ...(pageTypeData.type === "company" && { language: pageTypeData.language, company_name: pageTypeData.company_name, country: pageTypeData.country, @@ -223,7 +226,7 @@ const Marketing = () => {