From 6053fcdf2afc2b4e9ca06f6ba318607c6c606f35 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Tue, 5 Feb 2019 17:29:01 +0100 Subject: [PATCH] lint fixes --- src/components/atoms/Button.tsx | 1 + src/pages/Details.tsx | 33 +++++++++++++++++---------------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/components/atoms/Button.tsx b/src/components/atoms/Button.tsx index 4565604..44c61f1 100644 --- a/src/components/atoms/Button.tsx +++ b/src/components/atoms/Button.tsx @@ -6,6 +6,7 @@ interface ButtonProps { primary?: boolean link?: boolean href?: string + onClick?: any } export default class Button extends PureComponent { diff --git a/src/pages/Details.tsx b/src/pages/Details.tsx index f02e65f..5725b62 100644 --- a/src/pages/Details.tsx +++ b/src/pages/Details.tsx @@ -1,5 +1,6 @@ import { Logger } from '@oceanprotocol/squid' import React, { Component } from 'react' +import Button from '../components/atoms/Button' import { User } from '../context/User' interface DetailsState { @@ -12,7 +13,7 @@ interface DetailsProps { match: any } -class Details extends Component { +export default class Details extends Component { public state = { ddo: null, metadata: null } public async componentDidMount() { @@ -23,18 +24,6 @@ class Details extends Component { this.setState({ ddo, metadata }) } - public render() { - return ( - <> - {this.state.metadata ? ( - this.showDetails(this.state.ddo) - ) : ( -
Loading
- )} - - ) - } - private purchaseAsset = async (ddo: any) => { const account = await this.context.ocean.getAccounts() const service = ddo.findServiceByType('Access') @@ -65,13 +54,25 @@ class Details extends Component { return ( <>
{JSON.stringify(this.state.metadata)}
- + + + ) + } + + public render() { + return ( + <> + {this.state.metadata ? ( + this.showDetails(this.state.ddo) + ) : ( +
Loading
+ )} ) } } Details.contextType = User -export default Details