11"use client" ;
22import React , { useState } from "react" ;
33import { motion } from "motion/react" ;
4- import {
5- MessageSquare ,
6- Coffee ,
7- QrCode ,
8- Copy ,
9- Check ,
10- Star ,
11- Github ,
12- } from "lucide-react" ;
134import { Button } from "@/components/ui/button" ;
145import {
156 Tooltip ,
@@ -18,24 +9,18 @@ import {
189 TooltipTrigger ,
1910} from "@/components/ui/tooltip" ;
2011import Link from "next/link" ;
21-
22- const DEMO_SPONSORS = [
23- {
24- name : "Alex Johnson" ,
25- amount : "$50" ,
26- message : "Great work! Keep it up." ,
27- } ,
28- {
29- name : "Sarah Smith" ,
30- amount : "$25" ,
31- message : "Love these icons!" ,
32- } ,
33- {
34- name : "Mike Brown" ,
35- amount : "$10" ,
36- message : "Thanks for open sourcing." ,
37- } ,
38- ] ;
12+ import { LINKS , SPONSOR } from "@/constants" ;
13+ import QrCodeIcon from "@/icons/qrcode-icon" ;
14+ import GithubIcon from "@/icons/github-icon" ;
15+ import AtSignIcon from "@/icons/at-sign-icon" ;
16+ import CheckedIcon from "@/icons/checked-icon" ;
17+ import CopyIcon from "@/icons/copy-icon" ;
18+ import XIcon from "@/icons/x-icon" ;
19+ import CoffeeIcon from "@/icons/coffee-icon" ;
20+ import MessageCircleIcon from "@/icons/message-circle-icon" ;
21+ import CurrencyBitcoinIcon from "@/icons/currency-bitcoin-icon" ;
22+ import CurrencyEthereumIcon from "@/icons/currency-ethereum-icon" ;
23+ import Image from "next/image" ;
3924
4025const SponsorCard = ( {
4126 title,
@@ -88,12 +73,12 @@ const CopyField = ({ label, value }: { label: string; value: string }) => {
8873 < TooltipTrigger asChild >
8974 < button
9075 onClick = { handleCopy }
91- className = "text-muted-foreground hover:text-foreground ml-2 transition-colors"
76+ className = "text-muted-foreground hover:text-foreground ml-2 flex justify-center text-center transition-colors"
9277 >
9378 { copied ? (
94- < Check className = "h-4 w-4 text-green-500" />
79+ < CheckedIcon className = "h-4 w-4 text-green-500" />
9580 ) : (
96- < Copy className = "h-4 w-4" />
81+ < CopyIcon className = "h-4 w-4" />
9782 ) }
9883 </ button >
9984 </ TooltipTrigger >
@@ -108,6 +93,8 @@ const CopyField = ({ label, value }: { label: string; value: string }) => {
10893} ;
10994
11095export default function SponsorContent ( ) {
96+ const [ showQrCode , setShowQrCode ] = useState ( false ) ;
97+
11198 return (
11299 < div className = "bg-background text-foreground min-h-screen py-24" >
113100 < div className = "container mx-auto max-w-5xl px-4" >
@@ -128,14 +115,14 @@ export default function SponsorContent() {
128115 </ p >
129116 < div className = "flex justify-center gap-4" >
130117 < Button asChild size = "lg" className = "gap-2" >
131- < Link href = "" target = "_blank" >
132- < MessageSquare className = "h-4 w-4" />
118+ < Link href = { LINKS . CREATOR } target = "_blank" >
119+ < MessageCircleIcon className = "h-4 w-4" />
133120 Leave Feedback
134121 </ Link >
135122 </ Button >
136123 < Button asChild variant = "outline" size = "lg" className = "gap-2" >
137- < Link href = "" target = "_blank" >
138- < Github className = "h-4 w-4" />
124+ < Link href = { LINKS . GITHUB } target = "_blank" >
125+ < GithubIcon className = "h-4 w-4" />
139126 Star on GitHub
140127 </ Link >
141128 </ Button >
@@ -147,26 +134,72 @@ export default function SponsorContent() {
147134 < SponsorCard
148135 title = "Buy Me a Coffee"
149136 description = "Support with a small donation."
150- icon = { < Coffee className = "h-6 w-6 text-yellow-500" /> }
137+ icon = { < CoffeeIcon className = "h-6 w-6 text-yellow-500" /> }
151138 delay = { 0.1 }
152139 >
153140 < Button
154141 asChild
155142 className = "w-full bg-[#FFDD00] text-black hover:bg-[#FFDD00]/90"
156143 >
157- < Link href = "" target = "_blank" >
144+ < Link href = { SPONSOR . buymeacoffee } target = "_blank" >
158145 Buy Me a Coffee
159146 </ Link >
160147 </ Button >
161148 </ SponsorCard >
162149
150+ < div className = "relative" >
151+ < SponsorCard
152+ title = "UPI"
153+ description = "Direct transfer via UPI."
154+ icon = { < AtSignIcon className = "h-6 w-6 text-blue-500" /> }
155+ delay = { 0.2 }
156+ >
157+ < >
158+ < TooltipProvider >
159+ < Tooltip >
160+ < TooltipTrigger asChild >
161+ < button
162+ onClick = { ( ) => setShowQrCode ( true ) }
163+ className = "text-muted-foreground hover:text-primary absolute top-6 right-6 transition-colors"
164+ >
165+ < QrCodeIcon className = "h-5 w-5" />
166+ </ button >
167+ </ TooltipTrigger >
168+ < TooltipContent >
169+ < p > See QR Code</ p >
170+ </ TooltipContent >
171+ </ Tooltip >
172+ </ TooltipProvider >
173+ < CopyField label = "UPI ID" value = { SPONSOR . upiId } />
174+ </ >
175+ </ SponsorCard >
176+ </ div >
177+
178+ < SponsorCard
179+ title = "Bitcoin (BTC)"
180+ description = "Support via Bitcoin."
181+ icon = { < CurrencyBitcoinIcon className = "h-6 w-6 text-orange-500" /> }
182+ delay = { 0.3 }
183+ >
184+ < CopyField label = "BTC Address" value = { SPONSOR . btc } />
185+ </ SponsorCard >
186+
187+ < SponsorCard
188+ title = "Ethereum (ETH)"
189+ description = "Support via Ethereum."
190+ icon = { < CurrencyEthereumIcon className = "h-6 w-6 text-purple-500" /> }
191+ delay = { 0.4 }
192+ >
193+ < CopyField label = "ETH Address" value = { SPONSOR . eth } />
194+ </ SponsorCard >
195+
163196 < SponsorCard
164- title = "UPI "
165- description = "Direct transfer via UPI ."
166- icon = { < QrCode className = "h-6 w-6 text-blue -500" /> }
167- delay = { 0.2 }
197+ title = "Solana (SOL) "
198+ description = "Support via Solana ."
199+ icon = { < AtSignIcon className = "h-6 w-6 text-green -500" /> }
200+ delay = { 0.5 }
168201 >
169- < CopyField label = "UPI ID " value = "" />
202+ < CopyField label = "SOL Address " value = { SPONSOR . sol } />
170203 </ SponsorCard >
171204 </ div >
172205
@@ -180,26 +213,8 @@ export default function SponsorContent() {
180213 < h2 className = "mb-8 text-3xl font-bold tracking-tight" >
181214 Recent Sponsors
182215 </ h2 >
183- < div className = "grid gap-4 sm:grid-cols-2 lg:grid-cols-3" >
184- { DEMO_SPONSORS . map ( ( sponsor , index ) => (
185- < div
186- key = { index }
187- className = "bg-card/50 flex items-center gap-4 rounded-xl border p-4 backdrop-blur-sm"
188- >
189- < div className = "bg-primary/10 flex h-12 w-12 items-center justify-center rounded-full text-xl font-bold" >
190- { sponsor . name . charAt ( 0 ) }
191- </ div >
192- < div className = "text-left" >
193- < div className = "font-semibold" > { sponsor . name } </ div >
194- < div className = "text-muted-foreground text-sm" >
195- { sponsor . message }
196- </ div >
197- </ div >
198- < div className = "ml-auto font-mono text-sm font-medium text-green-500" >
199- { sponsor . amount }
200- </ div >
201- </ div >
202- ) ) }
216+ < div className = "flex items-center justify-center" >
217+ No sponsors yet
203218 </ div >
204219 </ motion . div >
205220 </ div >
@@ -211,23 +226,57 @@ export default function SponsorContent() {
211226 className = "bg-card/50 mt-16 rounded-2xl border p-8 text-center backdrop-blur-sm"
212227 >
213228 < div className = "flex flex-col items-center gap-4" >
214- < div className = "bg-primary/10 rounded-full p-4" >
215- < Star className = "text-primary h-8 w-8 fill-current" />
216- </ div >
217229 < h2 className = "text-2xl font-bold" > Star us on GitHub</ h2 >
218230 < p className = "text-muted-foreground max-w-lg" >
219231 If you like this project, please give it a star on GitHub. It
220232 helps more people discover the project and motivates me to build
221233 more!
222234 </ p >
223235 < Button asChild size = "lg" variant = "secondary" className = "gap-2" >
224- < Link href = "" target = "_blank" >
225- < Github className = "h-4 w-4" />
236+ < Link href = { LINKS . GITHUB } target = "_blank" >
237+ < GithubIcon className = "h-4 w-4" />
226238 Star Repository
227239 </ Link >
228240 </ Button >
229241 </ div >
230242 </ motion . div >
243+
244+ { /* QR Code Modal */ }
245+ { showQrCode && (
246+ < div
247+ className = "fixed inset-0 z-50 flex items-center justify-center bg-black/80 p-4 backdrop-blur-sm"
248+ onClick = { ( ) => setShowQrCode ( false ) }
249+ >
250+ < motion . div
251+ initial = { { opacity : 0 , scale : 0.9 } }
252+ animate = { { opacity : 1 , scale : 1 } }
253+ exit = { { opacity : 0 , scale : 0.9 } }
254+ transition = { { duration : 0.2 } }
255+ className = "bg-card relative w-full max-w-md rounded-2xl border p-6"
256+ onClick = { ( e ) => e . stopPropagation ( ) }
257+ >
258+ < button
259+ onClick = { ( ) => setShowQrCode ( false ) }
260+ className = "text-muted-foreground hover:text-foreground absolute top-4 right-4 transition-colors"
261+ >
262+ < XIcon className = "h-5 w-5" />
263+ </ button >
264+ < h3 className = "mb-4 text-xl font-semibold" > UPI QR Code</ h3 >
265+ < div className = "rounded-lg bg-white p-4" >
266+ < Image
267+ src = { SPONSOR . qrCode }
268+ alt = "UPI QR Code"
269+ width = { 200 }
270+ height = { 200 }
271+ className = "h-auto w-full"
272+ />
273+ </ div >
274+ < p className = "text-muted-foreground mt-4 text-center text-sm" >
275+ Scan this QR code to make a UPI payment
276+ </ p >
277+ </ motion . div >
278+ </ div >
279+ ) }
231280 </ div >
232281 </ div >
233282 ) ;
0 commit comments