|
@ -1,5 +1,8 @@ |
|
|
import React, { Component } from 'react' |
|
|
import React, { Component } from 'react' |
|
|
import PropTypes from 'prop-types' |
|
|
import PropTypes from 'prop-types' |
|
|
|
|
|
import Isvg from 'react-inlinesvg' |
|
|
|
|
|
import searchIcon from 'icons/search.svg' |
|
|
|
|
|
import xIcon from 'icons/x.svg' |
|
|
|
|
|
|
|
|
import Wallet from 'components/Wallet' |
|
|
import Wallet from 'components/Wallet' |
|
|
import LoadingBolt from 'components/LoadingBolt' |
|
|
import LoadingBolt from 'components/LoadingBolt' |
|
@ -48,7 +51,15 @@ class Activity extends Component { |
|
|
) |
|
|
) |
|
|
} else if (Object.prototype.hasOwnProperty.call(activity, 'payment_request')) { |
|
|
} else if (Object.prototype.hasOwnProperty.call(activity, 'payment_request')) { |
|
|
// activity is an LN invoice
|
|
|
// activity is an LN invoice
|
|
|
return <Invoice invoice={activity} ticker={ticker} currentTicker={currentTicker} showActivityModal={showActivityModal} /> |
|
|
return ( |
|
|
|
|
|
<Invoice |
|
|
|
|
|
invoice={activity} |
|
|
|
|
|
ticker={ticker} |
|
|
|
|
|
currentTicker={currentTicker} |
|
|
|
|
|
showActivityModal={showActivityModal} |
|
|
|
|
|
currencyName={currencyName} |
|
|
|
|
|
/> |
|
|
|
|
|
) |
|
|
} |
|
|
} |
|
|
// activity is an LN payment
|
|
|
// activity is an LN payment
|
|
|
return ( |
|
|
return ( |
|
@ -69,11 +80,16 @@ class Activity extends Component { |
|
|
activity: { |
|
|
activity: { |
|
|
filters, |
|
|
filters, |
|
|
filter, |
|
|
filter, |
|
|
filterPulldown |
|
|
filterPulldown, |
|
|
|
|
|
searchActive, |
|
|
|
|
|
searchText |
|
|
}, |
|
|
}, |
|
|
changeFilter, |
|
|
changeFilter, |
|
|
currentActivity, |
|
|
currentActivity, |
|
|
|
|
|
|
|
|
|
|
|
updateSearchActive, |
|
|
|
|
|
updateSearchText, |
|
|
|
|
|
|
|
|
walletProps |
|
|
walletProps |
|
|
} = this.props |
|
|
} = this.props |
|
|
|
|
|
|
|
@ -84,6 +100,23 @@ class Activity extends Component { |
|
|
<Wallet {...walletProps} /> |
|
|
<Wallet {...walletProps} /> |
|
|
|
|
|
|
|
|
<div className={styles.activities}> |
|
|
<div className={styles.activities}> |
|
|
|
|
|
{ |
|
|
|
|
|
searchActive ? |
|
|
|
|
|
<header className={`${styles.header} ${styles.search}`}> |
|
|
|
|
|
<section> |
|
|
|
|
|
<input |
|
|
|
|
|
placeholder='Search' |
|
|
|
|
|
value={searchText} |
|
|
|
|
|
onChange={event => updateSearchText(event.target.value)} |
|
|
|
|
|
/> |
|
|
|
|
|
</section> |
|
|
|
|
|
<section onClick={() => { updateSearchActive(false); updateSearchText('') }}> |
|
|
|
|
|
<span className={styles.xIcon}> |
|
|
|
|
|
<Isvg src={xIcon} /> |
|
|
|
|
|
</span> |
|
|
|
|
|
</section> |
|
|
|
|
|
</header> |
|
|
|
|
|
: |
|
|
<header className={styles.header}> |
|
|
<header className={styles.header}> |
|
|
<section> |
|
|
<section> |
|
|
<ul className={styles.filters}> |
|
|
<ul className={styles.filters}> |
|
@ -98,7 +131,11 @@ class Activity extends Component { |
|
|
} |
|
|
} |
|
|
</ul> |
|
|
</ul> |
|
|
</section> |
|
|
</section> |
|
|
|
|
|
<section onClick={() => updateSearchActive(true)}> |
|
|
|
|
|
<Isvg src={searchIcon} /> |
|
|
|
|
|
</section> |
|
|
</header> |
|
|
</header> |
|
|
|
|
|
} |
|
|
<ul className={`${styles.activityContainer} ${filterPulldown && styles.pulldown}`}> |
|
|
<ul className={`${styles.activityContainer} ${filterPulldown && styles.pulldown}`}> |
|
|
{ |
|
|
{ |
|
|
currentActivity.map((activityBlock, index) => ( |
|
|
currentActivity.map((activityBlock, index) => ( |
|
@ -131,6 +168,8 @@ Activity.propTypes = { |
|
|
|
|
|
|
|
|
showActivityModal: PropTypes.func.isRequired, |
|
|
showActivityModal: PropTypes.func.isRequired, |
|
|
changeFilter: PropTypes.func.isRequired, |
|
|
changeFilter: PropTypes.func.isRequired, |
|
|
|
|
|
updateSearchActive: PropTypes.func.isRequired, |
|
|
|
|
|
updateSearchText: PropTypes.func.isRequired, |
|
|
|
|
|
|
|
|
activity: PropTypes.object.isRequired, |
|
|
activity: PropTypes.object.isRequired, |
|
|
currentActivity: PropTypes.array.isRequired, |
|
|
currentActivity: PropTypes.array.isRequired, |
|
|