Skip to content

Commit 139653b

Browse files
authored
feat: add Product Hunt integration to hero component. (#163)
1 parent ebdf219 commit 139653b

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

apps/docs/components/landing/hero.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
'use client';
22

33
import dynamic from 'next/dynamic';
4+
import Image from 'next/image';
5+
import { useTheme } from 'next-themes';
46
import DemoContainer from './demo';
57
import { SciFiButton } from './scifi-btn';
68
import { Spotlight } from './spotlight';
@@ -26,6 +28,9 @@ export default function Hero() {
2628
}
2729
};
2830

31+
const { resolvedTheme } = useTheme();
32+
const isDarkMode = resolvedTheme === 'dark';
33+
2934
return (
3035
<section className="relative flex min-h-[100svh] w-full flex-col items-center overflow-hidden">
3136
<Spotlight transform="translateX(-60%) translateY(-50%)" />
@@ -34,6 +39,21 @@ export default function Hero() {
3439
<div className="grid grid-cols-1 items-center gap-8 pt-12 pb-6 sm:pt-16 sm:pb-8 lg:grid-cols-2 lg:gap-12 lg:pt-20 lg:pb-12 xl:gap-16">
3540
{/* Text Content */}
3641
<div className="order-2 flex flex-col items-center gap-6 text-center lg:order-1 lg:items-start lg:gap-8 lg:text-left">
42+
<div>
43+
<a
44+
className="block transition-transform hover:scale-105"
45+
href="https://www.producthunt.com/products/databuddy-analytics"
46+
rel="noopener noreferrer"
47+
target="_blank"
48+
>
49+
<Image
50+
alt="Databuddy Analytics on Product Hunt"
51+
height={40}
52+
src={`https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=1021633&theme=${isDarkMode ? 'dark' : 'light'}`}
53+
width={250}
54+
/>
55+
</a>
56+
</div>
3757
<div className="self-center lg:self-start">
3858
<div className="inline-flex items-center rounded-full border border-border bg-background/80 px-3 py-1 font-medium text-muted-foreground text-xs shadow backdrop-blur">
3959
<span>Rejected by</span>

apps/docs/next.config.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ const config = {
9292
protocol: 'https',
9393
hostname: 'pbs.twimg.com',
9494
},
95+
{
96+
protocol: 'https',
97+
hostname: 'api.producthunt.com',
98+
},
9599
],
96100
formats: ['image/webp', 'image/avif'],
97101
minimumCacheTTL: 60 * 60 * 24 * 30, // 30 days

0 commit comments

Comments
 (0)