Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

Commit

Permalink
Merge pull request #18 from Thoughtscript/feat/dispute
Browse files Browse the repository at this point in the history
Issue #10 - feat:dispute
  • Loading branch information
n1c01a5 authored Mar 20, 2018
2 parents 339e588 + a160a7a commit 3dcbe46
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/containers/contract/contract.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let integration = {
beforeEach(() => {
integration = setupIntegrationTest({ router: { location: '/contract' } })
})

it('Contract test', async () => {
it('New evidence test', async () => {
expect(true)
})
1 change: 1 addition & 0 deletions src/containers/contract/form/new-contract.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ beforeEach(() => {
it('New contract test', async () => {
expect(true)
})

13 changes: 10 additions & 3 deletions src/containers/contract/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ class Contract extends PureComponent {
)
}

showEmptyContractEl = contract => contract.data.status === 4 || contract.data.amount.e === 0

hideEmptyContractEl = contract => {
return {"display":(contract.data.status === 4 || contract.data.amount.e === 0) ? "none" : "block"}
}

render() {
const { loadingContract, contract, accounts, history } = this.props
const { partyOther, party } = this.state
Expand Down Expand Up @@ -132,9 +138,10 @@ class Contract extends PureComponent {
<div className="description Contract-content-item">{contract.data.description}</div>
{contract.data.status !== 4 && !contract.data.partyAFee && !contract.data.partyBFee ?
<div className="Contract-content-actions">
<div className="Contract-content-actions-button Contract-actions-button-left" onClick={this.createDispute}>Create dispute</div>
{contract.data.partyA === accounts.data[0] && <div className="Contract-content-actions-button Contract-content-actions-button-right" onClick={this.createPay}>Pay</div>}
{contract.data.partyB === accounts.data[0] && <div className="Contract-content-actions-button Contract-content-actions-button-right" onClick={this.createReimburse}>Reimburse</div>}
<div style={this.hideEmptyContractEl(contract)} className="Contract-content-actions-button Contract-actions-button-left" onClick={this.createDispute}>Create dispute</div>
{contract.data.partyA === accounts.data[0] && <div style={this.hideEmptyContractEl(contract)} className="Contract-content-actions-button Contract-content-actions-button-right" onClick={this.createPay}>Pay</div>}
{contract.data.partyB === accounts.data[0] && <div style={this.hideEmptyContractEl(contract)} className="Contract-content-actions-button Contract-content-actions-button-right" onClick={this.createReimburse}>Reimburse</div>}
{this.showEmptyContractEl(contract) && <div className="Contract-content-item">No contractual fees remain</div>}
</div>
: <div/>
}
Expand Down
1 change: 1 addition & 0 deletions src/containers/home/home.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ beforeEach(() => {
it('Home test', async () => {
expect(true)
})

0 comments on commit 3dcbe46

Please sign in to comment.