You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
669 B
30 lines
669 B
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;
|
|
}
|
|
}
|
|
|