chore: add herohack announcement

This commit is contained in:
Junior Garcia 2025-05-15 00:18:33 -03:00
parent 2cbc68965f
commit 5ccd945cd7

View File

@ -11,12 +11,13 @@ import {useIsMounted} from "@/hooks/use-is-mounted";
import {__PROD__, __ENABLE_ADS__} from "@/utils";
const EA_PROVIDER_RATIO = 0.85;
const PRODUCT_HUNT_ENABLED = false;
const INTERNAL_AD_ENABLED = true;
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",
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",
};
export const CarbonAd: React.FC<unknown> = () => {
@ -49,7 +50,7 @@ export const CarbonAd: React.FC<unknown> = () => {
}, []);
useEffect(() => {
if (PRODUCT_HUNT_ENABLED) return;
if (INTERNAL_AD_ENABLED) return;
const shouldShowEthicalAds = Math.random() < EA_PROVIDER_RATIO;
@ -106,25 +107,28 @@ export const CarbonAd: React.FC<unknown> = () => {
};
}, [isMounted]);
if (PRODUCT_HUNT_ENABLED) {
if (INTERNAL_AD_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-2 h-full"
href={PH_INFO.url}
className="group flex items-center flex gap-4 h-full"
href={INTERNAL_AD_INFO.url}
rel="noopener noreferrer"
target="_blank"
>
<Image
removeWrapper
alt="Product Hunt"
className="m-0 w-[80px] h-[80px] object-cover"
src="/product-hunt.png"
className="m-0 w-[120px] h-[80px] object-cover rounded-[8px]"
src={INTERNAL_AD_INFO.img}
/>
<div className="flex flex-col gap-0.5 pointer-events-none">
<div className="text-small md:text-medium font-medium no-underline">
{PH_INFO.title}
{INTERNAL_AD_INFO.title}
</div>
<div className="text-tiny md:text-small text-default-500">
{INTERNAL_AD_INFO.description}
</div>
<div className="text-tiny md:text-small text-default-500">{PH_INFO.description}</div>
</div>
</a>
</div>