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

@rsksmart/rif-ui

v0.6.1

Published

Exposes common components to be re used in RIF projects

Downloads

85

Readme

This is a React library written in Typescript and based on Material-UI. It exposes common components, services and assets to be re used in RIF projects.

license MIT npm package CircleCI Managed by tAsEgir Follow on Twitter Dependabot Status

Warning: This project is in alpha state. There might (and most probably will) be changes in the future to its working. Also, no guarantees can be made about its stability, efficiency, and security at this stage.


Lead Maintainer

Alvaro Fariña

See what "Lead Maintainer" means here.

Installation

npm i @rsksmart/rif-ui

Getting Started

Basic Usage

In order to experience all the benefits of this library, we recommend to wrap your application with the ThemeProvider component from Material-UI and pass in our Material-UI theme.

import React, { FC } from 'react'
import { ThemeProvider } from '@material-ui/core/styles'
import { theme, Typography } from '@rsksmart/rif-ui'
import '@rsksmart/rif-ui/dist/index.css'

const App = () => {
  return (
    <ThemeProvider theme={theme}>
      <Typography color='primary'>Hello world :)</Typography>
    </ThemeProvider>
  )
}

export default App

Using Header and PageTemplate components

The Header and PageTemplate components were styled and designed to work together. So, whenever you need one of them, we suggest to follow the next example

import { Header, PageTemplate, theme, Typography } from '@rsksmart/rif-ui'
import { ThemeProvider } from '@material-ui/core/styles'
import { BrowserRouter } from 'react-router-dom'

const App = () => (
  <ThemeProvider theme={theme}>
    <BrowserRouter>
      <Header />
      <PageTemplate>
        <Typography color='primary'>Hello world :)</Typography>
      </PageTemplate>
    </BrowserRouter>
  </ThemeProvider>
)

Web3Provider

On the Web3Provider you can set the property requiredNetworkId and the actions onConnectedAccountChange, onConnectedNetworkChange that will get triggered once the user wallet is connected and there is a change on the account or network. As an example

<Web3Provider.Provider 
  requiredNetworkId={requiredNetworkId}
  actions={{
    onConnectedAccountChange: onConnectedAccountChange,
    onConnectedNetworkChange: onConnectedNetworkChange
  }}>

  {/* Your stuff here */}
  
</Web3Provider.Provider >

Development - Example folder

A sandbox project is provided in order to test the library or try new features locally without having to release a new version. It lives at the example folder. In order to run it, follow the next steps:

  1. At rif-ui:
npm i
npm start
  1. Wait until it compiles to the dist folder. Then, in another terminal:
cd example/ && npm start
  1. (Optional) Import the components, assets or services that you want in the example/src/App.js file following the Usage section to see them in action.

Testing

To run unit test and build the library, you can use

npm run test

If you only want to run the unit test, you can use

npm run test:unit

License

MIT © rsksmart

Acknowledgments

  • This library was created with create-react-library. A great project to start you own library.
  • Thanks to EVM Networks for providing the data source of network objects as a JSON, which inspired us to create the NetworkInfo interface