From 27f30e773911e07ddb490ae77b9a8d6f232c48fa Mon Sep 17 00:00:00 2001 From: Ian Krieger Date: Fri, 21 Jul 2023 11:23:10 -0400 Subject: [PATCH] fix: allow campaign settings edit if draft --- .../advanced/components/campaign/CampaignSettings.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/user/views/adsManager/views/advanced/components/campaign/CampaignSettings.tsx b/src/user/views/adsManager/views/advanced/components/campaign/CampaignSettings.tsx index b66c0cc5f..2d22ec454 100644 --- a/src/user/views/adsManager/views/advanced/components/campaign/CampaignSettings.tsx +++ b/src/user/views/adsManager/views/advanced/components/campaign/CampaignSettings.tsx @@ -4,8 +4,13 @@ import { CardContainer } from "components/Card/CardContainer"; import { CampaignDateRange } from "components/Campaigns/CampaignDateRange"; import { LocationField } from "user/views/adsManager/views/advanced/components/campaign/fields/LocationField"; import { Typography } from "@mui/material"; +import { useFormikContext } from "formik"; +import { CampaignForm } from "user/views/adsManager/types"; export function CampaignSettings(props: { isEdit: boolean }) { + const { values } = useFormikContext(); + const isEdit = props.isEdit && values.state !== "draft"; + return ( <> @@ -15,10 +20,10 @@ export function CampaignSettings(props: { isEdit: boolean }) { - + - {!props.isEdit && } + {!isEdit && } ); }