Skip to content

Commit

Permalink
0.0.6 (#98)
Browse files Browse the repository at this point in the history
* Remove unneeded state
* Fix request notice svgs
  • Loading branch information
floating authored Aug 26, 2018
1 parent 85635a2 commit 58b64ab
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 33 deletions.
24 changes: 13 additions & 11 deletions app/App/Panel/Main/Signer/Requests/ProviderRequest/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,40 @@ class ProviderRequest extends React.Component {
}, 2000)
}
render () {
let status = this.props.req.status
let notice = this.props.req.notice
let requestClass = 'signerRequest'
if (this.props.req.status === 'success') requestClass += ' signerRequestSuccess'
if (this.props.req.status === 'declined') requestClass += ' signerRequestDeclined'
if (this.props.req.status === 'pending') requestClass += ' signerRequestPending'
if (this.props.req.status === 'error') requestClass += ' signerRequestError'
if (status === 'success') requestClass += ' signerRequestSuccess'
if (status === 'declined') requestClass += ' signerRequestDeclined'
if (status === 'pending') requestClass += ' signerRequestPending'
if (status === 'error') requestClass += ' signerRequestError'
let origin = this.props.req.origin
let originClass = 'requestProviderOrigin'
if (origin.length > 28) originClass = 'requestProviderOrigin requestProviderOrigin18'
if (origin.length > 36) originClass = 'requestProviderOrigin requestProviderOrigin12'
return (
<div key={this.props.req.id || this.props.req.handlerId} className={requestClass} style={{top: (this.props.top * 10) + 'px'}}>
<div className='approveTransaction'>
{this.props.req.notice ? (
{notice ? (
<div className='requestNotice'>
{(_ => {
if (this.props.req.status === 'pending') {
if (status === 'pending') {
return (
<div className='requestNoticeInner bounceIn'>
<div><div className='loader' /></div>
</div>
)
} else if (this.props.req.status === 'success') {
return <div className='requestNoticeInner bounceIn'>{svg.octicon('check', {height: '80px'})}</div>
} else if (this.props.req.status === 'error' || this.props.req.status === 'declined') {
return <div className='requestNoticeInner bounceIn'>{svg.octicon('circle-slash', {height: '80px'})}</div>
} else if (status === 'success') {
return <div className='requestNoticeInner bounceIn'>{svg.octicon('check', {height: 80})}</div>
} else if (status === 'error' || status === 'declined') {
return <div className='requestNoticeInner bounceIn'>{svg.octicon('circle-slash', {height: 80})}</div>
}
})()}
</div>
) : (
<div className='approveTransactionPayload'>
<div className='approveRequestHeader approveTransactionHeader'>
<div className='approveRequestHeaderIcon'> {svg.octicon('shield', {height: '20px'})}</div>
<div className='approveRequestHeaderIcon'> {svg.octicon('shield', {height: 20})}</div>
<div className='approveRequestHeaderLabel'> {'Connection'}</div>
</div>
<div className='requestProvider bounceIn'>
Expand Down
23 changes: 12 additions & 11 deletions app/App/Panel/Main/Signer/Requests/TransactionRequest/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class TransactionRequest extends React.Component {
}
render () {
let status = this.props.req.status
let notice = this.props.req.notice
let requestClass = 'signerRequest'
if (status === 'success') requestClass += ' signerRequestSuccess'
if (status === 'declined') requestClass += ' signerRequestDeclined'
Expand All @@ -47,39 +48,39 @@ class TransactionRequest extends React.Component {
{this.props.req.type === 'approveTransaction' ? (
<div className='approveTransaction'>
<div className='approveTransactionPayload'>
{this.props.req.notice ? (
{notice ? (
<div className='requestNotice'>
{(_ => {
if (status === 'pending') {
return (
<div key={status} className='requestNoticeInner bounceIn'>
<div style={{paddingBottom: '20px'}}><div className='loader' /></div>
<div style={{paddingBottom: 20}}><div className='loader' /></div>
<div className='requestNoticeInnerText'>{'See Signer'}</div>
</div>
)
} else if (status === 'success') {
return (
<div key={status} className='requestNoticeInner bounceIn'>
<div>{svg.octicon('check', {height: '80px'})}</div>
<div className='requestNoticeInnerText'>{this.props.req.notice}</div>
<div>{svg.octicon('check', {height: 80})}</div>
<div className='requestNoticeInnerText'>{notice}</div>
</div>
)
} else if (status === 'error' || status === 'declined') {
return (
<div key={status} className='requestNoticeInner bounceIn'>
<div>{svg.octicon('circle-slash', {height: '80px'})}</div>
<div className='requestNoticeInnerText'>{this.props.req.notice}</div>
<div>{svg.octicon('circle-slash', {height: 80})}</div>
<div className='requestNoticeInnerText'>{notice}</div>
</div>
)
} else {
return <div key={this.props.req.notice} className='requestNoticeInner bounceIn'>{this.props.req.notice}</div>
return <div key={notice} className='requestNoticeInner bounceIn'>{notice}</div>
}
})()}
</div>
) : (
<React.Fragment>
<div className='approveRequestHeader approveTransactionHeader'>
<div className='approveRequestHeaderIcon'> {svg.octicon('radio-tower', {height: '22px'})}</div>
<div className='approveRequestHeaderIcon'> {svg.octicon('radio-tower', {height: 22})}</div>
<div className='approveRequestHeaderLabel'> {'Transaction'}</div>
</div>
<div className='transactionValue'>
Expand All @@ -99,9 +100,9 @@ class TransactionRequest extends React.Component {
{utils.toAscii(this.props.req.data.data || '0x') ? (
<div className={this.state.dataView ? 'transactionData transactionDataSelected' : 'transactionData'}>
<div className='transactionDataHeader' onClick={() => this.toggleDataView()}>
<div className='transactionDataNotice'>{svg.octicon('issue-opened', {height: '22px'})}</div>
<div className='transactionDataNotice'>{svg.octicon('issue-opened', {height: 22})}</div>
<div className='transactionDataLabel'>{'View Data'}</div>
<div className='transactionDataIndicator'>{svg.octicon('chevron-down', {height: '22px'})}</div>
<div className='transactionDataIndicator'>{svg.octicon('chevron-down', {height: 22})}</div>
</div>
<div className='transactionDataBody'>
<div className='transactionDataBodyInner'>
Expand All @@ -115,7 +116,7 @@ class TransactionRequest extends React.Component {
{this.props.req.data.to ? (
<div className='transactionTo'>
<div className='transactionToAddress'>
<div className='transactionToAddressLarge'>{this.props.req.data.to.substring(0, 11)} {svg.octicon('kebab-horizontal', {height: '20px'})} {this.props.req.data.to.substr(this.props.req.data.to.length - 11)}</div>
<div className='transactionToAddressLarge'>{this.props.req.data.to.substring(0, 11)} {svg.octicon('kebab-horizontal', {height: 20})} {this.props.req.data.to.substr(this.props.req.data.to.length - 11)}</div>
<div className='transactionToAddressFull'>
{this.state.copied ? <span>{'Copied'}{svg.octicon('clippy', {height: 10})}</span> : this.props.req.data.to}
<input onClick={e => this.copyAddress(e)} value={this.props.req.data.to} readOnly />
Expand Down
4 changes: 2 additions & 2 deletions app/App/Panel/Main/style/index.styl
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
.introLogo
padding-bottom 14px

svg
color outerspace
svg
fill outerspace

.introInstructions
margin-top 15px
Expand Down
2 changes: 1 addition & 1 deletion app/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ store.events.on('declineRequest', (id, req) => {
const etherRates = () => {
fetch('https://api.coinbase.com/v2/exchange-rates?currency=ETH').then(res => res.json()).then(res => {
if (res && res.data && res.data.rates) store.updateExternalRates(res.data.rates)
})
}).catch(e => console.log('Unable to fetch exchange rate', e))
}
etherRates()
setInterval(etherRates, 10000)
Expand Down
7 changes: 0 additions & 7 deletions app/store/state/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,4 @@ let initial = {
}
}

if (initial.frame.type !== 'tray' && initial.view.list.length === 0) {
let id = uuid()
initial.view.current = id
initial.view.list = [id]
initial.view.data[id] = {url: 'http://localhost:1234', title: ''}
}

export default () => initial
2 changes: 1 addition & 1 deletion app/svg/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
logo: size => {
return (
<div style={{width: size + 'px', height: size + 'px'}}>
<svg id="Layer_2" data-name="Layer 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 153.42 152.94">
<svg viewBox="0 0 153.42 152.94">
<path d="M145.15,75.59v-58a9.29,9.29,0,0,0-9.3-9.28H77.65a2.24,2.24,0,0,1-1.56-.64l-7-7A2.24,2.24,0,0,0,67.48,0H9.31A9.29,9.29,0,0,0,0,9.27H0v58a2.16,2.16,0,0,0,.65,1.55l7,7a2.16,2.16,0,0,1,.65,1.55v58a9.29,9.29,0,0,0,9.3,9.28H75.8a2.24,2.24,0,0,1,1.56.64l7,7a2.24,2.24,0,0,0,1.56.64h58.19a9.29,9.29,0,0,0,9.31-9.27h0v-58a2.16,2.16,0,0,0-.65-1.55l-7-7A2.17,2.17,0,0,1,145.15,75.59Zm-32.3,38.55H40.65A1.68,1.68,0,0,1,39,112.47V40.53a1.68,1.68,0,0,1,1.67-1.67h72.18a1.68,1.68,0,0,1,1.67,1.67v71.94a1.68,1.68,0,0,1-1.67,1.67Z" transform="translate(0 0)"/>
</svg>
</div>
Expand Down

0 comments on commit 58b64ab

Please sign in to comment.