blob: 0be01996a052df47940b2ad304d2952630bb2c57 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import classnames from 'classnames'
export default class SendRowErrorMessage extends Component {
static propTypes = {
errors: PropTypes.object,
errorType: PropTypes.string,
};
static contextTypes = {
t: PropTypes.func,
};
render () {
const { errors, errorType } = this.props
const errorMessage = errors[errorType]
return (
errorMessage
? <div className={classnames('send-v2__error', {'send-v2__error-amount': errorType === 'amount'})}>{this.context.t(errorMessage)}</div>
: null
)
}
}
|