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.
31 lines
669 B
31 lines
669 B
4 years ago
|
import React, { Component } from 'react';
|
||
|
import PropTypes from 'prop-types';
|
||
|
import classnames from 'classnames';
|
||
7 years ago
|
|
||
7 years ago
|
export default class SendRowErrorMessage extends Component {
|
||
|
static propTypes = {
|
||
|
errors: PropTypes.object,
|
||
|
errorType: PropTypes.string,
|
||
4 years ago
|
};
|
||
7 years ago
|
|
||
6 years ago
|
static contextTypes = {
|
||
|
t: PropTypes.func,
|
||
4 years ago
|
};
|
||
6 years ago
|
|
||
4 years ago
|
render() {
|
||
4 years ago
|
const { errors, errorType } = this.props;
|
||
7 years ago
|
|
||
4 years ago
|
const errorMessage = errors[errorType];
|
||
7 years ago
|
|
||
4 years ago
|
return errorMessage ? (
|
||
|
<div
|
||
|
className={classnames('send-v2__error', {
|
||
|
'send-v2__error-amount': errorType === 'amount',
|
||
|
})}
|
||
|
>
|
||
|
{this.context.t(errorMessage)}
|
||
|
</div>
|
||
4 years ago
|
) : null;
|
||
7 years ago
|
}
|
||
|
}
|