Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

improve styles

Steven Tey10d8da024a83
diff --git a/apps/web/app/api/integrations/[slug]/uninstall/route.ts b/apps/web/app/api/integrations/[slug]/uninstall/route.ts
index ff308c6a75..fd724ae6f0 100644
--- a/apps/web/app/api/integrations/[slug]/uninstall/route.ts
+++ b/apps/web/app/api/integrations/[slug]/uninstall/route.ts
@@ -22,6 +22,8 @@ export const DELETE = withWorkspace(
},
});
+ console.log({ integration });
+
if (!integration) {
throw new DubApiError({
code: "not_found",
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/[integrationSlug]/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/[integrationSlug]/page-client.tsx
index a177648621..1340b820bf 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/[integrationSlug]/page-client.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/[integrationSlug]/page-client.tsx
@@ -12,7 +12,7 @@ import {
Popover,
TokenAvatar,
} from "@dub/ui";
-import { Globe, ReferredVia } from "@dub/ui/src/icons";
+import { Globe, OfficeBuilding } from "@dub/ui/src/icons";
import { cn, formatDate, getPrettyUrl } from "@dub/utils";
import { ChevronLeft, Trash } from "lucide-react";
import Link from "next/link";
@@ -122,7 +122,7 @@ export default function IntegrationPageClient({
<div>
<p className="text-xs text-gray-500">DEVELOPER</p>
<div className="flex items-center gap-x-1 text-sm font-medium text-gray-700">
- <ReferredVia className="size-4" />
+ <OfficeBuilding className="size-4" />
{integration.developer}
</div>
</div>
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/integration-card.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/integration-card.tsx
index 8007db7e5e..52a5b435f2 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/integration-card.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/integration-card.tsx
@@ -1,6 +1,7 @@
import useWorkspace from "@/lib/swr/use-workspace";
import { OAuthAppProps } from "@/lib/types";
import { BlurImage, TokenAvatar } from "@dub/ui";
+import { Download, OfficeBuilding } from "@dub/ui/src/icons";
import Link from "next/link";
export default function IntegrationCard(
@@ -19,7 +20,7 @@ export default function IntegrationCard(
</p>
)}
<div className="flex items-center gap-x-3">
- <div className="rounded-md border border-gray-200 bg-gradient-to-t from-gray-100 p-2">
+ <div className="rounded-md border border-gray-200 bg-gradient-to-t from-gray-100 p-2.5">
{integration.logo ? (
<BlurImage
src={integration.logo}
@@ -32,16 +33,22 @@ export default function IntegrationCard(
<TokenAvatar id={integration.clientId} className="size-6" />
)}
</div>
- <p className="font-semibold text-gray-700">{integration.name}</p>
+ <div>
+ <p className="font-semibold text-gray-700">{integration.name}</p>
+ <div className="flex items-center gap-1 text-gray-500">
+ <OfficeBuilding className="size-3" />
+ <span className="text-sm">{integration.developer}</span>
+ </div>
+ </div>
</div>
- <div className="mt-4 grid gap-2">
- <p className="text-sm text-gray-500">{integration.description}</p>
- <p className="text-sm text-gray-500">
- Built by{" "}
- <span className="font-medium text-gray-700">
- {integration.developer}
- </span>
+ <div className="items-between grid h-24 pt-4">
+ <p className="line-clamp-3 text-sm text-gray-500">
+ {integration.description}
</p>
+ <div className="flex items-center justify-end gap-1 text-gray-500">
+ <Download className="size-4" />
+ <span className="text-sm">{integration.installations} installs</span>
+ </div>
</div>
</Link>
);
diff --git a/apps/web/ui/modals/uninstall-integration-modal.tsx b/apps/web/ui/modals/uninstall-integration-modal.tsx
index b22b4f0773..b241e4293e 100644
--- a/apps/web/ui/modals/uninstall-integration-modal.tsx
+++ b/apps/web/ui/modals/uninstall-integration-modal.tsx
@@ -29,8 +29,8 @@ function UninstallIntegrationModal({
}) {
const router = useRouter();
const [removing, setRemoving] = useState(false);
- const { logo } = useWorkspace();
- const { name, slug, description } = integration;
+ const { id: workspaceId, logo } = useWorkspace();
+ const { name, description, slug } = integration;
const { isMobile } = useMediaQuery();
return (
@@ -82,10 +82,13 @@ function UninstallIntegrationModal({
loading={removing}
onClick={() => {
setRemoving(true);
- fetch(`/api/integration/${integration.slug}/uninstall`, {
- method: "DELETE",
- headers: { "Content-Type": "application/json" },
- }).then(async (res) => {
+ fetch(
+ `/api/integration/${slug}/uninstall?workspaceId=${workspaceId}`,
+ {
+ method: "DELETE",
+ headers: { "Content-Type": "application/json" },
+ },
+ ).then(async (res) => {
if (res.status === 200) {
router.refresh();
toast.success("Successfully removed integration!");