Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (filter === 'received') {
return items.filter(({ direction }) => direction === 'in')
}
return items
}
const subTitle = defineMessages({
subTitleHistory: {
id: 'Amount68',
defaultMessage: 'My History',
},
})
@injectIntl
@connect(({ history: { transactions, filter, swapHistory } }) => ({
items: filterHistory(transactions, filter),
swapHistory,
}))
export default class History extends Component {
state = {
renderedItems: 10,
}
componentDidMount() {
// actions.analytics.dataEvent('open-page-history')
actions.user.setTransactions()
actions.core.getSwapHistory()
}
loadMore = () => {
const { items } = this.props
import styles from 'components/tables/Table/Table.scss'
import PageHeadline from 'components/PageHeadline/PageHeadline'
import PageSeo from 'components/Seo/PageSeo'
import PartialClosure from 'pages/PartialClosure/PartialClosure'
import SubTitle from 'components/PageHeadline/SubTitle/SubTitle'
import KeyActionsPanel from 'components/KeyActionsPanel/KeyActionsPanel'
import SaveKeysModal from 'components/modals/SaveKeysModal/SaveKeysModal'
import { FormattedMessage, injectIntl, defineMessages } from 'react-intl'
import Referral from 'components/Footer/Referral/Referral'
import config from 'app-config'
const isWidgetBuild = config && config.isWidget
@connect(
({
core: { hiddenCoinsList },
user: {
ethData,
btcData,
bchData,
tokensData,
eosData,
/* xlmData, */ telosData,
nimData,
USDTomniData,
ltcData,
},
currencies: { items: currencies },
}) => ({
tokens:
import styles from 'components/tables/Table/Table.scss'
import PageHeadline from 'components/PageHeadline/PageHeadline'
import PageSeo from 'components/Seo/PageSeo'
import PartialClosure from 'pages/PartialClosure/PartialClosure'
import SubTitle from 'components/PageHeadline/SubTitle/SubTitle'
import KeyActionsPanel from 'components/KeyActionsPanel/KeyActionsPanel'
import SaveKeysModal from 'components/modals/SaveKeysModal/SaveKeysModal'
import { FormattedMessage, injectIntl, defineMessages } from 'react-intl'
import Referral from 'components/Footer/Referral/Referral'
import config from 'app-config'
const isWidgetBuild = config && config.isWidget
@connect(({
core: { hiddenCoinsList },
user: {
ethData,
btcData,
bchData,
tokensData,
eosData,
telosData,
ltcData,
qtumData,
// usdtOmniData,
// nimData,
// xlmData,
},
currencies: { items: currencies },
}) => {
import { WithdrawButton } from 'components/controls'
import styles from 'components/tables/Table/Table.scss'
import PageHeadline from 'components/PageHeadline/PageHeadline'
import PageSeo from 'components/Seo/PageSeo'
import SubTitle from 'components/PageHeadline/SubTitle/SubTitle'
import KeyActionsPanel from 'components/KeyActionsPanel/KeyActionsPanel'
import SaveKeysModal from 'components/modals/SaveKeysModal/SaveKeysModal'
import { FormattedMessage, injectIntl, defineMessages } from 'react-intl'
import Referral from 'components/Footer/Referral/Referral'
import config from 'app-config'
const isWidgetBuild = config && config.isWidget
@connect(
({
core: { hiddenCoinsList },
user: { ethData, btcData, tokensData, eosData, /* xlmData, */ telosData, nimData, usdtData, ltcData },
currencies: { items: currencies },
}) => ({
tokens: ((config && config.isWidget) ?
[ config.erc20token.toUpperCase() ]
:
Object.keys(tokensData).map(k => (tokensData[k].currency))
),
items: ((config && config.isWidget) ?
[btcData, ethData, usdtData ]
:
[btcData, ethData, eosData, telosData, /* xlmData, */ ltcData, usdtData /* nimData */ ]).map((data) => (
data.currency
)),
import CSSModules from 'react-css-modules'
import styles from './Currency.scss'
import Title from 'components/PageHeadline/Title/Title'
import PageHeadline from 'components/PageHeadline/PageHeadline'
import SubTitle from 'components/PageHeadline/SubTitle/SubTitle'
import Table from 'components/tables/Table/Table'
import Row from './Row/Row'
import CurrencyButton from 'components/controls/CurrencyButton/CurrencyButton'
import CloseIcon from 'components/ui/CloseIcon/CloseIcon'
@injectIntl
@withRouter
@connect(({
core: { hiddenCoinsList },
user: { ethData, btcData, ltcData, tokensData, nimData /* usdtOmniData */ } }) => ({
items: [ethData, btcData, ltcData, ...Object.keys(tokensData).map(k => (tokensData[k])) /* nimData, usdtOmniData */],
hiddenCoinsList,
}))
@CSSModules(styles, { allowMultiple: true })
export default class Currency extends Component {
constructor({ match: { params: { currency } }, items, tokens, history, intl: { locale } }) {
super()
this.state = {
isBalanceFetching: false,
isBalanceEmpty: true,
balance: 0,
import BtnTooltip from 'components/controls/WithdrawButton/BtnTooltip'
import LinkAccount from '../LinkAccount/LinkAcount'
import KeychainStatus from '../KeychainStatus/KeychainStatus'
import { withRouter } from 'react-router'
import ReactTooltip from 'react-tooltip'
import { FormattedMessage, injectIntl } from 'react-intl'
import CurrencyButton from 'components/controls/CurrencyButton/CurrencyButton'
import { relocalisedUrl, localisedUrl } from 'helpers/locale'
import SwapApp from 'swap.app'
import { BigNumber } from 'bignumber.js'
@injectIntl
@withRouter
@connect(({
rememberedOrders,
user: {
ethData,
btcData,
bchData,
eosData,
telosData,
nimData,
qtumData,
ltcData,
// xlmData,
// usdtOmniData,
tokensData,
},
currencies: { items: currencies },
}, { currency }) => ({
// import KeychainStatus from '../KeychainStatus/KeychainStatus'
import { withRouter } from 'react-router'
import ReactTooltip from 'react-tooltip'
import { FormattedMessage, injectIntl } from 'react-intl'
import CurrencyButton from 'components/controls/CurrencyButton/CurrencyButton'
import { relocalisedUrl, localisedUrl } from 'helpers/locale'
import SwapApp from 'swap.app'
import { BigNumber } from 'bignumber.js'
import dollar from '../images/dollar.svg'
import PartOfAddress from '../components/PartOfAddress'
@injectIntl
@withRouter
@connect(({
rememberedOrders,
user: {
ethData,
btcData,
btcMultisigSMSData,
btcMultisigUserData,
bchData,
nimData,
//qtumData,
ltcData,
// xlmData,
// usdtOmniData,
tokensData,
},
currencies: { items: currencies },
}, { currency }) => ({
import WidthContainer from 'components/layout/WidthContainer/WidthContainer'
import Wrapper from 'components/layout/Wrapper/Wrapper'
import NotificationConductor from 'components/notification/NotificationConductor/NotificationConductor'
import Seo from 'components/Seo/Seo'
import config from 'app-config'
const memdown = require('memdown')
const userLanguage = (navigator.userLanguage || navigator.language || 'en-gb').split('-')[0]
moment.locale(userLanguage)
@withRouter
@connect(({
currencies: { items: currencies },
}) => ({
currencies,
isVisible: 'loader.isVisible',
ethAddress: 'user.ethData.address',
btcAddress: 'user.btcData.address',
tokenAddress: 'user.tokensData.swap.address',
}))
@CSSModules(styles, { allowMultiple: true })
export default class App extends React.Component {
static propTypes = {
children: PropTypes.element.isRequired,
}
constructor() {
import ModalConductor from 'components/modal/ModalConductor/ModalConductor'
import WidthContainer from 'components/layout/WidthContainer/WidthContainer'
import NotificationConductor from 'components/notification/NotificationConductor/NotificationConductor'
import Seo from 'components/Seo/Seo'
import config from 'app-config'
const memdown = require('memdown')
const userLanguage = (navigator.userLanguage || navigator.language || 'en-gb').split('-')[0]
moment.locale(userLanguage)
@withRouter
@connect({
isVisible: 'loader.isVisible',
ethAddress: 'user.ethData.address',
btcAddress: 'user.btcData.address',
tokenAddress: 'user.tokensData.swap.address',
})
@CSSModules(styles, { allowMultiple: true })
export default class App extends React.Component {
static propTypes = {
children: PropTypes.element.isRequired,
}
constructor() {
super()
this.localStorageListener = null
switch (filter) {
case 'ALL':
return state
case 'SENT':
return state.filter(h => h.direction === 'in')
case 'RECEIVED':
return state.filter(h => h.direction === 'out')
default:
return state
}
}
@connect(state => ({
transactions: getFilteredHistory(
state.history.transactions,
state.history.filter,
),
ethAddress: state.user.ethData.address,
btcAddress: state.user.btcData.address,
}))
export default class History extends Component {
componentWillMount() {
const { ethAddress, btcAddress } = this.props
console.log('ethAddress', ethAddress)
console.log('btcAddress', btcAddress)
actions.user.setTransactions(ethAddress, btcAddress)
}