From 379e8e70e4caf4bcb8b7f29af1db7983e6483b99 Mon Sep 17 00:00:00 2001 From: isra el Date: Sun, 22 Dec 2024 12:08:27 +0300 Subject: [PATCH] chore(web): improve webhooks section mobile responsiveness --- .../(components)/webhooks/webhook-card.tsx | 50 ++++++++++--------- .../(components)/webhooks/webhook-docs.tsx | 8 +-- .../webhooks/webhooks-section.tsx | 46 +++++++++++------ web/components/shared/copy-button.tsx | 7 +-- 4 files changed, 64 insertions(+), 47 deletions(-) diff --git a/web/app/(app)/dashboard/(components)/webhooks/webhook-card.tsx b/web/app/(app)/dashboard/(components)/webhooks/webhook-card.tsx index 8c5a2f3..573a148 100644 --- a/web/app/(app)/dashboard/(components)/webhooks/webhook-card.tsx +++ b/web/app/(app)/dashboard/(components)/webhooks/webhook-card.tsx @@ -65,10 +65,10 @@ export function WebhookCard({ webhook, onEdit, onDelete }: WebhookCardProps) { return ( - +
-
-

Webhook Endpoint

+
+

Webhook Endpoint

{webhook.isActive ? 'Active' : 'Inactive'} @@ -77,15 +77,15 @@ export function WebhookCard({ webhook, onEdit, onDelete }: WebhookCardProps) { Notifications for SMS events

-
+
@@ -94,32 +94,34 @@ export function WebhookCard({ webhook, onEdit, onDelete }: WebhookCardProps) {
-
- +
+ {webhook.deliveryUrl} - +
-
- +
+ {showSecret ? webhook.signingSecret : maskSecret(webhook.signingSecret)} - - +
+ + +
diff --git a/web/app/(app)/dashboard/(components)/webhooks/webhook-docs.tsx b/web/app/(app)/dashboard/(components)/webhooks/webhook-docs.tsx index c848ea5..b8b3991 100644 --- a/web/app/(app)/dashboard/(components)/webhooks/webhook-docs.tsx +++ b/web/app/(app)/dashboard/(components)/webhooks/webhook-docs.tsx @@ -80,15 +80,15 @@ def webhook(): export function WebhookDocs() { return ( - + - +
- Webhook Delivery Information + Webhook Delivery Information
- +

When a new SMS is received, we'll send a POST request to your diff --git a/web/app/(app)/dashboard/(components)/webhooks/webhooks-section.tsx b/web/app/(app)/dashboard/(components)/webhooks/webhooks-section.tsx index acbae7f..d0f90e7 100644 --- a/web/app/(app)/dashboard/(components)/webhooks/webhooks-section.tsx +++ b/web/app/(app)/dashboard/(components)/webhooks/webhooks-section.tsx @@ -84,11 +84,11 @@ export default function WebhooksSection() { } return ( -

-
+
+
-

- +

+ Webhooks @@ -103,22 +103,36 @@ export default function WebhooksSection() {

-

+

Manage webhook notifications for your SMS events

- + + + +
+ +
+
+ {webhooks?.data?.length > 0 && ( + +

You already have an active webhook subscription. You can edit or manage the existing webhook instead.

+
+ )} +
+
-
-
+
+
{isLoading ? (
@@ -157,7 +171,7 @@ export default function WebhooksSection() {
-
+
diff --git a/web/components/shared/copy-button.tsx b/web/components/shared/copy-button.tsx index 7d30011..d8ef6f3 100644 --- a/web/components/shared/copy-button.tsx +++ b/web/components/shared/copy-button.tsx @@ -8,9 +8,10 @@ import { useToast } from "@/hooks/use-toast"; interface CopyButtonProps { value: string; label: string; + className?: string; } -export function CopyButton({ value, label }: CopyButtonProps) { +export function CopyButton({ value, label, className }: CopyButtonProps) { const [copied, setCopied] = useState(false); const { toast } = useToast(); @@ -35,9 +36,9 @@ export function CopyButton({ value, label }: CopyButtonProps) { return (