diff --git a/client/src/components/templates/Asset/AssetFile.tsx b/client/src/components/templates/Asset/AssetFile.tsx index 778453f..fbdafb2 100644 --- a/client/src/components/templates/Asset/AssetFile.tsx +++ b/client/src/components/templates/Asset/AssetFile.tsx @@ -3,13 +3,13 @@ import { Logger, DDO, File } from '@oceanprotocol/squid' import filesize from 'filesize' import Button from '../../atoms/Button' import Spinner from '../../atoms/Spinner' -import { User } from '../../../context' +import { User, Market } from '../../../context' import styles from './AssetFile.module.scss' import ReactGA from 'react-ga' import cleanupContentType from '../../../utils/cleanupContentType' -export const messages = { - start: 'Decrypting file URL...', +export const messages: any = { + 99: 'Decrypting file URL...', 0: '1/3
Asking for agreement signature...', 1: '1/3
Agreement initialized.', 2: '2/3
Asking for two payment confirmations...', @@ -25,24 +25,26 @@ interface AssetFileProps { interface AssetFileState { isLoading: boolean error: string - step: number | string | null + step: number } export default class AssetFile extends PureComponent< AssetFileProps, AssetFileState > { + public static contextType = User + public state = { isLoading: false, error: '', - step: null + step: 99 } private resetState = () => this.setState({ isLoading: true, error: '', - step: null + step: 99 }) private purchaseAsset = async (ddo: DDO, index: number) => { @@ -134,22 +136,24 @@ export default class AssetFile extends PureComponent< {isLoading ? ( - + ) : ( - + + {market => ( + + )} + )} {error !== '' &&
{error}
} @@ -157,5 +161,3 @@ export default class AssetFile extends PureComponent< ) } } - -AssetFile.contextType = User diff --git a/client/src/routes/Publish/Step.tsx b/client/src/routes/Publish/Step.tsx index 9dae46a..6df542e 100644 --- a/client/src/routes/Publish/Step.tsx +++ b/client/src/routes/Publish/Step.tsx @@ -3,7 +3,7 @@ import Input from '../../components/atoms/Form/Input' import Label from '../../components/atoms/Form/Label' import Row from '../../components/atoms/Form/Row' import Button from '../../components/atoms/Button' -import { User } from '../../context' +import { User, Market } from '../../context' import Files from './Files/' import StepRegisterContent from './StepRegisterContent' import styles from './Step.module.scss' @@ -43,6 +43,8 @@ interface StepProps { } export default class Step extends PureComponent { + public static contextType = User + public previousButton() { const { currentStep, prev } = this.props @@ -152,23 +154,26 @@ export default class Step extends PureComponent { {this.nextButton()} {lastStep && ( - + + {market => ( + + )} + )}
- + {!lastStep && }
) } } - -Step.contextType = User