Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
feat(ui): add fallback address to RequestSummary
Browse files Browse the repository at this point in the history
  • Loading branch information
korhaliv committed Aug 19, 2019
1 parent dec8bfe commit 8095268
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions renderer/components/Request/Request.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class Request extends React.Component {
}).isRequired,
chainName: PropTypes.string.isRequired,
createInvoice: PropTypes.func.isRequired,
createNewAddress: PropTypes.func.isRequired,
cryptoUnit: PropTypes.string.isRequired,
cryptoUnitName: PropTypes.string.isRequired,
fetchTickers: PropTypes.func.isRequired,
Expand Down
10 changes: 10 additions & 0 deletions renderer/components/Request/RequestSummary.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ const RequestSummary = ({ invoice = {}, payReq, intl, showNotification, ...rest
const descriptionTag = tags.find(tag => tag.tagName === 'description') || {}
const memo = descriptionTag.data

const fallbackTag = tags.find(tag => tag.tagName === 'fallback_address')
const fallback = fallbackTag && fallbackTag.data.address

const getStatusColor = () => {
if (invoice.settled) {
return 'superGreen'
Expand Down Expand Up @@ -74,6 +77,13 @@ const RequestSummary = ({ invoice = {}, payReq, intl, showNotification, ...rest
</>
)}

{fallback && (
<>
<Bar variant="light" />
<DataRow left={<FormattedMessage {...messages.fallback_address} />} right={fallback} />
</>
)}

<Bar variant="light" />

<DataRow
Expand Down
1 change: 1 addition & 0 deletions renderer/containers/Request.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { connect } from 'react-redux'
import { Request } from 'components/Request'
import { fetchTickers, tickerSelectors } from 'reducers/ticker'
import { createNewAddress } from 'reducers/address'
import { createInvoice, invoiceSelectors } from 'reducers/invoice'
import { showNotification, showError } from 'reducers/notification'
import { walletSelectors } from 'reducers/wallet'
Expand Down

0 comments on commit 8095268

Please # to comment.