Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 13 additions & 17 deletions apps/docs/components/ads/carbon-ad/carbon-ad.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@ import {useIsMounted} from "@/hooks/use-is-mounted";
import {__PROD__, __ENABLE_ADS__} from "@/utils";

const EA_PROVIDER_RATIO = 0.85;
const INTERNAL_AD_ENABLED = true;
const PRODUCT_HUNT_ENABLED = false;

const INTERNAL_AD_INFO = {
description: "Join our hackathon, $6k in prizes + 3 months of HeroUI Chat Pro! ↗",
title: "Hackathon #HeroHack",
img: "https://heroui-chat-assets.nyc3.cdn.digitaloceanspaces.com/herohack.png",
url: "https://hack.heroui.chat/twitter?utm_source=heroui.com&utm_medium=ad-banner",
const PH_INFO = {
description: "Join the conversation and help us get #1 Product of the Week! ↗",
title: "We're live on Product Hunt! (30% OFF)",
url: "https://ph.heroui.chat?utm_source=heroui.chat&utm_medium=banner",
};

export const CarbonAd: React.FC<unknown> = () => {
Expand Down Expand Up @@ -50,7 +49,7 @@ export const CarbonAd: React.FC<unknown> = () => {
}, []);

useEffect(() => {
if (INTERNAL_AD_ENABLED) return;
if (PRODUCT_HUNT_ENABLED) return;

const shouldShowEthicalAds = Math.random() < EA_PROVIDER_RATIO;

Expand Down Expand Up @@ -107,28 +106,25 @@ export const CarbonAd: React.FC<unknown> = () => {
};
}, [isMounted]);

if (INTERNAL_AD_ENABLED) {
if (PRODUCT_HUNT_ENABLED) {
return (
<div className="px-2 not-prose hover:opacity-80 transition-[opacity] duration-200 carbon-ad-container max-h-[100px] min-h-[100px] h-[100px] m-0 p-0">
<a
className="group flex items-center flex gap-4 h-full"
href={INTERNAL_AD_INFO.url}
className="group flex items-center flex gap-2 h-full"
href={PH_INFO.url}
rel="noopener noreferrer"
target="_blank"
>
<Image
removeWrapper
alt="Product Hunt"
className="m-0 w-[120px] h-[80px] object-cover rounded-[8px]"
src={INTERNAL_AD_INFO.img}
className="m-0 w-[80px] h-[80px] object-cover"
src="/product-hunt.png"
/>
<div className="flex flex-col gap-0.5 pointer-events-none">
<div className="text-small md:text-medium font-medium no-underline">
{INTERNAL_AD_INFO.title}
</div>
<div className="text-tiny md:text-small text-default-500">
{INTERNAL_AD_INFO.description}
{PH_INFO.title}
</div>
<div className="text-tiny md:text-small text-default-500">{PH_INFO.description}</div>
</div>
</a>
</div>
Expand Down