Display timestamp in Signer requests details #2324
Conversation
It looks like this contributor signed our Contributor License Agreement. 👍 Many thanks, Ethcore CLA Bot |
|
||
import ReactTooltip from 'react-tooltip'; | ||
import DescriptionIcon from 'material-ui/svg-icons/action/description'; | ||
import GasIcon from 'material-ui/svg-icons/maps/local-gas-station'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😝
<div className={ styles.expandedContainer }> | ||
{ this.renderDataExpanded() } | ||
</div> | ||
<TransactionSecondaryDetails |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it really worth creating an etirely new component? I don't have strong opinions on this, but it feels bloated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As it stands, for the Signer is is probably the best approach. Everything is very, very, very modular and re-used among the different Pending/Completed layouts. Best way of fitting in with the style that is there.
|
||
.dataTooltip { | ||
word-wrap: break-word; | ||
max-width: 400px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using font-size-based units like em
, ex
, … for layout-related things will help increate modularity & accessibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. However, this Signer is a nightmare as the layouts are, we need a separate issue for re-working the layouts. As-is this is the best approach to take here unless you want to break everything in the signer display.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair enough
@@ -108,3 +108,8 @@ function setIsSending (pending, id, isSending) { | |||
return p; | |||
}).slice(); | |||
} | |||
|
|||
function addTimestamp (request) { | |||
request.date = new Date(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This modifies the request
object and can therefore later have unintended side effects. I'd propose (r) => {request: r, timestamp: new Date()}
. If you don't need the request, (r) => new Date()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The thing is that this new format would imply many changes for Components using theses requests. Maybe add this timestamp
field at a lower level, like request.payload.timestamp
?
@ngotchac Can I add and issue to fix here while you are digging around - it would seem like the Signer stuff doesn't pop up in most-recent first on-top. It should be a simple fix, not sure why it goes awry on my side, I was sure it actually had the most recent on-top. |
Display the request creation date in the Signer Requests details (#2283)