From 398a8f363d404cff9bf255bd841ebe3c541a1ada Mon Sep 17 00:00:00 2001 From: Sheen Capadngan Date: Tue, 2 Jul 2024 20:20:25 +0800 Subject: [PATCH] misc: cleanup of form display structure --- .../components/WebhooksTab/AddWebhookForm.tsx | 59 +++++++++++-------- 1 file changed, 33 insertions(+), 26 deletions(-) diff --git a/frontend/src/views/Settings/ProjectSettingsPage/components/WebhooksTab/AddWebhookForm.tsx b/frontend/src/views/Settings/ProjectSettingsPage/components/WebhooksTab/AddWebhookForm.tsx index fa581fae18..5d5bf164d0 100644 --- a/frontend/src/views/Settings/ProjectSettingsPage/components/WebhooksTab/AddWebhookForm.tsx +++ b/frontend/src/views/Settings/ProjectSettingsPage/components/WebhooksTab/AddWebhookForm.tsx @@ -69,6 +69,38 @@ export const AddWebhookForm = ({ const webhookType = watch("type"); + const generalFormFields = ( + <> + + + + + + + + ); + + const slackFormFields = ( + + + + ); + useEffect(() => { if (!isOpen) { reset(); @@ -146,32 +178,7 @@ export const AddWebhookForm = ({ {...register("secretPath")} /> - {webhookType === WebhookType.GENERAL && ( - - - - )} - - - + {webhookType === WebhookType.SLACK ? slackFormFields : generalFormFields}