const inherits = require('util').inherits const Component = require('react').Component const h = require('react-hyperscript') const connect = require('react-redux').connect const vreme = new (require('vreme')) const explorerLink = require('../../lib/explorer-link') const extension = require('../../../app/scripts/lib/extension') const actions = require('../actions') const addressSummary = require('../util').addressSummary const CopyButton = require('./copyButton') const EtherBalance = require('./eth-balance') const Tooltip = require('./tooltip') module.exports = connect(mapStateToProps)(ShiftListItem) function mapStateToProps (state) { return {} } inherits(ShiftListItem, Component) function ShiftListItem () { Component.call(this) } ShiftListItem.prototype.render = function () { return ( h('.transaction-list-item.flex-row', { style: { paddingTop: '20px', paddingBottom: '20px', justifyContent: 'space-around', alignItems: 'center', }, }, [ h('div', { style: { width: '0px', position: 'relative', bottom: '19px', }, }, [ h('img', { src: 'https://info.shapeshift.io/sites/default/files/logo.png', style: { height: '35px', width: '132px', position: 'absolute', clip: 'rect(0px,23px,34px,0px)', }, }), ]), this.renderInfo(), this.renderUtilComponents(), ]) ) } function formatDate (date) { return vreme.format(new Date(date), 'March 16 2014 14:30') } ShiftListItem.prototype.renderUtilComponents = function () { var props = this.props switch (props.response.status) { case 'no_deposits': return h('.flex-row', [ h(CopyButton, { value: this.props.depositAddress, }), 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': return h('.flex-row') case 'complete': return h('.flex-row', [ h(CopyButton, { value: this.props.response.transaction, }), h(EtherBalance, { value: `${props.response.outgoingCoin}`, width: '55px', shorten: true, needsParse: false, incoming: true, style: { fontSize: '15px', color: '#01888C', }, }), ]) case 'failed': return '' default: return '' } } ShiftListItem.prototype.renderInfo = function () { var props = this.props switch (props.response.status) { case 'no_deposits': return h('.flex-column', { style: { width: '200px', overflow: 'hidden', }, }, [ h('div', { style: { fontSize: 'x-small', color: '#ABA9AA', width: '100%', }, }, `${props.depositType} to ETH via ShapeShift`), h('div', 'No deposits received'), h('div', { style: { fontSize: 'x-small', color: '#ABA9AA', width: '100%', }, }, formatDate(props.time)), ]) case 'received': return h('.flex-column', { style: { width: '200px', overflow: 'hidden', }, }, [ h('div', { style: { fontSize: 'x-small', color: '#ABA9AA', width: '100%', }, }, `${props.depositType} to ETH via ShapeShift`), h('div', 'Conversion in progress'), h('div', { style: { fontSize: 'x-small', color: '#ABA9AA', width: '100%', }, }, formatDate(props.time)), ]) case 'complete': var url = explorerLink(props.response.transaction, parseInt('1')) return h('.flex-column.pointer', { style: { width: '200px', overflow: 'hidden', }, onClick: () => extension.tabs.create({ url, }), }, [ h('div', { style: { fontSize: 'x-small', color: '#ABA9AA', width: '100%', }, }, 'From ShapeShift'), h('div', formatDate(props.time)), h('div', { style: { fontSize: 'x-small', color: '#ABA9AA', width: '100%', }, }, addressSummary(props.response.transaction)), ]) case 'failed': return h('span.error', '(Failed)') default: return '' } } >branches/RELENG_2_1_0</option> <option value='branches/RELENG_2_2'>branches/RELENG_2_2</option> <option value='branches/RELENG_9_1_0'>branches/RELENG_9_1_0</option> <option value='branches/RELENG_9_2_0'>branches/RELENG_9_2_0</option> <option value='dependabot/npm_and_yarn/devel/electron4/files/eslint-utils-1.4.3'>dependabot/npm_and_yarn/devel/electron4/files/eslint-utils-1.4.3</option> <option value='dependabot/npm_and_yarn/devel/electron4/files/lodash-4.17.15'>dependabot/npm_and_yarn/devel/electron4/files/lodash-4.17.15</option> <option value='dependabot/npm_and_yarn/devel/electron4/files/lodash.merge-4.6.2'>dependabot/npm_and_yarn/devel/electron4/files/lodash.merge-4.6.2</option> <option value='dependabot/npm_and_yarn/devel/electron4/files/lodash.template-4.5.0'>dependabot/npm_and_yarn/devel/electron4/files/lodash.template-4.5.0</option> <option value='dependabot/npm_and_yarn/devel/electron4/files/minimist-1.2.2'>dependabot/npm_and_yarn/devel/electron4/files/minimist-1.2.2</option> <option value='dependabot/npm_and_yarn/devel/electron4/files/mixin-deep-1.3.2' selected='selected'>dependabot/npm_and_yarn/devel/electron4/files/mixin-deep-1.3.2</option> <option value='main'>main</option> <option value='master'>master</option> <option value='svn_head'>svn_head</option> </select> <input type='submit' value='switch'/></form></td></tr> <tr><td class='sub'>FreeBSD Ports (https://github.com/freebsd/freebsd-ports)</td><td class='sub right'></td></tr></table> <table class='tabs'><tr><td> <a href='/~lantw44/cgit/cgit.cgi/freebsd-ports/about/?h=dependabot/npm_and_yarn/devel/electron4/files/mixin-deep-1.3.2'>about</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports/?h=dependabot/npm_and_yarn/devel/electron4/files/mixin-deep-1.3.2'>summary</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports/refs/?h=dependabot/npm_and_yarn/devel/electron4/files/mixin-deep-1.3.2&id=a2f03bb0ded38f0e400ea145b47f7edc883edbe5'>refs</a><a class='active' href='/~lantw44/cgit/cgit.cgi/freebsd-ports/log/x11/xmsg?h=dependabot/npm_and_yarn/devel/electron4/files/mixin-deep-1.3.2'>log</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports/tree/x11/xmsg?h=dependabot/npm_and_yarn/devel/electron4/files/mixin-deep-1.3.2&id=a2f03bb0ded38f0e400ea145b47f7edc883edbe5'>tree</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports/commit/x11/xmsg?h=dependabot/npm_and_yarn/devel/electron4/files/mixin-deep-1.3.2&id=a2f03bb0ded38f0e400ea145b47f7edc883edbe5'>commit</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports/diff/x11/xmsg?h=dependabot/npm_and_yarn/devel/electron4/files/mixin-deep-1.3.2&id=a2f03bb0ded38f0e400ea145b47f7edc883edbe5'>diff</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports/stats/x11/xmsg?h=dependabot/npm_and_yarn/devel/electron4/files/mixin-deep-1.3.2'>stats</a></td><td class='form'><form class='right' method='get' action='/~lantw44/cgit/cgit.cgi/freebsd-ports/log/x11/xmsg'> <input type='hidden' name='h' value='dependabot/npm_and_yarn/devel/electron4/files/mixin-deep-1.3.2'/><input type='hidden' name='id' value='a2f03bb0ded38f0e400ea145b47f7edc883edbe5'/><select name='qt'> <option value='grep'>log msg</option> <option value='author'>author</option> <option value='committer'>committer</option> <option value='range'>range</option> </select> <input class='txt' type='search' size='10' name='q' value=''/> <input type='submit' value='search'/> </form> </td></tr></table> <div class='path'>path: <a href='/~lantw44/cgit/cgit.cgi/freebsd-ports/log/?h=dependabot/npm_and_yarn/devel/electron4/files/mixin-deep-1.3.2&id=a2f03bb0ded38f0e400ea145b47f7edc883edbe5'>root</a>/<a href='/~lantw44/cgit/cgit.cgi/freebsd-ports/log/x11?h=dependabot/npm_and_yarn/devel/electron4/files/mixin-deep-1.3.2&id=a2f03bb0ded38f0e400ea145b47f7edc883edbe5'>x11</a>/<a href='/~lantw44/cgit/cgit.cgi/freebsd-ports/log/x11/xmsg?h=dependabot/npm_and_yarn/devel/electron4/files/mixin-deep-1.3.2&id=a2f03bb0ded38f0e400ea145b47f7edc883edbe5'>xmsg</a></div><div class='content'><table class='list nowrap'><tr class='nohover'><th></th><th class='left'>Commit message (<a href='/~lantw44/cgit/cgit.cgi/freebsd-ports/log/x11/xmsg?h=dependabot/npm_and_yarn/devel/electron4/files/mixin-deep-1.3.2&id=a2f03bb0ded38f0e400ea145b47f7edc883edbe5&showmsg=1'>Expand</a>)</th><th class='left'>Author</th><th class='left'>Age</th><th class='left'>Files</th><th class='left'>Lines</th></tr>