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

@bitiumagency/web3-react-modal

v6.0.0

Published

@Web3-react's plugin to display modal

Downloads

111

Readme

License: MIT

@bitiumagency/web3-react-modal

@Web3-react's plugin to display modal

NOTE THAT THIS PLUGIN IS COMPATIBLE WITH @WEB3-REACT V6

(we will update this plugin as soon as @web3-react V8 officially released)

Features

  • Display modal with as little code as possible
  • Multi-Chain support
  • Support all @web3-react connectors
  • Keep user connected when the page is refreshed (Metamask)
  • Add the network when user’s provider doesn’t have it

Note : all @web-react features are still the same, such as useWeb3React hook and so on.

When should I use @bitiumagency/web3-react-modal?

If you are using @web3-react v6 in your project and you want to allow the user to select the desired provider without the need for additional code, this package can come in handy.

Usage

Add it to your project: (note that @web-react/core must be pre-installed in your project)

npm i @bitiumagency/web3-react-modal

Add Web3ReactModal component to your react Dapp:

<Web3ReactModal
    useWeb3React={}
    supportedChains={}
    connectors={} //optional
/>

And then call connect function from useWeb3ReactModal hook whenever you want :

const {connect} = useWeb3ReactModal()
function handleButtonClick() {
    connect();
}

Props

useWeb3React
useWeb3React = Import directly from @web3-react and add it to this prop
supportedChains
supportedChains = list of supported chains
interface {
    chainId:  number;
    name?:  string; //These values are used when the network needs to be added
    rpcUrl?:  string;
    nativeCurrency?: {
	    name:  string;
	    decimals:  number;
	    symbol:  string;
    };
}
connectors
connectors = list of connectors
//Metamask is added by default
interface {
title:  String;
id:  String; //id is unique
logo?:  React.ReactNode;
connector:  any; //import directly from connector package and add it to this prop
options:  Object; //connector options
}

if you use these values (walletconnect - authereum - fortmatic - frame - portis - injected - ledger - trezor) for id you don't need to use the logo prop.

Example

To run the examples, switch to the example directory. Then, simply run yarn install to install, and yarn start to run the example on localhost:3000.

Contributing

Contributions are always welcome, no matter how large or small.


this package is a part of Bitium Agency's contribution to the industry!