npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@gitcoin/grants-stack-widget-react

v0.0.6

Published

This widget displays active donation rounds and offers a direct link for contributions to your project. Follow this guide for a quick and easy setup.

Downloads

8

Readme

Grants Stack Widget React Component

This widget displays active donation rounds and offers a direct link for contributions to your project. Follow this guide for a quick and easy setup.

🚀 Getting Started

Installation

First, install the widget using npm:

npm install @gitcoin/grants-stack-widget-react

Usage

Import the Widget component and use it in your application as shown below:

import Widget from "@gitcoin/grants-stack-widget-react";

<Widget
  projectId={
    "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
  }
/>;

📋 Props

The Widget component accepts the following props:

Required Props

  • projectId: string (Required): The project ID in bytes32 format (e.g., 0x1234...).

Optional Props

  • scale: number (Optional, default: 1): Adjust the scale of the widget.
  • testnet: boolean (Optional, default: false): Use testnet configurations.
  • explorerUrl: string (Optional): Custom explorer URL.
  • indexerEndpoint: string (Optional): Custom indexer endpoint URL.
  • chainsOverride: number[] (Optional): Override the list of chain IDs.

🔧 Customization

Scaling the Widget

You can adjust the scale of the widget using the scale prop:

<Widget
  projectId={
    "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
  }
  scale={1.5}
/>

Using Testnet

If you want to show testnet rounds as well, set the testnet prop to true:

<Widget
  projectId={
    "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
  }
  testnet={true}
/>

Custom Explorer URL

You can specify a custom Gitcoin Explorer URL using the explorerUrl prop:

<Widget
  projectId={
    "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
  }
  explorerUrl="https://mycustomexplorer.com"
/>

Custom Indexer Endpoint

If you have a custom indexer endpoint, you can set it using the indexerEndpoint prop:

<Widget
  projectId={
    "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
  }
  indexerEndpoint="https://myindexer.com"
/>

Chains Override

To override the list of chain IDs, use the chainsOverride prop:

<Widget
  projectId={
    "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
  }
  chainsOverride={[1, 3, 4]}
/>

📚 Full Example

Here's a complete example with all props:

import React from "react";
import ReactDOM from "react-dom";
import Widget from "@gitcoin/grants-stack-widget-react";

const App = () => (
  <div>
    <Widget
      projectId={
        "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
      }
      scale={1.2}
      testnet={true}
      explorerUrl="https://mycustomexplorer.com"
      indexerEndpoint="https://myindexer.com"
      chainsOverride={[1, 42, 100]}
    />
  </div>
);

ReactDOM.render(<App />, document.getElementById("root"));

🛠️ Development

To contribute or make changes, follow these steps:

  1. Clone the repository.
  2. Run npm install to install dependencies.
  3. Run npm build to build the package.
  4. Make your changes and submit a pull request.

For any questions or issues, please open an issue on GitHub or contact the maintainers.

Happy coding! 🚀