diff --git a/src/components/atoms/Button.module.scss b/src/components/atoms/Button.module.scss index 8805c03..4a98a2c 100644 --- a/src/components/atoms/Button.module.scss +++ b/src/components/atoms/Button.module.scss @@ -37,10 +37,9 @@ } &:disabled { - color: rgba($brand-white, .7); cursor: not-allowed; pointer-events: none; - opacity: .8; + opacity: .5; } } diff --git a/src/components/atoms/Button.tsx b/src/components/atoms/Button.tsx index 312565b..473db50 100644 --- a/src/components/atoms/Button.tsx +++ b/src/components/atoms/Button.tsx @@ -9,6 +9,7 @@ interface ButtonProps { link?: boolean href?: string onClick?: any + disabled?: boolean } export default class Button extends PureComponent { diff --git a/src/routes/Publish/Step.tsx b/src/routes/Publish/Step.tsx index 90fc1fa..c54f0e6 100644 --- a/src/routes/Publish/Step.tsx +++ b/src/routes/Publish/Step.tsx @@ -26,7 +26,17 @@ interface StepProps { content?: string } -export default class Step extends PureComponent { +interface StepState { + inputInvalid: boolean +} + +export default class Step extends PureComponent { + public state = { + // TODO: manipulate with some form validation for every step, + // should be 'true' by default here + inputInvalid: false + } + public previousButton() { let { currentStep, prev } = this.props @@ -42,9 +52,14 @@ export default class Step extends PureComponent { public nextButton() { let { currentStep, next, totalSteps } = this.props + const { inputInvalid } = this.state if (currentStep < totalSteps) { - return + return ( + + ) } return null } diff --git a/src/routes/Publish/index.tsx b/src/routes/Publish/index.tsx index efcf0fa..4982ce5 100644 --- a/src/routes/Publish/index.tsx +++ b/src/routes/Publish/index.tsx @@ -108,7 +108,8 @@ class Publish extends Component<{}, PublishState> { publishingError: '', isPublishing: true }) - const account = await this.context.ocean.getAccounts() + const { ocean } = this.context + const account = await ocean.getAccounts() const newAsset = { // OEP-08 Attributes // https://github.com/oceanprotocol/OEPs/tree/master/8 @@ -138,10 +139,7 @@ class Publish extends Component<{}, PublishState> { } try { - const asset = await this.context.ocean.registerAsset( - newAsset, - account[0] - ) + const asset = await ocean.registerAsset(newAsset, account[0]) this.setState({ publishedDid: asset.id, isPublished: true