Skip to content

chore: add support us button component with customizable themes and b…#6

Merged
rahul-vyas-dev merged 3 commits intoAOSSIE-Org:mainfrom
rahul-vyas-dev:main
Mar 9, 2026
Merged

chore: add support us button component with customizable themes and b…#6
rahul-vyas-dev merged 3 commits intoAOSSIE-Org:mainfrom
rahul-vyas-dev:main

Conversation

@rahul-vyas-dev
Copy link
Contributor

@rahul-vyas-dev rahul-vyas-dev commented Mar 9, 2026

Overview

This pull request introduces a reusable Sponsors UI component designed to display sponsoring organizations in a structured and visually appealing layout.

The component supports multiple sponsorship tiers and dynamically renders sponsor information such as logos, names, and external links. It also includes a decorative patterned background to improve the visual hierarchy of the section.

Key Features

  • Reusable Sponsors component for displaying sponsor information.
  • Tier-based sponsor sizing (Platinum, Gold, Silver, Bronze) to visually differentiate sponsorship levels.
  • Dynamic rendering of sponsor data using a mapped configuration array.
  • Graceful fallback when sponsor logos are unavailable.
  • Theme compatibility with existing theme variants.
  • Decorative background pattern applied to enhance the section aesthetics.
  • Responsive layout using flexbox and wrapping to support multiple screen sizes.
  • Accessible sponsor links with titles and proper external link attributes.

Implementation Details

  • Built using React and Tailwind CSS.
  • Sponsor cards dynamically adjust their size based on the sponsorshipTier.
  • Background pattern is rendered using an SVG-based repeating grid.
  • Hover interactions were added for subtle card scaling to improve user experience.

UI Improvements

  • Clear visual hierarchy for sponsor tiers.
  • Consistent spacing and alignment across sponsor cards.
  • Improved section presentation with decorative background styling.

Notes

This component is designed to be extensible, allowing additional sponsor tiers or styling adjustments without structural changes.

Note: Some explanatory comments added in the configuration were drafted with assistance from the OpenAI GPT-5.3 (ChatGPT) model to improve clarity and readability of the code for future contributors.

Checklist

  • My code follows the project's code style and conventions
  • I have made corresponding changes to the documentation
  • [x ] My changes generate no new warnings or errors
  • I have joined the Discord server and I will share a link to this PR with the project maintainers there
  • I have read the Contributing Guidelines

⚠️ AI Notice - Important!

We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact.

Summary by CodeRabbit

  • New Features
    • Added a customizable "Support Us" component with hero, organization info, optional sponsors, multiple display patterns, theme-aware styling, and configurable CTAs.
  • Style
    • New theme variables and two additional sponsor pattern styles.
  • Chores
    • Added React dev dependencies and adjusted TypeScript module resolution.
  • API
    • Public exports and related types updated (new variants, pattern option, and optional sponsors).

@github-actions github-actions bot added no-issue-linked PR is not linked to any issue configuration Configuration file changes dependencies Dependency file changes frontend Changes to frontend code javascript JavaScript/TypeScript code changes size/L Large PR (201-500 lines changed) repeat-contributor PR from an external contributor who already had PRs merged pending-coderabbit-review labels Mar 9, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 9, 2026

Walkthrough

Adds React devDependencies, a new themeable React component SupportUsButton (hero, org info, sponsors, CTA), CSS theme variables and sponsor pattern classes, type updates (new variants/patterns, optional sponsors), re-exports and style import in entry, and changes TypeScript module resolution from "nodenext" to "node".

Changes

Cohort / File(s) Summary
Package manifest
package.json
Added devDependencies: @types/react-dom, react, react-dom (^19.2.x).
New component
src/components/SupportUsButton.tsx
Added new default-exported React component (theming, hero, org info, sponsors, CTA) plus helpers for theme/button classes — large UI-centric file; review props, conditional sponsor rendering, and theme class mapping.
Types
src/types/index.ts
Updated ButtonVariant to `'AOSSIE'
Styling
src/styles/style.css
Added theme CSS variables and two sponsor pattern classes using inline SVG data URLs; preserved Tailwind import.
Exports & entry
src/index.ts
Imported styles, re-exported SupportUsButton default and multiple public types from ./types/index.
TypeScript config
tsconfig.json
Changed moduleResolution from "nodenext" to "node".

Sequence Diagram(s)

sequenceDiagram
  participant App as "App (consumer)"
  participant Support as "SupportUsButton (component)"
  participant Types as "Types (src/types)"
  participant Styles as "CSS (src/styles/style.css)"
  App->>Support: import & render SupportUsButton(props)
  Support->>Types: validate/use prop types (Theme, Pattern, ButtonVariant, sponsors?)
  Support->>Styles: apply theme CSS variables & pattern classes
  Support->>Support: render hero, org info, sponsors, CTA buttons
  Support->>App: emit CTA navigation / sponsor links (user interaction)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

Typescript Lang

Poem

🐇 I hopped in with props and a sprinkling of CSS,
A button that glows in each theme that you bless.
Sponsors parade in patterns and light,
Types checked and styled — everything's right.
Click, cheer, and share — a rabbit's small bless.

🚥 Pre-merge checks | ✅ 1 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title references adding a 'support us button component' which matches the main change, but is truncated mid-word ('b…'), making it incomplete and vague about the full scope of customization features. Complete the truncated title to clearly convey all key features, such as: 'chore: add support us button component with customizable themes and patterns' or similar.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/types/index.ts (1)

129-130: ⚠️ Potential issue | 🟡 Minor

Outdated JSDoc comment references removed pattern.

The comment mentions "stripes" as a valid pattern option, but Pattern type on line 119 only includes "AOSSIE" | "dots" | "grid" | "none". Update the comment to reflect the actual pattern options.

📝 Proposed fix
-  // Optional background pattern for the button, can be one of "dots", "grid", "stripes", or "none"
+  // Optional background pattern for the button, can be one of "AOSSIE", "dots", "grid", or "none"
   pattern?: Pattern;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/types/index.ts` around lines 129 - 130, The JSDoc for the property
pattern?: Pattern is stale—update the comment to list the actual variants
defined by the Pattern type (AOSSIE, dots, grid, none) instead of mentioning
"stripes"; locate the Pattern type and the pattern?: Pattern property in this
file and change the descriptive text to reflect those exact options so the
comment matches the type definition.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/components/SupportUsButton.tsx`:
- Line 52: Rename the React component function supportUsButton to PascalCase
SupportUsButton and update all references/exports/usages accordingly (e.g., JSX
tags, default/named export lines, and any imports elsewhere); ensure the
component declaration (supportUsButton) is changed to SupportUsButton and update
occurrences mentioned (including the other occurrence at line 437) so the
identifier and any export/import statements match the new name.
- Line 267: The SupportUsButton component contains hardcoded user-visible
strings (e.g., "Our Sponsors", "ABOUT PROJECT:", and tier labels at locations
inside SupportUsButton) which must be externalized for i18n; update the
component to use your app's i18n helper (e.g., useTranslation or t function) and
replace those literals with translation keys (e.g., supportUs.ourSponsors,
supportUs.aboutProject, supportUs.tier.gold / .silver / .bronze), add
corresponding entries to the locale resource files, and ensure the component
imports and uses the translation function where JSX currently renders the
hardcoded text (also apply same change for the other occurrences noted around
lines 215 and 387-388).
- Around line 1-5: This file is missing the Next.js client directive; add the
"use client" directive as the very first line of
src/components/SupportUsButton.tsx (before any imports) so the SupportUsButton
component and its client-side features (event handlers, browser APIs) run
correctly; no other code changes are needed—just insert the directive above the
imports that reference supportUsButtonProps, Theme, and ButtonVariant.
- Around line 100-113: In the SupportUsButton component's SVG element, add an
accessible <title> element (unique or descriptive, e.g., "Support us heart") and
ensure the SVG is properly connected for accessibility (keep the title text and
optionally set aria-labelledby to its id or add role="img"); also update JSX
attribute names to camelCase: change stroke-width → strokeWidth, stroke-linecap
→ strokeLinecap, and stroke-linejoin → strokeLinejoin on the same <svg> element
so the JSX compiles and the SVG is accessible/rendered correctly.
- Line 401: The Theme class expression is malformed: `${Theme === "light" ||
(Theme === "dark" && classAccordingToTheme(Theme))}` yields boolean true instead
of a class string when Theme === "light"; replace this with a conditional that
returns the actual class string for light or the result of
classAccordingToTheme(Theme) for dark (e.g., use a ternary or explicit if/else)
so the className on the element (in SupportUsButton.tsx where Theme and
classAccordingToTheme are used alongside classNames.ctaSection) always
concatenates valid class strings rather than booleans.
- Around line 326-374: The SVG icons in SupportUsButton (rendered based on
sponsor.sponsorshipTier: "Platinum", "Gold", "Silver", "Bronze") lack accessible
titles; add a <title> element to each SVG and reference it with aria-labelledby
(and keep role="img") so screen readers announce the icon (use unique ids like
"platinum-title", "gold-title", etc. per SVG to avoid collisions); apply the
same pattern to all four SVG blocks in the component.

In `@tsconfig.json`:
- Line 9: Update the TypeScript config's module resolution to match the ESM
bundler setup: change the "moduleResolution" setting from "node" to "bundler" in
tsconfig (since "module" is set to "ESNext") so TypeScript resolves imports the
same way your bundler does; alternatively, if you intend to run directly in Node
rather than through a bundler, set "moduleResolution" to "nodenext".

---

Outside diff comments:
In `@src/types/index.ts`:
- Around line 129-130: The JSDoc for the property pattern?: Pattern is
stale—update the comment to list the actual variants defined by the Pattern type
(AOSSIE, dots, grid, none) instead of mentioning "stripes"; locate the Pattern
type and the pattern?: Pattern property in this file and change the descriptive
text to reflect those exact options so the comment matches the type definition.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2c6c0d29-1cde-43b8-9013-ab6b6676edb8

📥 Commits

Reviewing files that changed from the base of the PR and between ff78d9e and a75ed28.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • package.json
  • src/components/SupportUsButton.tsx
  • src/styles/style.css
  • src/types/index.ts
  • tsconfig.json

Comment on lines +326 to +374
{/* Platinum tier icon */}
{sponsor.sponsorshipTier === "Platinum" && (
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
fill="currentColor"
viewBox="0 0 24 24"
>
<path d="M3 7l4 4 5-7 5 7 4-4v11H3V7z" />
</svg>
)}
{/* Gold tier icon */}
{sponsor.sponsorshipTier === "Gold" && (
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
fill="currentColor"
viewBox="0 0 24 24"
>
<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" />
</svg>
)}
{/* Silver tier icon */}
{sponsor.sponsorshipTier === "Silver" && (
<svg
xmlns="http://www.w3.org/2000/svg"
width="32"
height="32"
fill="currentColor"
viewBox="0 0 24 24"
>
<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" />
</svg>
)}
{/* Bronze tier icon */}
{sponsor.sponsorshipTier === "Bronze" && (
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
fill="currentColor"
viewBox="0 0 24 24"
>
<path d="M2 12l5-5 4 4 4-4 7 7-5 5-4-4-4 4-7-7z" />
</svg>
)}
</div>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Sponsor tier SVGs need accessible titles.

All tier icon SVGs (Platinum, Gold, Silver, Bronze) are missing <title> elements for accessibility, as flagged by static analysis.

📝 Proposed fix for Platinum tier SVG (apply similar pattern to others)
 {sponsor.sponsorshipTier === "Platinum" && (
   <svg
     xmlns="http://www.w3.org/2000/svg"
     width="24"
     height="24"
     fill="currentColor"
     viewBox="0 0 24 24"
   >
+    <title>Platinum tier</title>
     <path d="M3 7l4 4 5-7 5 7 4-4v11H3V7z" />
   </svg>
 )}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{/* Platinum tier icon */}
{sponsor.sponsorshipTier === "Platinum" && (
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
fill="currentColor"
viewBox="0 0 24 24"
>
<path d="M3 7l4 4 5-7 5 7 4-4v11H3V7z" />
</svg>
)}
{/* Gold tier icon */}
{sponsor.sponsorshipTier === "Gold" && (
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
fill="currentColor"
viewBox="0 0 24 24"
>
<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" />
</svg>
)}
{/* Silver tier icon */}
{sponsor.sponsorshipTier === "Silver" && (
<svg
xmlns="http://www.w3.org/2000/svg"
width="32"
height="32"
fill="currentColor"
viewBox="0 0 24 24"
>
<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" />
</svg>
)}
{/* Bronze tier icon */}
{sponsor.sponsorshipTier === "Bronze" && (
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
fill="currentColor"
viewBox="0 0 24 24"
>
<path d="M2 12l5-5 4 4 4-4 7 7-5 5-4-4-4 4-7-7z" />
</svg>
)}
</div>
{/* Platinum tier icon */}
{sponsor.sponsorshipTier === "Platinum" && (
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
fill="currentColor"
viewBox="0 0 24 24"
>
<title>Platinum tier</title>
<path d="M3 7l4 4 5-7 5 7 4-4v11H3V7z" />
</svg>
)}
{/* Gold tier icon */}
{sponsor.sponsorshipTier === "Gold" && (
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
fill="currentColor"
viewBox="0 0 24 24"
>
<title>Gold tier</title>
<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" />
</svg>
)}
{/* Silver tier icon */}
{sponsor.sponsorshipTier === "Silver" && (
<svg
xmlns="http://www.w3.org/2000/svg"
width="32"
height="32"
fill="currentColor"
viewBox="0 0 24 24"
>
<title>Silver tier</title>
<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" />
</svg>
)}
{/* Bronze tier icon */}
{sponsor.sponsorshipTier === "Bronze" && (
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
fill="currentColor"
viewBox="0 0 24 24"
>
<title>Bronze tier</title>
<path d="M2 12l5-5 4 4 4-4 7 7-5 5-4-4-4 4-7-7z" />
</svg>
)}
</div>
🧰 Tools
🪛 Biome (2.4.4)

[error] 328-334: Alternative text title element cannot be empty

(lint/a11y/noSvgWithoutTitle)


[error] 340-346: Alternative text title element cannot be empty

(lint/a11y/noSvgWithoutTitle)


[error] 352-358: Alternative text title element cannot be empty

(lint/a11y/noSvgWithoutTitle)


[error] 364-370: Alternative text title element cannot be empty

(lint/a11y/noSvgWithoutTitle)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/SupportUsButton.tsx` around lines 326 - 374, The SVG icons in
SupportUsButton (rendered based on sponsor.sponsorshipTier: "Platinum", "Gold",
"Silver", "Bronze") lack accessible titles; add a <title> element to each SVG
and reference it with aria-labelledby (and keep role="img") so screen readers
announce the icon (use unique ids like "platinum-title", "gold-title", etc. per
SVG to avoid collisions); apply the same pattern to all four SVG blocks in the
component.

"strict": true,
"jsx": "react-jsx",
"moduleResolution": "nodenext",
"moduleResolution": "node",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

🧩 Analysis chain

🌐 Web query:

TypeScript moduleResolution bundler vs node ESNext

💡 Result:

What’s being compared?

In tsconfig.json, module controls what TS emits (or preserves), while moduleResolution controls how TS type-checks and resolves imports.


moduleResolution: "bundler" (usually with module: "ESNext")

Purpose: Model how modern bundlers resolve imports (Vite/esbuild/Rollup/Webpack). TypeScript added this mode to better match bundler behavior. [1]

Key behavior differences vs Node resolution:

  • Supports package.json exports / imports like Node modes do. [2]
  • Does not require file extensions on relative ESM imports (e.g. ./utils is accepted), because bundlers typically allow it. [2]
  • Can allow “bundler-only” specifiers that would fail when run directly in Node ESM (e.g. extensionless relative imports that Node would reject). TypeScript docs explicitly warn this can be “infectious” for libraries because it can let you publish code Node can’t run. [3]

Use it when:

  • Your runtime is a bundler, and you’re not trying to run the emitted JS directly in Node without bundling.
  • Typical app config: "module": "ESNext", "moduleResolution": "bundler" (especially when another tool emits the final JS). [3]

moduleResolution: "NodeNext" / "Node16" (Node’s ESM/CJS rules)

Purpose: Match Node.js runtime resolution, including the stricter ESM rules. [2]

Key behavior differences vs bundler:

  • Chooses resolution rules based on what Node will see in output (import vs require). [2]
  • In ESM scenarios, it enforces Node-compatible specifiers, including requiring file extensions on relative imports (e.g. ./utils.js). The TS docs call out that Node’s ESM checking is stricter and avoids runtime ERR_MODULE_NOT_FOUND. [3]

Use it when:

  • You will run the output directly in Node (especially ESM, i.e. "type": "module"), or you’re publishing a library and want the strictest, most portable checks. [3]

Practical rule of thumb

  • Bundled app: module: "ESNext" + moduleResolution: "bundler" (lets you write “bundler-style” imports). [2][3]
  • Node runtime (no bundler) / library portability: module: "NodeNext" (or Node16) + matching moduleResolution to catch Node ESM issues early (notably extension requirements). [2][3]

Sources: TypeScript docs on moduleResolution [2], TS handbook guidance + bundler-vs-Node pitfalls (esp. extensionless imports) [3], and TS 5.0 release notes introducing moduleResolution: "bundler" [1].


🏁 Script executed:

cat tsconfig.json

Repository: AOSSIE-Org/SupportUsButton

Length of output: 393


Consider using "moduleResolution": "bundler" for this React project.

With "module": "ESNext" in a bundled React app, "moduleResolution": "bundler" aligns better with how your bundler handles module resolution. The classic "node" mode is outdated for modern ESM projects; "nodenext" is an alternative if the code runs directly in Node.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tsconfig.json` at line 9, Update the TypeScript config's module resolution to
match the ESM bundler setup: change the "moduleResolution" setting from "node"
to "bundler" in tsconfig (since "module" is set to "ESNext") so TypeScript
resolves imports the same way your bundler does; alternatively, if you intend to
run directly in Node rather than through a bundler, set "moduleResolution" to
"nodenext".

@github-actions github-actions bot added size/XL Extra large PR (>500 lines changed) and removed size/L Large PR (201-500 lines changed) labels Mar 9, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

♻️ Duplicate comments (1)
src/components/SupportUsButton.tsx (1)

407-409: ⚠️ Potential issue | 🟡 Minor

Boolean false renders as string in className.

When Theme is not "light" or "dark", the expression (Theme === "light" || Theme === "dark") && classAccordingToTheme(Theme) evaluates to false, which renders as the literal string "false" in the template literal, polluting the className.

📝 Proposed fix
-        className={`w-full flex justify-center p-5 ${(Theme === "light" || Theme === "dark") && classAccordingToTheme(Theme)} ${classNames.ctaSection}`}
+        className={`w-full flex justify-center p-5 ${(Theme === "light" || Theme === "dark") ? classAccordingToTheme(Theme) : ""} ${classNames.ctaSection}`}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/SupportUsButton.tsx` around lines 407 - 409, The className
interpolation in SupportUsButton.tsx can inject the string "false" because the
expression (Theme === "light" || Theme === "dark") &&
classAccordingToTheme(Theme) returns false when Theme is neither "light" nor
"dark"; change this to a safe conditional so only a string is returned (e.g.,
use a ternary: (Theme === "light" || Theme === "dark") ?
classAccordingToTheme(Theme) : '' or otherwise ensure a blank string/default) so
classAccordingToTheme(Theme) is only appended when appropriate and no boolean is
inserted into the className.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/components/SupportUsButton.tsx`:
- Line 76: Replace the loose equality check with strict equality in the
className expression inside SupportUsButton (the Theme conditional that
currently uses `Theme == "light" || Theme == "dark"`); update it to use `===`
for both comparisons so the condition becomes `Theme === "light" || Theme ===
"dark"` and continue to call classAccordingToTheme(Theme) or fallback to the
`"bg-black text-white"` along with `${classNames.container}` as before.
- Around line 279-284: The anchor created inside the SupportUsButton component
uses sponsor.link which is optional; guard against sponsor.link being undefined
by either rendering the <a> only when sponsor.link is truthy or providing a safe
fallback (e.g., '#' or a disabled state) so clicks don't navigate to the current
page; update the rendering logic around the anchor that uses sponsor.link (the
JSX block with href={sponsor.link} and title={`Visit ${sponsor.name}'s
website`}) to conditionally render or substitute a fallback and ensure
rel/target behavior remains correct when link is absent.

In `@src/index.ts`:
- Line 11: The export statement in src/index.ts uses an incorrect import path
string "./components//SupportUsButton" with a double slash; update the path in
the export line (the statement exporting default) to
"./components/SupportUsButton" so the module resolver uses a normalized
single-slash path and avoid potential resolution inconsistencies.
- Around line 17-31: The exported type list has inconsistent indentation for the
entries "Tier" and "Pattern" (they have extra leading spaces) compared to the
other exports; update the export block in the file where the type re-exports are
declared (the export type { ... } statement) to align all entries (Theme,
ButtonVariant, Image, Hero, projectInformation, organizationInformation,
sponsor, sponsors, sponsorLink, CTASection, Tier, Pattern, supportUsButtonProps)
with the same indentation/spacing as the rest of the list.

---

Duplicate comments:
In `@src/components/SupportUsButton.tsx`:
- Around line 407-409: The className interpolation in SupportUsButton.tsx can
inject the string "false" because the expression (Theme === "light" || Theme ===
"dark") && classAccordingToTheme(Theme) returns false when Theme is neither
"light" nor "dark"; change this to a safe conditional so only a string is
returned (e.g., use a ternary: (Theme === "light" || Theme === "dark") ?
classAccordingToTheme(Theme) : '' or otherwise ensure a blank string/default) so
classAccordingToTheme(Theme) is only appended when appropriate and no boolean is
inserted into the className.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: c36bf7f3-a150-45d7-9ff9-3897b2ce37af

📥 Commits

Reviewing files that changed from the base of the PR and between a75ed28 and 29de80d.

📒 Files selected for processing (2)
  • src/components/SupportUsButton.tsx
  • src/index.ts

return (
// Container for the support us button, with dynamic classes based on the selected theme and custom class names
<div
className={`w-full font-sans justify-center items-center text-center ${Theme == "light" || Theme == "dark" ? classAccordingToTheme(Theme) : "bg-black text-white"} ${classNames.container}`}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Consider using strict equality (===).

The condition uses loose equality (==) which works but strict equality is preferred for consistency and to avoid potential type coercion issues.

📝 Proposed fix
-      className={`w-full font-sans justify-center items-center text-center ${Theme == "light" || Theme == "dark" ? classAccordingToTheme(Theme) : "bg-black text-white"} ${classNames.container}`}
+      className={`w-full font-sans justify-center items-center text-center ${Theme === "light" || Theme === "dark" ? classAccordingToTheme(Theme) : "bg-black text-white"} ${classNames.container}`}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/SupportUsButton.tsx` at line 76, Replace the loose equality
check with strict equality in the className expression inside SupportUsButton
(the Theme conditional that currently uses `Theme == "light" || Theme ==
"dark"`); update it to use `===` for both comparisons so the condition becomes
`Theme === "light" || Theme === "dark"` and continue to call
classAccordingToTheme(Theme) or fallback to the `"bg-black text-white"` along
with `${classNames.container}` as before.

Comment on lines +279 to +284
<a
href={sponsor.link}
key={index}
target="_blank"
rel="noopener noreferrer"
title={`Visit ${sponsor.name}'s website`}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Guard against undefined sponsor.link.

Per the type definition, link is optional (link?: string). When undefined, the anchor's href will be undefined, causing clicks to navigate to the current page. Consider conditionally rendering the anchor or using a fallback.

📝 Proposed fix - wrap content conditionally
-              {sponsors.map((sponsor, index) => (
-                <a
-                  href={sponsor.link}
-                  key={index}
-                  target="_blank"
-                  rel="noopener noreferrer"
-                  title={`Visit ${sponsor.name}'s website`}
-                >
+              {sponsors.map((sponsor, index) => {
+                const content = (
                   <div
                     className={`${Theme === "dark" ? "bg-gray-800 text-white" : "bg-white text-black"} rounded-lg flex flex-col justify-center items-center gap-2 p-8 w-fit transition-transform hover:scale-[1.02] shadow-lg min-h-75 min-w-62.5 hover:border-2 
                     ...
                     `}
                   >
                     {/* ... card content ... */}
                   </div>
-                </a>
-              ))}
+                );
+                
+                return sponsor.link ? (
+                  <a
+                    href={sponsor.link}
+                    key={index}
+                    target="_blank"
+                    rel="noopener noreferrer"
+                    title={`Visit ${sponsor.name}'s website`}
+                  >
+                    {content}
+                  </a>
+                ) : (
+                  <div key={index}>{content}</div>
+                );
+              })}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/SupportUsButton.tsx` around lines 279 - 284, The anchor
created inside the SupportUsButton component uses sponsor.link which is
optional; guard against sponsor.link being undefined by either rendering the <a>
only when sponsor.link is truthy or providing a safe fallback (e.g., '#' or a
disabled state) so clicks don't navigate to the current page; update the
rendering logic around the anchor that uses sponsor.link (the JSX block with
href={sponsor.link} and title={`Visit ${sponsor.name}'s website`}) to
conditionally render or substitute a fallback and ensure rel/target behavior
remains correct when link is absent.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/index.ts`:
- Line 4: The package entry (src/index.ts) currently imports
"./styles/style.css" which exposes raw CSS to consumers; remove that import from
the barrel and either (A) add a separate stylesheet entry consumers can opt into
(e.g., publish dist/style.css and add an export/name like "@yourpkg/styles" in
package.json), or (B) update the build pipeline to emit compiled assets into
dist (CSS and JS) and change "main" / "exports" to point at the compiled JS
output instead of src so the CSS is not imported from source; locate the import
in src/index.ts and remove it, then implement one of the two packaging fixes
(separate style export or build/exports update).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4199e97e-e519-439e-aeb7-54fe911c6533

📥 Commits

Reviewing files that changed from the base of the PR and between 29de80d and 6d49025.

📒 Files selected for processing (1)
  • src/index.ts

/* =========================================================
Style
========================================================= */
import "./styles/style.css";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

❓ Verification inconclusive

Script executed:

#!/bin/bash
set -euo pipefail

echo "== package metadata =="
fd '^package\.json$' -x sh -c '
  echo "--- {} ---"
  jq "{name, main, module, types, exports, files, sideEffects}" "{}"
'

echo
echo "== build/package config mentioning entrypoints or CSS =="
fd '^(package\.json|tsup\.config\..*|vite\.config\..*|rollup\.config\..*|webpack\.config\..*)$' -x sh -c '
  echo "--- {} ---"
  rg -n "src/index|dist/index|style\\.css|\\.css|entry|exports|main|module|files|sideEffects" "{}" || true
'

Repository: AOSSIE-Org/SupportUsButton


Repository: AOSSIE-Org/SupportUsButton
Exit code: 1

stdout:

== package metadata ==
--- ./package.json ---

stderr:

jq: error: syntax error, unexpected ',', expecting ':' (Unix shell quoting issues?) at <top-level>, line 1:
{name, main, module, types, exports, files, sideEffects}                   
jq: 1 compile error

Script executed:

#!/bin/bash
set -euo pipefail

echo "== package.json content =="
cat package.json

echo
echo "== src/index.ts content =="
cat src/index.ts

echo
echo "== build config files =="
fd '^(tsup|vite|rollup|webpack)\.config\.' -type f -exec echo "--- {} ---" \; -exec cat {} \;

Repository: AOSSIE-Org/SupportUsButton


Repository: AOSSIE-Org/SupportUsButton
Exit code: 2

stdout:

== package.json content ==
{
  "name": "@aossie/support-us-button",
  "version": "1.0.0",
  "description": "A customizable and flexible Support Us button component for integrating sponsorship and donation options into web applications.",
  "keywords": [
    "aossie",
    "support",
    "donation",
    "sponsor",
    "button",
    "widget",
    "open-source"
  ],
  "homepage": "https://github.com/AOSSIE-Org/SupportUsButton#readme",
  "bugs": {
    "url": "https://github.com/AOSSIE-Org/SupportUsButton/issues"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/AOSSIE-Org/SupportUsButton.git"
  },
  "license": "GNU General Public License v3.0",
  "author": "AOSSIE Organization",
  "type": "module",
  "main": "src/index.ts",
  "files": [
    "dist",
    "index.js",
    "README.md",
    "LICENSE"
  ],
  "scripts": {
    "test": "echo \"No tests specified\"",
    "build": "echo \"Build step not configured yet\""
  },
  "engines": {
    "node": ">=14"
  },
  "devDependencies": {
    "@tailwindcss/postcss": "^4.2.1",
    "@types/react": "^19.2.14",
    "@types/react-dom": "^19.2.3",
    "autoprefixer": "^10.4.27",
    "postcss": "^8.5.6",
    "react": "^19.2.4",
    "react-dom": "^19.2.4",
    "tailwindcss": "^4.2.1",
    "typescript": "^5.9.3"
  },
  "peerDependencies": {
    "react": ">=18",
    "react-dom": ">=18"
  }
}

== src/index.ts content ==
/* =========================================================
   Style 
========================================================= */
import "./styles/style.css";

/* =========================================================
   Components
========================================================= */

export { default } from "./components/SupportUsButton";

/* =========================================================
   Types
========================================================= */

export type {
  Theme,
  ButtonVariant,
  Image,
  Hero,
  projectInformation,
  organizationInformation,
  sponsor,
  sponsors,
  sponsorLink,
  CTASection,
  Tier,
  Pattern,
  supportUsButtonProps,
} from "./types/index";

== build config files ==

stderr:

error: 'ype' isn't a valid value for '--type <filetype>'
  [possible values: file, directory, symlink, executable, empty, socket, pipe]

For more information try '--help'

Remove the CSS import from the package entry point, or configure a proper build and exports strategy.

Line 4 imports ./styles/style.css directly in the main entry (src/index.ts). When consumers install this package, they receive an uncompiled CSS import in their bundler, causing Next.js "CSS Imported by a Dependency" errors and general build incompatibility. Either:

  1. Configure a build process (tsup, vite, etc.) that compiles source to dist/ and updates "main" and "exports" to point to compiled output, or
  2. Document a separate style entry (e.g., "@aossie/support-us-button/styles"dist/style.css) for consumers to import explicitly

The CSS import in a barrel entry violates Next.js packaging expectations and creates undefined behavior across bundler environments.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/index.ts` at line 4, The package entry (src/index.ts) currently imports
"./styles/style.css" which exposes raw CSS to consumers; remove that import from
the barrel and either (A) add a separate stylesheet entry consumers can opt into
(e.g., publish dist/style.css and add an export/name like "@yourpkg/styles" in
package.json), or (B) update the build pipeline to emit compiled assets into
dist (CSS and JS) and change "main" / "exports" to point at the compiled JS
output instead of src so the CSS is not imported from source; locate the import
in src/index.ts and remove it, then implement one of the two packaging fixes
(separate style export or build/exports update).

@rahul-vyas-dev rahul-vyas-dev merged commit 9744a78 into AOSSIE-Org:main Mar 9, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

configuration Configuration file changes dependencies Dependency file changes frontend Changes to frontend code javascript JavaScript/TypeScript code changes no-issue-linked PR is not linked to any issue pending-coderabbit-review repeat-contributor PR from an external contributor who already had PRs merged size/XL Extra large PR (>500 lines changed)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant