Jack Mallers
7 years ago
5 changed files with 100 additions and 3 deletions
@ -0,0 +1,67 @@ |
|||||
|
import React from 'react' |
||||
|
import PropTypes from 'prop-types' |
||||
|
|
||||
|
import Moment from 'react-moment' |
||||
|
import 'moment-timezone' |
||||
|
|
||||
|
import { FaAngleDown } from 'react-icons/lib/fa' |
||||
|
|
||||
|
import Value from 'components/Value' |
||||
|
|
||||
|
import styles from './PaymentModal.scss' |
||||
|
|
||||
|
const PaymentModal = ({ |
||||
|
transaction, |
||||
|
ticker, |
||||
|
currentTicker, |
||||
|
|
||||
|
toggleCurrencyProps: { |
||||
|
setActivityModalCurrencyFilters, |
||||
|
showCurrencyFilters, |
||||
|
currencyName, |
||||
|
currentCurrencyFilters, |
||||
|
onCurrencyFilterClick |
||||
|
} |
||||
|
}) => { |
||||
|
console.log('transaction: ', transaction) |
||||
|
return ( |
||||
|
<div className={styles.container}> |
||||
|
<div className={styles.content}> |
||||
|
<section className={styles.left} /> |
||||
|
<section className={styles.right}> |
||||
|
<div className={styles.details}> |
||||
|
<section className={styles.amount}> |
||||
|
<h1> |
||||
|
<Value value={transaction.amount} currency={ticker.currency} currentTicker={currentTicker} /> |
||||
|
</h1> |
||||
|
<section className={styles.currentCurrency} onClick={() => setActivityModalCurrencyFilters(!showCurrencyFilters)}> |
||||
|
<span>{currencyName}</span><span><FaAngleDown /></span> |
||||
|
</section> |
||||
|
<ul className={showCurrencyFilters && styles.active}> |
||||
|
{ |
||||
|
currentCurrencyFilters.map(filter => |
||||
|
<li key={filter.key} onClick={() => onCurrencyFilterClick(filter.key)}>{filter.name}</li>) |
||||
|
} |
||||
|
</ul> |
||||
|
</section> |
||||
|
<section className={styles.date}> |
||||
|
<p> |
||||
|
<Moment format='MM/DD/YYYY'>{transaction.time_stamp * 1000}</Moment> |
||||
|
</p> |
||||
|
</section> |
||||
|
</div> |
||||
|
</section> |
||||
|
</div> |
||||
|
</div> |
||||
|
) |
||||
|
} |
||||
|
|
||||
|
PaymentModal.propTypes = { |
||||
|
transaction: PropTypes.object.isRequired, |
||||
|
ticker: PropTypes.object.isRequired, |
||||
|
currentTicker: PropTypes.object.isRequired, |
||||
|
|
||||
|
toggleCurrencyProps: PropTypes.object.isRequired |
||||
|
} |
||||
|
|
||||
|
export default PaymentModal |
Loading…
Reference in new issue