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

@rimble/network-indicator

v1.2.3

Published

Web3 React component built with Rimble UI that will display the current ethereum network name based on a given network ID.

Downloads

34

Readme

Rimble Network Indicator - current network

Rimble Network Indicator - wrong network

Rimble Network Indicator - no network

@rimble/network-indicator

React component built with Rimble UI that will display the current Ethereum network name based on a given network ID and optionally display and icon and tooltip indicating whether the user is on the correct network for the application.

Installation

Install the package in your project directory with:

// with npm
npm install @rimble/network-indicator

// with yarn
yarn add @rimble/network-indicator

Usage Example

import NetworkIndicator from '@rimble/network-indicator';

// Default
<NetworkIndicator currentNetwork={3} />;

// Has requiredNetwork prop
<NetworkIndicator currentNetwork={3} requiredNetwork={1} />;

// Custom tooltips for default
<NetworkIndicator currentNetwork={1}>
  {{
    onNetworkMessage: 'Connected to correct network',
    noNetworkMessage: 'Not connected to anything'
  }}
</NetworkIndicator>

// Custom tooltips with requiredNetwork prop
<NetworkIndicator currentNetwork={null} requiredNetwork={1}>
  {{
    onNetworkMessage: 'Connected to correct network',
    noNetworkMessage: 'Not connected to anything',
    onWrongNetworkMessage: 'Wrong network',
  }}
</NetworkIndicator>

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 | | onNetworkMessage | string | none | Content of a hover tooltip when there is a currentNetwork prop and when requiredNetwork exists and matches currentNetwork prop | | noNetworkMessage | string | see default messages | Content of a hover tooltip when there is a null value for currentNetwork prop even when there is a requiredNetwork prop | | onWrongNetworkMessage | string | see default messages | Content of a hover tooltip when values do not match for currentNetwork and requiredNetwork props |

Default Messages

onNetworkMessage

Only when requiredNetwork exists and matches currentNetwork prop

You're on the right network

noNetworkMessage

You're not on an Ethereum network

onWrongNetworkMessage

You're on the wrong network

Issues

Open an issue for any bugs or feature requests

Contributing

We are open source and welcome your contributions !

License

MIT © ConsenSys