1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-12 04:37:13 +01:00
metamask-extension/ui/pages/send/send-content/send-row-wrapper/send-row-error-message/send-row-error-message.component.js
2021-04-28 14:53:59 -05:00

31 lines
669 B
JavaScript

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;
}
}