Skip to content

Commit 29de80d

Browse files
chore: rename supportUsButton function to SupportUsButton and update class names for consistency
1 parent a75ed28 commit 29de80d

2 files changed

Lines changed: 49 additions & 11 deletions

File tree

src/components/SupportUsButton.tsx

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function getButtonClasses(buttonVariant: ButtonVariant): string {
4949
}
5050

5151
// Main component function that renders the support us button, taking in various props for customization and rendering different sections such as hero, organization information, sponsors, and call-to-action based on the provided data and selected theme and button variant
52-
function supportUsButton({
52+
function SupportUsButton({
5353
Theme = "AOSSIE",
5454
pattern = "AOSSIE",
5555
hero = {
@@ -73,7 +73,7 @@ function supportUsButton({
7373
return (
7474
// Container for the support us button, with dynamic classes based on the selected theme and custom class names
7575
<div
76-
className={`w-full justify-center items-center text-center ${Theme == "light" || Theme == "dark" ? classAccordingToTheme(Theme) : "bg-black text-white"} ${classNames.container}`}
76+
className={`w-full font-sans justify-center items-center text-center ${Theme == "light" || Theme == "dark" ? classAccordingToTheme(Theme) : "bg-black text-white"} ${classNames.container}`}
7777
>
7878
{/* Hero section with optional background image*/}
7979
<div className="relative w-full h-[50vh] flex justify-center">
@@ -104,11 +104,12 @@ function supportUsButton({
104104
viewBox="0 0 24 24"
105105
fill="black"
106106
stroke="black"
107-
stroke-width="2"
108-
stroke-linecap="round"
109-
stroke-linejoin="round"
107+
strokeWidth="2"
108+
strokeLinecap="round"
109+
strokeLinejoin="round"
110110
className="lucide lucide-heart-icon lucide-heart"
111111
>
112+
<title>Support heart icon</title>
112113
<path d="M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5" />
113114
</svg>
114115
</div>
@@ -118,7 +119,7 @@ function supportUsButton({
118119
{hero.title}
119120
</h1>
120121
<p
121-
className={`wrap-anywhere ${Theme === "light" ? "text-slate-600" : "text-slate-400"} text-lg`}
122+
className={`wrap-anywhere ${Theme === "light" ? "text-slate-600" : "text-slate-400"} text-lg font-semibold`}
122123
>
123124
{hero.description}
124125
</p>
@@ -332,6 +333,7 @@ function supportUsButton({
332333
fill="currentColor"
333334
viewBox="0 0 24 24"
334335
>
336+
<title>Platinum tier icon</title>
335337
<path d="M3 7l4 4 5-7 5 7 4-4v11H3V7z" />
336338
</svg>
337339
)}
@@ -344,6 +346,7 @@ function supportUsButton({
344346
fill="currentColor"
345347
viewBox="0 0 24 24"
346348
>
349+
<title>Gold tier icon</title>
347350
<path d="M6 2h12v3h3v3a5 5 0 0 1-5 5h-1a5 5 0 0 1-4 3.9V20h4v2H9v-2h4v-3.1A5 5 0 0 1 9 13H8a5 5 0 0 1-5-5V5h3V2z" />
348351
</svg>
349352
)}
@@ -356,6 +359,7 @@ function supportUsButton({
356359
fill="currentColor"
357360
viewBox="0 0 24 24"
358361
>
362+
<title>Silver tier icon</title>
359363
<path d="M12 14a5 5 0 1 0 0-10 5 5 0 0 0 0 10zm0 2l-3 6 3-2 3 2-3-6z" />
360364
</svg>
361365
)}
@@ -368,6 +372,7 @@ function supportUsButton({
368372
fill="currentColor"
369373
viewBox="0 0 24 24"
370374
>
375+
<title>Bronze tier icon</title>
371376
<path d="M2 12l5-5 4 4 4-4 7 7-5 5-4-4-4 4-7-7z" />
372377
</svg>
373378
)}
@@ -384,9 +389,11 @@ function supportUsButton({
384389

385390
<div className="w-full">
386391
<h3 className={`font-bold text-2xl`}>{sponsor.name}</h3>
387-
<span className="flex text-[16px] p-2 rounded-xl items-center mt-3.5 font-semibold bg-[#d0f2eb] w-fit">
388-
{sponsor.sponsorshipTier}
389-
</span>
392+
{sponsor.sponsorshipTier && (
393+
<span className="flex text-[16px] p-2 rounded-xl items-center mt-3.5 font-semibold bg-[#d0f2eb] text-black w-fit">
394+
{sponsor.sponsorshipTier}
395+
</span>
396+
)}
390397
</div>
391398
</div>
392399
</a>
@@ -398,7 +405,7 @@ function supportUsButton({
398405

399406
{/* Call-to-action section with title, description, and sponsor links */}
400407
<div
401-
className={`w-full flex justify-center p-5 ${Theme === "light" || (Theme === "dark" && classAccordingToTheme(Theme))} ${classNames.ctaSection}`}
408+
className={`w-full flex justify-center p-5 ${(Theme === "light" || Theme === "dark") && classAccordingToTheme(Theme)} ${classNames.ctaSection}`}
402409
>
403410
<div className="w-4/5 flex flex-col items-center gap-5 py-20 border border-primary rounded-sm">
404411
<h2 className={`font-extrabold text-4xl md:text-5xl lg:text-6xl`}>
@@ -434,4 +441,4 @@ function supportUsButton({
434441
);
435442
}
436443

437-
export default supportUsButton;
444+
export default SupportUsButton;

src/index.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/* =========================================================
2+
Style
3+
========================================================= */
4+
import "./styles/style.css";
5+
6+
7+
/* =========================================================
8+
Components
9+
========================================================= */
10+
11+
export { default } from "./components//SupportUsButton";
12+
13+
/* =========================================================
14+
Types
15+
========================================================= */
16+
17+
export type {
18+
Theme,
19+
ButtonVariant,
20+
Image,
21+
Hero,
22+
projectInformation,
23+
organizationInformation,
24+
sponsor,
25+
sponsors,
26+
sponsorLink,
27+
CTASection,
28+
Tier,
29+
Pattern,
30+
supportUsButtonProps
31+
} from "./types/index";

0 commit comments

Comments
 (0)