1
0
mirror of https://github.com/oceanprotocol/react.git synced 2024-06-17 01:43:16 +02:00

fix handlers

This commit is contained in:
alexcos20 2020-10-16 03:32:10 -07:00
parent 1b5c5caad9
commit d2e5a8114d
2 changed files with 6 additions and 6 deletions

View File

@ -47,7 +47,7 @@ export function Publish() {
setDdo(ddo)
}
const PostForSale = async () => {
const handlePostForSale = async () => {
if(ddo){
const priceOptions = {
price: 7,
@ -74,7 +74,7 @@ export function Publish() {
</div>
<div>DID: {ddo && ddo.id} </div>
<div>
<button onClick={PostForSale}>Post for sale</button>
<button onClick={handlePostForSale}>Post for sale</button>
</div>
<div>
IsLoading: {pricingIsLoading.toString()} || pricingStatus: {pricingStepText}

View File

@ -9,7 +9,7 @@ export function Trade() {
const { ocean, accountId } = useOcean()
const { createPricing, buyDT, sellDT, pricingStep, pricingStepText, isLoading: pricingIsLoading, pricingError} = usePricing()
const [did, setDid] = useState<string | undefined>()
const ActionBuy = async () => {
const handleBuy = async () => {
if (!did) { console.error("No DID"); return}
const ddo = await ocean.assets.resolve(did)
if(ddo){
@ -20,7 +20,7 @@ export function Trade() {
console.error("Publish the asset first and create a pricing")
}
}
const ActionSell = async () => {
const handleSell = async () => {
if (!did) { console.error("No DID"); return}
const ddo = await ocean.assets.resolve(did)
if(ddo){
@ -41,10 +41,10 @@ export function Trade() {
DID <input onChange={handleChange}></input>
</div>
<div>
<button onClick={ActionBuy}>Buy 1 DT</button>
<button onClick={handleBuy}>Buy 1 DT</button>
</div>
<div>
<button onClick={ActionSell}>Sell 1 DT</button>
<button onClick={handleSell}>Sell 1 DT</button>
</div>
<div>
IsLoading: {pricingIsLoading.toString()} || Status: {pricingStepText}