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

@aleworm/connection-banner

v1.2.9

Published

Web3 React component built with Rimble UI that will display an informative banner when the user is not in a web3 capable browser, or when the current browser does not have a wallet available, or when the current ethereum network does not match the require

Downloads

8

Readme

Rimble Connection Banner - wrong network Rimble Connection Banner - incompatible browser Rimble Connection Banner - no wallet

On mobile: Rimble Connection Banner - mobile - incompatible browser Rimble Connection Banner - mobile - wrong network

@rimble/connection-banner

React component built with Rimble UI that displays a banner providing information about a user's Ethereum network connection. The banner will give informative and helpful information to resolve the issue with device-specific language. The banner informs the user of the following scenarios:

  • not using a Web3-capable browser
  • a wallet is not available
  • current Ethereum network does not match the specified required network

Installation

Install the package in your project directory with:

// with npm
npm install @rimble/connection-banner

// with yarn
yarn add @rimble/connection-banner

Usage Example

Default messages

import ConnectionBanner from '@rimble/connection-banner';

<ConnectionBanner
  currentNetwork={3}
  requiredNetwork={1}
  onWeb3Fallback={true}
/>;

Custom messages

<ConnectionBanner
  currentNetwork={network.current.id}
  requiredNetwork={this.config.requiredNetwork}
  onWeb3Fallback={web3Fallback}

  {{
    notWeb3CapableBrowserMessage: (
      <div>
        <p>Not a web3 capable browser</p>
      </div>
    ),
    noNetworkAvailableMessage: (
      <div>
        <p>No Ethereum network available</p>
      </div>
    ),
    onWrongNetworkMessage: (
      <div>
        <p>On wrong Ethereum network</p>
      </div>
    ),
  }}
</ConnectionBanner>

Props

| Name | Type | Default | Description | | ------------------------------ | ------- | -------------------- | ------------------------------------------------------------------------------ | | currentNetwork | integer | none | The network ID that the user is connected to, if available | | requiredNetwork | integer | none | The network ID that the dApp requires to function | | onWeb3Fallback | boolean | false | Set to true when you connect to a smart contract via a provider like infura | | notWeb3CapableBrowserMessage | node | see default messages | Markup that will be rendered when the notWeb3CapableBrowser condition is met | | noNetworkAvailableMessage | node | see default messages | Markup that will be rendered when the noNetworkAvailable condition is met | | onWrongNetworkMessage | node | see default messages | Markup that will be rendered when the onWrongNetwork condition is met |

Default Messages

notWeb3CapableBrowserMessage - Desktop

Your browser doesn't support our blockchain features

Switch to either Brave, FireFox, Opera, or Chrome to continue

notWeb3CapableBrowserMessage - Mobile

Your browser doesn't support our blockchain features

Try a mobile wallet browser like Status, Coinbase wallet or Cipher

noNetworkAvailableMessage - Desktop only

Install the MetaMask browser extension to use our blockchain features in your current browser

installMetaMaskButton

onWrongNetworkMessage - Desktop

Switch to the requiredNetworkName Ethereum network in MetaMask

Change your network in your MetaMask extension. You're currently on currentNetworkName

onWrongNetworkMessage - Mobile

Switch to the requiredNetworkName Ethereum network in Settings

Change your network in your MetaMask extension. You're currently on currentNetworkName

Documentation

Documentation

Issues

Open an issue for any bugs or feature requests

Contributing

We are open source and welcome your contributions !

License

MIT © ConsenSys