From 8cfc259804fccecfb8e088200a83b4e611105f3d Mon Sep 17 00:00:00 2001 From: Cullen Lee Date: Fri, 21 Jun 2024 11:50:25 -0700 Subject: [PATCH] Revert "Added campaigns page" --- app/(root)/campaigns/page.tsx | 11 -- components/ui/create-campaign-form.tsx | 228 ------------------------- components/ui/select-ads-modal.tsx | 77 --------- 3 files changed, 316 deletions(-) delete mode 100644 app/(root)/campaigns/page.tsx delete mode 100644 components/ui/create-campaign-form.tsx delete mode 100644 components/ui/select-ads-modal.tsx diff --git a/app/(root)/campaigns/page.tsx b/app/(root)/campaigns/page.tsx deleted file mode 100644 index e3dacfd..0000000 --- a/app/(root)/campaigns/page.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import CampaignForm from '@/components/ui/create-campaign-form'; -import { GetAllChannels } from '@/lib/data'; - -export default async function Page() { - const channels = GetAllChannels(); - return ( -
- -
- ); -} \ No newline at end of file diff --git a/components/ui/create-campaign-form.tsx b/components/ui/create-campaign-form.tsx deleted file mode 100644 index 51be3ea..0000000 --- a/components/ui/create-campaign-form.tsx +++ /dev/null @@ -1,228 +0,0 @@ -'use client'; -import React, { useState } from "react"; -import { ChannelField } from '@/lib/definitions'; -import Link from 'next/link'; -import { createAd } from '@/lib/actions'; -import { useFormState } from 'react-dom'; -import { DatePicker } from "@nextui-org/date-picker"; -import { Button } from "@nextui-org/react"; -import CheckboxModal from "./select-ads-modal"; - - -export default function CampaignForm({ channels }: { channels: ChannelField[] }) { - const initialState = { message: "", errors: {} }; - const [selectedAds, setSelectedAds] = useState<{id: string; name: string}[]>([]); - const [state, dispatch] = useFormState(createAd, initialState); - const [isModalOpen, setIsModalOpen] = useState(false); - const openModal = () => setIsModalOpen(true); - const closeModal = () => setIsModalOpen(false); - const handleSaveModal = (selectedCheckboxes: { id: string; name: string }[]) => { - setSelectedAds(selectedCheckboxes); // Update state with selected checkboxes - setIsModalOpen(false); // Close the modal after saving selections - }; - - return ( -
-
-
-

Create Campaign

-
-
- - Cancel - - -
-
-
-
-
-
-
- -
-
- -
-
-
-
-
-
- {state.errors?.adName && - state.errors.adName.map((error: string) => ( -

- {error} -

- ))} -
-
-
-
-
- -
-
-