From 82009d31474f8c098f4a4dc9947fad0e612efef7 Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 10 Dec 2023 10:21:36 +0800 Subject: [PATCH] chore: tweak webhook section --- web/src/components/CreateWebhookDialog.tsx | 2 +- .../components/Settings/WebhookSection.tsx | 145 +++++++++--------- 2 files changed, 75 insertions(+), 72 deletions(-) diff --git a/web/src/components/CreateWebhookDialog.tsx b/web/src/components/CreateWebhookDialog.tsx index 6a49d951..451fc938 100644 --- a/web/src/components/CreateWebhookDialog.tsx +++ b/web/src/components/CreateWebhookDialog.tsx @@ -133,7 +133,7 @@ const CreateWebhookDialog: React.FC = (props: Props) => { /> -
+
diff --git a/web/src/components/Settings/WebhookSection.tsx b/web/src/components/Settings/WebhookSection.tsx index 4f5ca5e9..e77e1bce 100644 --- a/web/src/components/Settings/WebhookSection.tsx +++ b/web/src/components/Settings/WebhookSection.tsx @@ -1,5 +1,6 @@ import { Button, IconButton } from "@mui/joy"; import { useEffect, useState } from "react"; +import { Link } from "react-router-dom"; import { webhookServiceClient } from "@/grpcweb"; import useCurrentUser from "@/hooks/useCurrentUser"; import { Webhook } from "@/types/proto/api/v2/webhook_service"; @@ -7,7 +8,6 @@ import { useTranslate } from "@/utils/i18n"; import showCreateWebhookDialog from "../CreateWebhookDialog"; import { showCommonDialog } from "../Dialog/CommonDialog"; import Icon from "../Icon"; -import LearnMore from "../LearnMore"; const listWebhooks = async (userId: number) => { const { webhooks } = await webhookServiceClient.listWebhooks({ @@ -46,80 +46,83 @@ const WebhookSection = () => { }; return ( - <> -
-
-
-
-

- Webhooks - -

-
-
- -
-
-
-
-
- - - - - - - - - - {webhooks.map((webhook) => ( - - - - - - ))} +
+
+
+

Webhooks

+
+
+ +
+
+
+
+
+
- Name - - Url - - {t("common.delete")} -
{webhook.name}{webhook.url} - { - handleDeleteWebhook(webhook); - }} - > - - -
+ + + + + + + + + {webhooks.map((webhook) => ( + + + + + + ))} - {webhooks.length === 0 && ( - - - - )} - -
+ Name + + Url + + {t("common.delete")} +
{webhook.name}{webhook.url} + { + handleDeleteWebhook(webhook); + }} + > + + +
- No webhooks found. -
-
-
+ {webhooks.length === 0 && ( + + + No webhooks found. + + + )} + +
- +
+ + {t("common.learn-more")} + + +
+
); };