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 screenshot carousel

Steven Teyda65fc30c3df
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 6815f8ed7b..08f1cdc5e3 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
@@ -5,7 +5,6 @@ import { InstalledIntegrationInfoProps } from "@/lib/types";
import { useUninstallIntegrationModal } from "@/ui/modals/uninstall-integration-modal";
import { ThreeDots } from "@/ui/shared/icons";
import {
- AssetImage,
Avatar,
BlurImage,
Button,
@@ -137,36 +136,32 @@ export default function IntegrationPageClient({
</div>
</div>
- {integration.screenshots?.length && (
- <Carousel autoplay={{ delay: 5000 }} className="bg-white">
- <CarouselContent>
- {integration.screenshots.map((src, idx) => (
- <CarouselItem key={idx} className="bg-gray-100">
- <div className="group relative">
- <AssetImage
- image={{
- src,
- alt: "Screenshot",
- fill: true,
- style: { objectFit: "cover" },
- }}
- className="static mx-auto mt-10 aspect-[2880/1640] w-5/6 overflow-hidden rounded-t-2xl border border-gray-200"
+ <div className="w-full rounded-lg border border-gray-200 bg-white">
+ <div className="flex items-center gap-x-2 border-b border-gray-200 px-6 py-4">
+ <BookOpenText className="size-4" />
+ <p className="text-sm font-medium text-gray-700">README</p>
+ </div>
+
+ {integration.screenshots?.length && (
+ <Carousel autoplay={{ delay: 5000 }} className="bg-white p-8">
+ <CarouselContent>
+ {integration.screenshots.map((src, idx) => (
+ <CarouselItem key={idx}>
+ <BlurImage
+ src={src}
+ alt={`Screenshot of ${integration.name}`}
+ width={2880}
+ height={1640}
+ className="aspect-[2880/1640] w-[5/6] overflow-hidden rounded-t-2xl border border-gray-200 object-cover"
/>
- {/* <div className="absolute bottom-0 h-32 w-full bg-gradient-to-t from-white via-white/75 to-transparent" /> */}
- </div>
- </CarouselItem>
- ))}
- </CarouselContent>
- <CarouselNavBar variant="floating" />
- </Carousel>
- )}
+ </CarouselItem>
+ ))}
+ </CarouselContent>
+ <CarouselNavBar variant="floating" />
+ </Carousel>
+ )}
- {integration.readme && (
- <div className="w-full rounded-lg border border-gray-200 bg-white">
- <div className="flex items-center gap-x-2 border-b border-gray-200 px-6 py-4">
- <BookOpenText className="size-4" />
- <p className="text-sm font-medium text-gray-700">README</p>
- </div>
+ {integration.readme && (
<Markdown
className={cn(
"prose prose-sm prose-gray max-w-none p-6 transition-all",
@@ -176,8 +171,8 @@ export default function IntegrationPageClient({
>
{integration.readme}
</Markdown>
- </div>
- )}
+ )}
+ </div>
</MaxWidthWrapper>
);
}
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/manage/[integrationId]/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/manage/[integrationId]/page-client.tsx
index 3fd7cb8c7b..62dfe44e7c 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/manage/[integrationId]/page-client.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/integrations/manage/[integrationId]/page-client.tsx
@@ -61,7 +61,7 @@ export default function IntegrationManagePageClient({
{isLoading ? (
<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">
- <TokenAvatar id="integration" className="size-8" />
+ <TokenAvatar id="placeholder-integration" className="size-8" />
</div>
<div className="flex flex-col gap-2">
<div className="h-3 w-20 rounded-full bg-gray-100"></div>
diff --git a/packages/ui/src/asset-image.tsx b/packages/ui/src/asset-image.tsx
deleted file mode 100644
index 24f9d8a943..0000000000
--- a/packages/ui/src/asset-image.tsx
+++ /dev/null
@@ -1,42 +0,0 @@
-import { cn } from "@dub/utils";
-import { DownloadIcon } from "lucide-react";
-import Image, { ImageProps } from "next/image";
-
-export function AssetImage({
- className,
- imageContainerClassName,
- image,
-}: {
- className?: string;
- imageContainerClassName?: string;
- image: Omit<ImageProps, "src"> & { src: string };
-}) {
- return (
- <a
- href={image.src}
- download={image.src}
- className={cn(
- "relative block outline-none ring-inset ring-blue-500 focus-visible:ring",
- className,
- )}
- >
- <div className={cn("relative h-full w-full", imageContainerClassName)}>
- <Image {...image} className={cn("relative", image.className)} />
- </div>
-
- {/* Download button (shown on hover) */}
- <div className="group/inner absolute bottom-4 right-4 z-20 rounded-full px-3 py-3 shadow-sm transition-all group-hover:translate-y-0 group-hover:opacity-100 group-focus-visible:translate-y-0 group-focus-visible:opacity-100 sm:translate-y-2 sm:py-1 sm:opacity-0">
- {/* Background based on currentColor */}
- <div className="absolute inset-0 rounded-full bg-current opacity-0 group-hover/inner:opacity-[.05]"></div>
-
- {/* Border based on currentColor */}
- <div className="absolute inset-0 rounded-full border border-current opacity-[.15]"></div>
-
- <div className="flex items-center gap-2 text-sm">
- <DownloadIcon className="h-4 w-4" />
- <span className="hidden sm:block">Download</span>
- </div>
- </div>
- </a>
- );
-}
diff --git a/packages/ui/src/index.tsx b/packages/ui/src/index.tsx
index 067d947bcf..fbb5b2366b 100644
--- a/packages/ui/src/index.tsx
+++ b/packages/ui/src/index.tsx
@@ -4,7 +4,6 @@ import "./styles.css";
// components
export * from "./accordion";
export * from "./alert";
-export * from "./asset-image";
export * from "./avatar";
export * from "./badge";
export * from "./button";