|
| 1 | +import React, { useState } from "react"; |
| 2 | +import SupportUsButton from "../src/index"; |
| 3 | +import type { Theme, supportUsButtonProps } from "../src/types/index"; |
| 4 | +import "../src/styles/style.css"; |
| 5 | + |
| 6 | +export function App() { |
| 7 | + const [theme, setTheme] = useState<Theme>("dark"); |
| 8 | + const [showLogo, setShowLogo] = useState<boolean>(true); |
| 9 | + |
| 10 | + const sampleProps: supportUsButtonProps = { |
| 11 | + Theme: theme, |
| 12 | + Logo: showLogo, |
| 13 | + organizationInformation: { |
| 14 | + name: "AOSSIE", |
| 15 | + desc: "Australian Open Source Software Innovation and Education organization dedicated to fostering innovation and open source projects globally.", |
| 16 | + image: "/aossie_logomark.svg", |
| 17 | + link: "https://aossie.org", |
| 18 | + }, |
| 19 | + projectInformation: { |
| 20 | + name: "SupportUsButton", |
| 21 | + description: "A lightweight, tier-based React component library for displaying donation and sponsorship options cleanly.", |
| 22 | + image: "/stability.svg", |
| 23 | + }, |
| 24 | + sponsors: [ |
| 25 | + { name: "Google Open Source", sponsorshipTier: "Platinum" }, |
| 26 | + { name: "GitHub Sponsors", sponsorshipTier: "Platinum" }, |
| 27 | + { name: "Stability Nexus", sponsorshipTier: "Gold" }, |
| 28 | + ], |
| 29 | + ctaSection: { |
| 30 | + sponsorLink: [ |
| 31 | + { name: "Sponsor Us", url: "https://github.com/sponsors/AOSSIE-Org" }, |
| 32 | + ], |
| 33 | + }, |
| 34 | + }; |
| 35 | + |
| 36 | + return ( |
| 37 | + <div className={`min-h-screen transition-colors duration-300 ${theme === "dark" ? "bg-zinc-950 text-white" : "bg-gray-100 text-zinc-900"}`}> |
| 38 | + {/* Top Controls Bar */} |
| 39 | + <header className={`sticky top-0 z-50 backdrop-blur-md ${theme === "dark" ? "bg-zinc-950/80 border-zinc-800" : "bg-gray-100/80 border-gray-300"} border-b p-4 flex flex-wrap items-center justify-between gap-4 max-w-7xl mx-auto`}> |
| 40 | + <div className="flex items-center gap-3"> |
| 41 | + <img src="/aossie_logomark.svg" alt="AOSSIE Logo" className={`h-8 w-auto ${theme === "dark" ? "brightness-0 invert" : "brightness-0"}`} /> |
| 42 | + <h1 className="text-xl font-bold tracking-tight">SupportUsButton — Dev Preview</h1> |
| 43 | + </div> |
| 44 | + |
| 45 | + <div className="flex items-center gap-4"> |
| 46 | + <div className="flex items-center gap-2"> |
| 47 | + <span className="text-sm font-medium">Theme:</span> |
| 48 | + <button |
| 49 | + onClick={() => setTheme(theme === "dark" ? "light" : "dark")} |
| 50 | + className="px-4 py-2 rounded-lg text-sm font-semibold transition-all duration-200 border border-amber-500/40 bg-amber-500/10 hover:bg-amber-500 hover:text-black text-amber-400 cursor-pointer active:scale-95 shadow-sm hover:shadow-amber-500/25" |
| 51 | + > |
| 52 | + {theme === "dark" ? "☀️ Light Mode" : "🌙 Dark Mode"} |
| 53 | + </button> |
| 54 | + </div> |
| 55 | + |
| 56 | + <div className="flex items-center gap-2"> |
| 57 | + <span className="text-sm font-medium">BG Logo:</span> |
| 58 | + <button |
| 59 | + onClick={() => setShowLogo(!showLogo)} |
| 60 | + className={`px-4 py-2 rounded-lg text-sm font-semibold transition-all duration-200 border cursor-pointer active:scale-95 shadow-sm ${ |
| 61 | + showLogo |
| 62 | + ? "bg-emerald-500/20 border-emerald-500/50 text-emerald-400 hover:bg-emerald-500 hover:text-white hover:shadow-emerald-500/25" |
| 63 | + : "bg-zinc-800 border-zinc-700 text-gray-400 hover:bg-zinc-700 hover:text-white" |
| 64 | + }`} |
| 65 | + > |
| 66 | + {showLogo ? "ON" : "OFF"} |
| 67 | + </button> |
| 68 | + </div> |
| 69 | + </div> |
| 70 | + </header> |
| 71 | + |
| 72 | + {/* Main Component Preview Container */} |
| 73 | + <main className="w-full"> |
| 74 | + <SupportUsButton {...sampleProps} /> |
| 75 | + </main> |
| 76 | + </div> |
| 77 | + ); |
| 78 | +} |
0 commit comments