How to use the redaction.connect function in redaction

To help you get started, we’ve selected a few redaction examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github swaponline / swap.react / shared / pages / History / History.js View on Github external
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
github swaponline / swap.react / shared / pages / Wallet / Wallet.js View on Github external
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:
github swaponline / swap.react / shared / pages / OldWallet / Wallet.js View on Github external
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 },
}) => {
github swaponline / swap.react / shared / pages / Wallet / Wallet.js View on Github external
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
    )),
github swaponline / swap.react / shared / pages / Currency / Currency.js View on Github external
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,
github swaponline / swap.react / shared / pages / OldWallet / Row / Row.js View on Github external
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 }) => ({
github swaponline / swap.react / shared / pages / Wallet / Row / Row.js View on Github external
// 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 }) => ({
github swaponline / swap.react / shared / containers / App / App.js View on Github external
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() {
github swaponline / swap.react / shared / containers / App / App.js View on Github external
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
github swaponline / swap.react / shared / components / History / History.jsx View on Github external
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)
  }

redaction

Reducers without constants and dispatch

MIT
Latest version published 4 years ago

Package Health Score

45 / 100
Full package analysis

Popular redaction functions