|
|
@ -10,6 +10,7 @@ const addressSummary = require('../util').addressSummary |
|
|
|
|
|
|
|
|
|
|
|
const CopyButton = require('./copyButton') |
|
|
|
const CopyButton = require('./copyButton') |
|
|
|
const EtherBalance = require('./eth-balance') |
|
|
|
const EtherBalance = require('./eth-balance') |
|
|
|
|
|
|
|
const Tooltip = require('./tooltip') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = connect(mapStateToProps)(ShiftListItem) |
|
|
|
module.exports = connect(mapStateToProps)(ShiftListItem) |
|
|
@ -19,15 +20,15 @@ function mapStateToProps (state) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
inherits(ShiftListItem, Component) |
|
|
|
inherits(ShiftListItem, Component) |
|
|
|
|
|
|
|
|
|
|
|
function ShiftListItem () { |
|
|
|
function ShiftListItem () { |
|
|
|
Component.call(this) |
|
|
|
Component.call(this) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ShiftListItem.prototype.render = function () { |
|
|
|
ShiftListItem.prototype.render = function () { |
|
|
|
const props = this.props |
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
h(`.transaction-list-item.flex-row`, { |
|
|
|
h('.transaction-list-item.flex-row', { |
|
|
|
style:{ |
|
|
|
style: { |
|
|
|
paddingTop: '20px', |
|
|
|
paddingTop: '20px', |
|
|
|
paddingBottom: '20px', |
|
|
|
paddingBottom: '20px', |
|
|
|
justifyContent: 'space-around', |
|
|
|
justifyContent: 'space-around', |
|
|
@ -36,13 +37,13 @@ ShiftListItem.prototype.render = function () { |
|
|
|
}, [ |
|
|
|
}, [ |
|
|
|
h('div', { |
|
|
|
h('div', { |
|
|
|
style: { |
|
|
|
style: { |
|
|
|
width:'0px', |
|
|
|
width: '0px', |
|
|
|
position: 'relative', |
|
|
|
position: 'relative', |
|
|
|
bottom: '19px', |
|
|
|
bottom: '19px', |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, [ |
|
|
|
}, [ |
|
|
|
h('img', { |
|
|
|
h('img', { |
|
|
|
src:'https://info.shapeshift.io/sites/default/files/logo.png', |
|
|
|
src: 'https://info.shapeshift.io/sites/default/files/logo.png', |
|
|
|
style: { |
|
|
|
style: { |
|
|
|
height: '35px', |
|
|
|
height: '35px', |
|
|
|
width: '132px', |
|
|
|
width: '132px', |
|
|
@ -68,30 +69,53 @@ ShiftListItem.prototype.renderUtilComponents = function () { |
|
|
|
switch (props.response.status) { |
|
|
|
switch (props.response.status) { |
|
|
|
case 'no_deposits': |
|
|
|
case 'no_deposits': |
|
|
|
return h('.flex-row', [ |
|
|
|
return h('.flex-row', [ |
|
|
|
h(CopyButton, { value: this.props.depositAddress }), |
|
|
|
h(CopyButton, { |
|
|
|
h('i.fa.fa-qrcode.pointer', { |
|
|
|
value: this.props.depositAddress, |
|
|
|
onClick: () => props.dispatch(actions.reshowQrCode(props.depositAddress, props.depositType)), |
|
|
|
|
|
|
|
style: { |
|
|
|
|
|
|
|
margin: '5px', |
|
|
|
|
|
|
|
marginLeft: '23px', |
|
|
|
|
|
|
|
marginRight: '12px', |
|
|
|
|
|
|
|
fontSize: '20px', |
|
|
|
|
|
|
|
color: '#F7861C', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}), |
|
|
|
}), |
|
|
|
|
|
|
|
h(Tooltip, { |
|
|
|
|
|
|
|
title: 'QR Code', |
|
|
|
|
|
|
|
}, [ |
|
|
|
|
|
|
|
h('i.fa.fa-qrcode.pointer.pop-hover', { |
|
|
|
|
|
|
|
onClick: () => props.dispatch(actions.reshowQrCode(props.depositAddress, props.depositType)), |
|
|
|
|
|
|
|
style: { |
|
|
|
|
|
|
|
margin: '5px', |
|
|
|
|
|
|
|
marginLeft: '23px', |
|
|
|
|
|
|
|
marginRight: '12px', |
|
|
|
|
|
|
|
fontSize: '20px', |
|
|
|
|
|
|
|
color: '#F7861C', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}), |
|
|
|
|
|
|
|
]), |
|
|
|
]) |
|
|
|
]) |
|
|
|
case 'received': |
|
|
|
case 'received': |
|
|
|
return h('.flex-row') |
|
|
|
return h('.flex-row') |
|
|
|
|
|
|
|
|
|
|
|
case 'complete': |
|
|
|
case 'complete': |
|
|
|
return h('.flex-row', [ |
|
|
|
return h('.flex-row', [ |
|
|
|
h(CopyButton, { value: this.props.response.transaction }), |
|
|
|
h(CopyButton, { |
|
|
|
h(EtherBalance, { |
|
|
|
value: this.props.response.transaction, |
|
|
|
value: `+${props.response.outgoingCoin}`, |
|
|
|
}), |
|
|
|
width: '55px', |
|
|
|
h('.flex-row', { |
|
|
|
shorten: true, |
|
|
|
style: { |
|
|
|
style: {fontSize: '15px'}, |
|
|
|
alignItems: 'baseline', |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
}, [ |
|
|
|
|
|
|
|
h('.color-orange', { |
|
|
|
|
|
|
|
style: { |
|
|
|
|
|
|
|
fontFamily: 'Montserrat Light', |
|
|
|
|
|
|
|
position: 'relative', |
|
|
|
|
|
|
|
left: '6px', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, '+'), |
|
|
|
|
|
|
|
h(EtherBalance, { |
|
|
|
|
|
|
|
value: `${props.response.outgoingCoin}`, |
|
|
|
|
|
|
|
width: '55px', |
|
|
|
|
|
|
|
shorten: true, |
|
|
|
|
|
|
|
style: { |
|
|
|
|
|
|
|
fontSize: '15px', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}), |
|
|
|
|
|
|
|
]), |
|
|
|
]) |
|
|
|
]) |
|
|
|
|
|
|
|
|
|
|
|
case 'failed': |
|
|
|
case 'failed': |
|
|
@ -106,17 +130,20 @@ ShiftListItem.prototype.renderInfo = function () { |
|
|
|
var props = this.props |
|
|
|
var props = this.props |
|
|
|
switch (props.response.status) { |
|
|
|
switch (props.response.status) { |
|
|
|
case 'no_deposits': |
|
|
|
case 'no_deposits': |
|
|
|
return h('.flex-column', {style: {width: '200px', overflow: 'hidden'}}, [ |
|
|
|
return h('.flex-column', { |
|
|
|
|
|
|
|
style: { |
|
|
|
|
|
|
|
width: '200px', |
|
|
|
|
|
|
|
overflow: 'hidden', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, [ |
|
|
|
h('div', { |
|
|
|
h('div', { |
|
|
|
style: { |
|
|
|
style: { |
|
|
|
fontSize: 'x-small', |
|
|
|
fontSize: 'x-small', |
|
|
|
color: '#ABA9AA', |
|
|
|
color: '#ABA9AA', |
|
|
|
width: '100%', |
|
|
|
width: '100%', |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, [ |
|
|
|
}, `${props.depositType} to ETH via ShapeShift`), |
|
|
|
`${props.depositType} to ETH via ShapeShift` |
|
|
|
h('div', 'No deposits received'), |
|
|
|
]), |
|
|
|
|
|
|
|
h('div', `Status: ${props.response.status.replace('_', ' ')}`), |
|
|
|
|
|
|
|
h('div', { |
|
|
|
h('div', { |
|
|
|
style: { |
|
|
|
style: { |
|
|
|
fontSize: 'x-small', |
|
|
|
fontSize: 'x-small', |
|
|
@ -126,17 +153,20 @@ ShiftListItem.prototype.renderInfo = function () { |
|
|
|
}, formatDate(props.time)), |
|
|
|
}, formatDate(props.time)), |
|
|
|
]) |
|
|
|
]) |
|
|
|
case 'received': |
|
|
|
case 'received': |
|
|
|
return h('.flex-column', {style: {width: '200px', overflow: 'hidden'}}, [ |
|
|
|
return h('.flex-column', { |
|
|
|
|
|
|
|
style: { |
|
|
|
|
|
|
|
width: '200px', |
|
|
|
|
|
|
|
overflow: 'hidden', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, [ |
|
|
|
h('div', { |
|
|
|
h('div', { |
|
|
|
style: { |
|
|
|
style: { |
|
|
|
fontSize: 'x-small', |
|
|
|
fontSize: 'x-small', |
|
|
|
color: '#ABA9AA', |
|
|
|
color: '#ABA9AA', |
|
|
|
width: '100%', |
|
|
|
width: '100%', |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, [ |
|
|
|
}, `${props.depositType} to ETH via ShapeShift`), |
|
|
|
`${props.depositType} to ETH via ShapeShift` |
|
|
|
h('div', 'Conversion in progress'), |
|
|
|
]), |
|
|
|
|
|
|
|
h('div', `Conversion in progress`), |
|
|
|
|
|
|
|
h('div', { |
|
|
|
h('div', { |
|
|
|
style: { |
|
|
|
style: { |
|
|
|
fontSize: 'x-small', |
|
|
|
fontSize: 'x-small', |
|
|
@ -146,20 +176,25 @@ ShiftListItem.prototype.renderInfo = function () { |
|
|
|
}, formatDate(props.time)), |
|
|
|
}, formatDate(props.time)), |
|
|
|
]) |
|
|
|
]) |
|
|
|
case 'complete': |
|
|
|
case 'complete': |
|
|
|
var url = explorerLink(props.response.transaction, parseInt('1')) |
|
|
|
var url = explorerLink(props.response.transaction, parseInt('1')) |
|
|
|
|
|
|
|
|
|
|
|
return h('.flex-column.pointer', { |
|
|
|
return h('.flex-column.pointer', { |
|
|
|
style: {width: '200px', overflow: 'hidden'}, |
|
|
|
style: { |
|
|
|
onClick: () => extension.tabs.create({ url }) |
|
|
|
width: '200px', |
|
|
|
|
|
|
|
overflow: 'hidden', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
onClick: () => extension.tabs.create({ |
|
|
|
|
|
|
|
url, |
|
|
|
|
|
|
|
}), |
|
|
|
}, [ |
|
|
|
}, [ |
|
|
|
h('div', { |
|
|
|
h('div', { |
|
|
|
style: { |
|
|
|
style: { |
|
|
|
fontSize: 'x-small', |
|
|
|
fontSize: 'x-small', |
|
|
|
color: '#ABA9AA', |
|
|
|
color: '#ABA9AA', |
|
|
|
width: '100%', |
|
|
|
width: '100%', |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, `ShapeShift`), |
|
|
|
}, 'From ShapeShift'), |
|
|
|
h('div', props.completeTime), |
|
|
|
h('div', formatDate(props.time)), |
|
|
|
h('div', { |
|
|
|
h('div', { |
|
|
|
style: { |
|
|
|
style: { |
|
|
|
fontSize: 'x-small', |
|
|
|
fontSize: 'x-small', |
|
|
@ -170,7 +205,7 @@ ShiftListItem.prototype.renderInfo = function () { |
|
|
|
]) |
|
|
|
]) |
|
|
|
|
|
|
|
|
|
|
|
case 'failed': |
|
|
|
case 'failed': |
|
|
|
return h('span.error', ' (Failed)') |
|
|
|
return h('span.error', '(Failed)') |
|
|
|
default: |
|
|
|
default: |
|
|
|
return '' |
|
|
|
return '' |
|
|
|
} |
|
|
|
} |
|
|
|