From 01ec93658f8f2bf0d31b3361cb59d4d4655744d3 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Tue, 28 Apr 2020 17:15:54 +0200 Subject: [PATCH] more docs updates --- README.md | 14 +++++++------- src/components/index.ts | 1 - src/index.ts | 2 +- src/providers/Web3Provider/utils.ts | 6 +++--- 4 files changed, 11 insertions(+), 12 deletions(-) delete mode 100644 src/components/index.ts diff --git a/README.md b/README.md index 856f19c..5f76af8 100644 --- a/README.md +++ b/README.md @@ -22,8 +22,8 @@ - [🏗 Installation](#-installation) - [🏄 Usage](#-usage) - - [Providers](#providers) - - [Hooks](#hooks) + - [1. Providers](#1-providers) + - [2. Hooks](#2-hooks) - [🦑 Development](#-development) - [✨ Code Style](#-code-style) - [👩‍🔬 Testing](#-testing) @@ -44,9 +44,9 @@ npm install @oceanprotocol/react ## 🏄 Usage -First, wrap your whole app with the `Web3Provider` and the `OceanProvider`. +First, wrap your whole app with the [`Web3Provider`](src/providers/Web3Provider) and the [`OceanProvider`](src/providers/OceanProvider). -### Providers +### 1. Providers ```tsx import React, { ReactNode } from 'react' @@ -78,9 +78,9 @@ export default function MyApp({ The `OceanProvider` requires a Web3 instance to be passed as prop so you can replace the basic [`Web3Provider`](src/providers/Web3Provider) with whatever component/library/provider returning a Web3 instance. -### Hooks +### 2. Hooks -Then within your component use the provided hooks to interact with Ocean's functionality. Each hook can be used independently: +Then within your component use the included hooks to interact with Ocean's functionality. Each hook can be used independently: ```tsx import React from 'react' @@ -156,7 +156,7 @@ npm run format The build script will compile `src/` with `tsc` into: 1. CommonJS module with ES5 syntax -2. ES module with ES5 syntax +2. ES module with ES6 syntax ```bash npm run build diff --git a/src/components/index.ts b/src/components/index.ts deleted file mode 100644 index 172f1ae..0000000 --- a/src/components/index.ts +++ /dev/null @@ -1 +0,0 @@ -// noop diff --git a/src/index.ts b/src/index.ts index 932def5..441c499 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,4 +2,4 @@ import './@types/globals' export * from './providers' export * from './hooks' -export * from './components' +// export * from './components' diff --git a/src/providers/Web3Provider/utils.ts b/src/providers/Web3Provider/utils.ts index 0c573e7..c592216 100644 --- a/src/providers/Web3Provider/utils.ts +++ b/src/providers/Web3Provider/utils.ts @@ -3,11 +3,11 @@ import Web3 from 'web3' async function getWeb3(): Promise { let web3: Web3 - // modern dapp browsers + // modern dapp browser if (window.ethereum) { - web3 = new Web3(window.ethereum as any) + web3 = new Web3(window.ethereum) } - // legacy dapp browsers + // legacy dapp browser else if (window.web3) { web3 = new Web3(window.web3.currentProvider) }