Skip to content
This repository was archived by the owner on May 19, 2023. It is now read-only.

Commit 0c2c3a7

Browse files
committed
chore: updated docs with badges, usage, and Acknowledgments
1 parent f1a39a1 commit 0c2c3a7

File tree

1 file changed

+47
-10
lines changed

1 file changed

+47
-10
lines changed

README.md

Lines changed: 47 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1-
# @rsksmart/rif-ui
1+
<p align="center">
2+
<a href="https://rifos.org/" rel="noopener" target="_blank"><img width="150" src="https://www.rifos.org/assets/img/logo.svg" alt="RIF logo"></a></p>
3+
</p>
4+
5+
<h1 align="center">RIF-UI</h1>
26

37
> This is a [React](https://reactjs.org/) library written in [Typescript](https://www.typescriptlang.org/) and based on [Material-UI](https://material-ui.com/). It exposes common components, services and assets to be re used in RIF projects.
48
5-
<p>
6-
<a href="https://github.com/rsksmart/rsk-contract-verifier/blob/master/LICENSE">
7-
<img alt="GitHub license" src="https://img.shields.io/badge/license-MIT-blue.svg" />
8-
</a>
9-
<a href="https://www.npmjs.com/package/@rsksmart/rif-ui">
10-
<img alt="npmjs reference" src="https://img.shields.io/npm/v/@rsksmart/rif-ui.svg" />
11-
</a>
12-
</p>
9+
[![license MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/rsksmart/rsk-contract-verifier/blob/master/LICENSE)
10+
[![npm package](https://img.shields.io/npm/v/@rsksmart/rif-ui/latest.svg)](https://www.npmjs.com/package/@rsksmart/rif-ui)
11+
[![CircleCI](https://img.shields.io/circleci/project/github/rsksmart/rif-ui/master.svg)](https://circleci.com/gh/rsksmart/rif-ui/tree/master)
12+
[![](https://img.shields.io/badge/made%20by-IOVLabs-blue.svg?style=flat-rounded)](http://iovlabs.org)
13+
[![Managed by tAsEgir](https://img.shields.io/badge/%20managed%20by-tasegir-brightgreen?style=flat-rounded)](https://github.com/auhau/tasegir)
14+
![](https://img.shields.io/badge/npm-%3E%3D6.0.0-orange.svg?style=flat-rounded)
15+
![](https://img.shields.io/badge/Node.js-%3E%3D10.0.0-orange.svg?style=flat-rounded)
16+
[![Follow on Twitter](https://img.shields.io/twitter/follow/rif_os.svg?label=follow+RIF)](https://twitter.com/rif_os)
17+
[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=rsksmart/rif-ui)](https://dependabot.com)
1318

1419
**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.**
1520

@@ -56,7 +61,7 @@ import { BrowserRouter } from 'react-router-dom'
5661
const App = () => (
5762
<ThemeProvider theme={theme}>
5863
<BrowserRouter>
59-
<Header/>
64+
<Header />
6065
<PageTemplate>
6166
<Typography color='primary'>Hello world :)</Typography>
6267
</PageTemplate>
@@ -65,6 +70,23 @@ const App = () => (
6570
)
6671
```
6772

73+
### Web3Provider
74+
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.
75+
As an example
76+
77+
```
78+
<Web3Provider.Provider
79+
requiredNetworkId={requiredNetworkId}
80+
actions={{
81+
onConnectedAccountChange: onConnectedAccountChange,
82+
onConnectedNetworkChange: onConnectedNetworkChange
83+
}}>
84+
85+
{/* Your stuff here */}
86+
87+
</Web3Provider.Provider >
88+
```
89+
6890
## Example folder
6991

7092
If you want to try this library without creating a new project you can clone this repo and follow the next steps:
@@ -83,6 +105,21 @@ cd example/ && npm start
83105

84106
3. (Optional) Import the components, assets or services that you want in the `example/src/App.js` file following the [Usage](#usage) section to see them in action.
85107

108+
## Testing
109+
110+
To run unit test and build the library, you can use
111+
```
112+
npm run test
113+
```
114+
115+
If you only want to run the unit test, you can use
116+
```
117+
npm run test:unit
118+
```
119+
86120
## License
87121

88122
MIT © [rsksmart](https://github.com/rsksmart)
123+
124+
## Acknowledgments
125+
- Thanks to [EVM Networks](https://github.com/ethereum-lists/chains) for providing the data source of network objects as a JSON, which inspired us to create the `NetworkInfo` interface

0 commit comments

Comments
 (0)