Merge branch 'main' of github.com:heroui-inc/heroui into canary

This commit is contained in:
Junior Garcia 2025-06-01 16:19:52 -03:00
commit 1f8cb0717c
2 changed files with 19 additions and 15 deletions

View File

@ -12,7 +12,7 @@ import {siteConfig} from "@/config/site";
import {fonts} from "@/config/fonts"; import {fonts} from "@/config/fonts";
import {Navbar} from "@/components/navbar"; import {Navbar} from "@/components/navbar";
import {Footer} from "@/components/footer"; import {Footer} from "@/components/footer";
import {ProBanner} from "@/components/pro-banner"; import {HeroUIChatBanner} from "@/components/heroui-chat-banner";
export const metadata: Metadata = { export const metadata: Metadata = {
title: { title: {
@ -82,7 +82,7 @@ export default function RootLayout({children}: {children: React.ReactNode}) {
> >
<Providers themeProps={{attribute: "class", defaultTheme: "dark"}}> <Providers themeProps={{attribute: "class", defaultTheme: "dark"}}>
<div className="relative flex flex-col" id="app-container"> <div className="relative flex flex-col" id="app-container">
<ProBanner /> <HeroUIChatBanner />
<Navbar mobileRoutes={manifest.mobileRoutes} routes={manifest.routes} /> <Navbar mobileRoutes={manifest.mobileRoutes} routes={manifest.routes} />
{children} {children}
<Analytics mode="production" /> <Analytics mode="production" />

View File

@ -11,12 +11,13 @@ import {useIsMounted} from "@/hooks/use-is-mounted";
import {__PROD__, __ENABLE_ADS__} from "@/utils"; import {__PROD__, __ENABLE_ADS__} from "@/utils";
const EA_PROVIDER_RATIO = 0.85; const EA_PROVIDER_RATIO = 0.85;
const PRODUCT_HUNT_ENABLED = false; const INTERNAL_AD_ENABLED = true;
const PH_INFO = { const INTERNAL_AD_INFO = {
description: "Join the conversation and help us get #1 Product of the Week! ↗", description: "Join our hackathon, $6k in prizes + 3 months of HeroUI Chat Pro! ↗",
title: "We're live on Product Hunt! (30% OFF)", title: "Hackathon #HeroHack",
url: "https://ph.heroui.chat?utm_source=heroui.chat&utm_medium=banner", 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> = () => { export const CarbonAd: React.FC<unknown> = () => {
@ -49,7 +50,7 @@ export const CarbonAd: React.FC<unknown> = () => {
}, []); }, []);
useEffect(() => { useEffect(() => {
if (PRODUCT_HUNT_ENABLED) return; if (INTERNAL_AD_ENABLED) return;
const shouldShowEthicalAds = Math.random() < EA_PROVIDER_RATIO; const shouldShowEthicalAds = Math.random() < EA_PROVIDER_RATIO;
@ -106,25 +107,28 @@ export const CarbonAd: React.FC<unknown> = () => {
}; };
}, [isMounted]); }, [isMounted]);
if (PRODUCT_HUNT_ENABLED) { if (INTERNAL_AD_ENABLED) {
return ( 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"> <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 <a
className="group flex items-center flex gap-2 h-full" className="group flex items-center flex gap-4 h-full"
href={PH_INFO.url} href={INTERNAL_AD_INFO.url}
rel="noopener noreferrer" rel="noopener noreferrer"
target="_blank" target="_blank"
> >
<Image <Image
removeWrapper
alt="Product Hunt" alt="Product Hunt"
className="m-0 w-[80px] h-[80px] object-cover" className="m-0 w-[120px] h-[80px] object-cover rounded-[8px]"
src="/product-hunt.png" src={INTERNAL_AD_INFO.img}
/> />
<div className="flex flex-col gap-0.5 pointer-events-none"> <div className="flex flex-col gap-0.5 pointer-events-none">
<div className="text-small md:text-medium font-medium no-underline"> <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>
<div className="text-tiny md:text-small text-default-500">{PH_INFO.description}</div>
</div> </div>
</a> </a>
</div> </div>