forked from decred/decrediton
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Properly populate recent regular and stake transactions (decred#1174)
- Loading branch information
Showing
10 changed files
with
151 additions
and
57 deletions.
There are no files selected for viewing
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 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 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 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
29 changes: 29 additions & 0 deletions
29
app/components/views/HomePage/TxHistory/TxHistoryRow/StakeTxRow.js
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,29 @@ | ||
import Row from "./Row"; | ||
import { createElement as h } from "react"; | ||
import { FormattedMessage as T } from "react-intl"; | ||
|
||
const messageByType = { // TODO: use constants instead of string | ||
"Ticket": <T id="transaction.type.ticket" m="Ticket" />, | ||
"Revocation": <T id="transaction.type.revoke" m="Revoke" />, | ||
"Vote": <T id="transaction.type.vote" m="Vote" />, | ||
}; | ||
|
||
const StakeTxRow = ({ ...props }) => ( | ||
<Row {...props}> | ||
<div className="transaction-info-overview"> | ||
<span className="icon" /> | ||
<span className="transaction-stake-type">{messageByType[props.className.split(" ")[0]] || "(unknown type)"}</span> | ||
</div> | ||
</Row> | ||
); | ||
|
||
export const StakeTxRowOfType = (className) => { | ||
const Comp = ({ ...p }) => { | ||
if(p.pending) { | ||
className += " Pending"; | ||
} | ||
return h(StakeTxRow, { className, ...p }); | ||
}; | ||
Comp.displayName = `StakeTxRowOfClass: ${className}`; | ||
return Comp; | ||
}; |
17 changes: 10 additions & 7 deletions
17
app/components/views/HomePage/TxHistory/TxHistoryRow/Status.js
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
11 changes: 8 additions & 3 deletions
11
app/components/views/HomePage/TxHistory/TxHistoryRow/index.js
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 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 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
Oops, something went wrong.