mirror of
https://github.com/oceanprotocol/docs.git
synced 2024-11-02 00:05:35 +01:00
add final screenshot, code style fixes
This commit is contained in:
parent
f07ded1e1f
commit
c73f9bce0f
BIN
content/tutorials/images/react-app-05.png
Normal file
BIN
content/tutorials/images/react-app-05.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 172 KiB |
@ -5,7 +5,7 @@ description: Tutorial to get and use a data set in a basic React app.
|
||||
|
||||
## Requirements
|
||||
|
||||
This is a continuation of the [React App Setup](/tutorials/react-setup) and [React Publish Data-set](/tutorials/react-publish-data-set) tutorial, so make sure you have done all the steps described in there.
|
||||
This is a continuation of the [React App Setup](/tutorials/react-setup/) and [React Publish Data-set](/tutorials/react-publish-data-set/) tutorial, so make sure you have done all the steps described in there.
|
||||
|
||||
Open `src/App.js` in your marketplace app from previous tutorials.
|
||||
|
||||
@ -61,6 +61,10 @@ We still need button in render function just after `<button onClick={()=>this.re
|
||||
<button onClick={() => this.consumeAsset()}>Consume asset</button>
|
||||
```
|
||||
|
||||
With all these buttons in place, you should see this:
|
||||
|
||||
![React App 05](images/react-app-05.png)
|
||||
|
||||
## Final Result
|
||||
|
||||
That's it. If you have no errors in your `console.log` and your asset files listed you have working marketplace.
|
||||
@ -134,7 +138,7 @@ class App extends Component {
|
||||
}
|
||||
|
||||
async retrieveAssets() {
|
||||
this.dbAssets = await this.ocean.searchAssetsByText("Office Humidity")
|
||||
this.dbAssets = await this.ocean.searchAssetsByText('Office Humidity')
|
||||
console.log(this.dbAssets)
|
||||
}
|
||||
|
||||
@ -149,7 +153,8 @@ class App extends Component {
|
||||
const serviceAgreementSignatureResult = await this.ocean.signServiceAgreement(
|
||||
consumeAsset.id,
|
||||
service.serviceDefinitionId,
|
||||
accounts[0])
|
||||
accounts[0]
|
||||
)
|
||||
// run it
|
||||
await this.ocean.initializeServiceAgreement(
|
||||
consumeAsset.id,
|
||||
@ -157,8 +162,11 @@ class App extends Component {
|
||||
serviceAgreementSignatureResult.serviceAgreementId,
|
||||
serviceAgreementSignatureResult.serviceAgreementSignature,
|
||||
// callback to handle the files we get
|
||||
(files) => { console.log('Asset files', files) },
|
||||
accounts[0])
|
||||
files => {
|
||||
console.log('Asset files', files)
|
||||
},
|
||||
accounts[0]
|
||||
)
|
||||
}
|
||||
|
||||
render() {
|
||||
|
@ -5,9 +5,9 @@ description: Tutorial to add dataset publishing capabilities to a basic React ap
|
||||
|
||||
## Requirements
|
||||
|
||||
This is a continuation of the [React App Setup](/tutorials/react-setup) tutorial, so make sure you have done all the steps described in there.
|
||||
This is a continuation of the [React App Setup](/tutorials/react-setup/) tutorial, so make sure you have done all the steps described in there.
|
||||
|
||||
Open `src/App.js` in your marketplace app from the [React App Setup](/tutorials/react-setup) tutorial.
|
||||
Open `src/App.js` in your marketplace app from the [React App Setup](/tutorials/react-setup/) tutorial.
|
||||
|
||||
## Define Asset
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user