How to use metronome-wallet-ui-logic - 10 common examples

To help you get started, we’ve selected a few metronome-wallet-ui-logic 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 autonomoussoftware / metronome-wallet-desktop / src / components / onboarding / PasswordStep.js View on Github external
text-align: center;
`

const Green = styled.div`
  display: inline-block;
  color: ${p => p.theme.colors.success};
`

export default class PasswordStep extends React.Component {
  static propTypes = {
    requiredPasswordEntropy: PropTypes.number.isRequired,
    onPasswordSubmit: PropTypes.func.isRequired,
    onInputChange: PropTypes.func.isRequired,
    passwordAgain: PropTypes.string,
    password: PropTypes.string,
    errors: utils.errorPropTypes('passwordAgain', 'password')
  }

  onPasswordSubmit = e => {
    e.preventDefault()
    this.props.onPasswordSubmit({ clearOnError: false })
  }

  render() {
    return (
      
        <form data-testid="pass-form">
          
            Enter a strong password until the meter turns green.
          
          
            </form>
github autonomoussoftware / metronome-wallet-desktop / src / components / ChangePassword.js View on Github external
margin-bottom: -3.9rem;
`

class ChangePassword extends React.Component {
  static propTypes = {
    requiredPasswordEntropy: PropTypes.number.isRequired,
    newPasswordAgain: PropTypes.string,
    onInputChange: PropTypes.func.isRequired,
    newPassword: PropTypes.string,
    oldPassword: PropTypes.string,
    onSubmit: PropTypes.func.isRequired,
    history: PropTypes.shape({
      push: PropTypes.func.isRequired
    }).isRequired,
    status: PropTypes.oneOf(['init', 'pending', 'success', 'failure']),
    errors: utils.errorPropTypes(
      'newPasswordAgain',
      'newPassword',
      'oldPassword'
    ),
    error: PropTypes.string
  }

  static contextType = ToastsContext

  handleSubmitAndNavigate = e => {
    e.preventDefault()
    this.props.onSubmit()
  }

  componentDidUpdate(prevProps) {
    if (this.props.status === 'success' && prevProps.status !== 'success') {
github autonomoussoftware / metronome-wallet-desktop / src / components / Login.js View on Github external
import withLoginState from 'metronome-wallet-ui-logic/src/hocs/withLoginState'
import * as utils from 'metronome-wallet-ui-logic/src/utils'
import PropTypes from 'prop-types'
import React from 'react'

import { TextInput, AltLayout, Btn, Sp } from './common'

class Login extends React.Component {
  static propTypes = {
    onInputChange: PropTypes.func.isRequired,
    onSubmit: PropTypes.func.isRequired,
    password: PropTypes.string,
    errors: utils.errorPropTypes('password'),
    status: utils.statusPropTypes,
    error: PropTypes.string
  }

  render() {
    return (
      
        <form data-testid="login-form">
          
            </form>
github autonomoussoftware / metronome-wallet-desktop / src / components / onboarding / VerifyMnemonicStep.js View on Github external
import PropTypes from 'prop-types'
import React from 'react'

import { TextInput, AltLayout, Btn, Sp } from '../common'
import SecondaryBtn from './SecondaryBtn'
import Message from './Message'

export default class VerifyMnemonicStep extends React.Component {
  static propTypes = {
    onMnemonicCopiedToggled: PropTypes.func.isRequired,
    onMnemonicAccepted: PropTypes.func.isRequired,
    onInputChange: PropTypes.func.isRequired,
    mnemonicAgain: PropTypes.string,
    shouldSubmit: PropTypes.func.isRequired,
    getTooltip: PropTypes.func.isRequired,
    errors: utils.errorPropTypes('mnemonicAgain')
  }

  render() {
    return (
      
        <form data-testid="mnemonic-form">
          
            To verify you have copied the recovery passphrase correctly, enter
            the 12 words provided before in the field below.
          
          
            </form>
github autonomoussoftware / metronome-wallet-desktop / src / components / onboarding / UserMnemonicStep.js View on Github external
import PropTypes from 'prop-types'
import React from 'react'

import { TextInput, AltLayout, Btn, Sp } from '../common'
import SecondaryBtn from './SecondaryBtn'
import Message from './Message'

export default class UserMnemonic extends React.Component {
  static propTypes = {
    onUseUserMnemonicToggled: PropTypes.func.isRequired,
    onMnemonicAccepted: PropTypes.func.isRequired,
    onInputChange: PropTypes.func.isRequired,
    userMnemonic: PropTypes.string,
    shouldSubmit: PropTypes.func.isRequired,
    getTooltip: PropTypes.func.isRequired,
    errors: utils.errorPropTypes('userMnemonic')
  }

  render() {
    return (
      
        <form data-testid="mnemonic-form">
          
            Enter a valid 12 word passphrase to recover a previously created
            wallet.
          
          
            </form>
github autonomoussoftware / metronome-wallet-desktop / src / components / dashboard / tx-list / TxRow.js View on Github external
)}

        {tx.txType === 'auction' &amp;&amp;
          !isPending &amp;&amp; (
            
          )}

        {(tx.txType === 'unknown' || isPending) &amp;&amp; (
          {confirmations}
        )}
        <div>
          
            {tx.txType === 'auction' ? (
              
                </div>
github autonomoussoftware / metronome-wallet-desktop / src / components / common / ConfirmationWizard.js View on Github external
<title>{this.props.successTitle}</title>
              
              {this.props.successText &amp;&amp; (
                {this.props.successText}
              )}
            
          
        
      )
    }
    if (status === 'failure') {
      return (
        
          
            
            
              <title>{this.props.failureTitle}</title>
            
            {error &amp;&amp; {error}}
            
              Try again
            
          
        
      )
    }
    return (
github autonomoussoftware / metronome-wallet-desktop / src / components / dashboard / tx-list / TxRow.js View on Github external
const { confirmations, parsed: tx, ...other } = this.props
    const isFailed =
      (tx.txType === 'auction' &amp;&amp;
        !tx.mtnBoughtInAuction &amp;&amp;
        confirmations &gt; 0) ||
      tx.contractCallFailed
    const isPending = !isFailed &amp;&amp; confirmations &lt; 6

    return (
      
        {(tx.txType === 'received' || tx.txType === 'sent') &amp;&amp;
          !isPending &amp;&amp; (
            
          )}

        {tx.txType === 'converted' &amp;&amp;
          !isPending &amp;&amp; (
            
          )}
github autonomoussoftware / metronome-wallet-desktop / src / components / dashboard / tx-list / row / Icon.js View on Github external
render() {
    const color = this.props.isFailed
      ? theme.colors.danger
      : theme.colors.primary

    if (this.props.txType === 'unknown' || this.props.isPending) {
      return {this.props.confirmations}
    }

    switch (this.props.txType) {
      case 'converted':
        return 
      case 'auction':
        return 
      case 'imported':
        return 
      case 'exported':
        return 
      default:
        return
github autonomoussoftware / metronome-wallet-desktop / src / components / common / ConfirmationWizard.js View on Github external
<title>{this.props.pendingTitle}</title>
            
            
            {this.props.pendingText &amp;&amp; (
              
                {this.props.pendingText}
              
            )}
          
        
      
    )
  }
}

export default withClient(ConfirmationWizard)