-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#29 Reorganize market open orders code:
- add "empty" checks - clean CSS
- Loading branch information
Showing
8 changed files
with
110 additions
and
89 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React from 'react'; | ||
|
||
import OpenOrdersSummary from '../../open-orders/components/open-orders-summary'; | ||
import OpenOrdersGroup from '../../open-orders/components/open-orders-group'; | ||
|
||
const OpenOrders = (p) => ( | ||
<div className="market-open-orders"> | ||
<OpenOrdersSummary | ||
userOpenOrdersSummary={p.userOpenOrdersSummary} | ||
/> | ||
|
||
<div className="open-orders-list"> | ||
{ | ||
p.outcomes.map(outcome => ( | ||
<OpenOrdersGroup | ||
key={outcome.id} | ||
id={outcome.id} | ||
name={outcome.name} | ||
userOpenOrders={outcome.userOpenOrders} | ||
cancelOrder={p.cancelOrder} | ||
/> | ||
)) | ||
} | ||
</div> | ||
</div> | ||
); | ||
|
||
OpenOrders.propTypes = { | ||
userOpenOrdersSummary: React.PropTypes.object, | ||
outcomes: React.PropTypes.array, | ||
cancelOrder: React.PropTypes.func.isRequired | ||
}; | ||
|
||
export default OpenOrders; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/modules/open-orders/components/open-orders-summary.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Author: priecint | ||
*/ | ||
|
||
import React from 'react'; | ||
|
||
const OpenOrdersSummary = (p) => { | ||
const hasOpenOrders = p.userOpenOrdersSummary != null && p.userOpenOrdersSummary.openOrdersCount > 0; | ||
return ( | ||
<div className="market-section-header"> | ||
{ | ||
hasOpenOrders ? `${p.userOpenOrdersSummary.openOrdersCount} Open Orders` : 'No Open Orders' | ||
} | ||
</div> | ||
); | ||
}; | ||
|
||
OpenOrdersSummary.propTypes = { | ||
userOpenOrdersSummary: React.PropTypes.object | ||
}; | ||
|
||
export default OpenOrdersSummary; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters