mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Refactor ConfirmPageContainerError to ErrorMessage
This commit is contained in:
parent
3c3fed46cb
commit
44d4b5b5db
@ -2,11 +2,8 @@ import React, { Component } from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import classnames from 'classnames'
|
||||
import { Tabs, Tab } from '../../tabs'
|
||||
import {
|
||||
ConfirmPageContainerSummary,
|
||||
ConfirmPageContainerError,
|
||||
ConfirmPageContainerWarning,
|
||||
} from './'
|
||||
import { ConfirmPageContainerSummary, ConfirmPageContainerWarning } from './'
|
||||
import ErrorMessage from '../../error-message'
|
||||
|
||||
export default class ConfirmPageContainerContent extends Component {
|
||||
static propTypes = {
|
||||
@ -95,7 +92,7 @@ export default class ConfirmPageContainerContent extends Component {
|
||||
{
|
||||
(errorKey || errorMessage) && (
|
||||
<div className="confirm-page-container-content__error-container">
|
||||
<ConfirmPageContainerError
|
||||
<ErrorMessage
|
||||
errorMessage={errorMessage}
|
||||
errorKey={errorKey}
|
||||
/>
|
||||
|
@ -1 +0,0 @@
|
||||
export { default } from './confirm-page-container-error.component'
|
@ -1,4 +1,3 @@
|
||||
export { default } from './confirm-page-container-content.component'
|
||||
export { default as ConfirmPageContainerSummary } from './confirm-page-container-summary'
|
||||
export { default as ConfirmPageContainerError } from './confirm-page-container-error'
|
||||
export { default as ConfirmPageContainerWarning } from './confirm-page-container-warning'
|
||||
|
@ -1,5 +1,3 @@
|
||||
@import './confirm-page-container-error/index';
|
||||
|
||||
@import './confirm-page-container-warning/index';
|
||||
|
||||
@import './confirm-page-container-summary/index';
|
||||
|
@ -1,30 +1,30 @@
|
||||
import React from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
|
||||
const ConfirmPageContainerError = (props, context) => {
|
||||
const ErrorMessage = (props, context) => {
|
||||
const { errorMessage, errorKey } = props
|
||||
const error = errorKey ? context.t(errorKey) : errorMessage
|
||||
|
||||
return (
|
||||
<div className="confirm-page-container-error">
|
||||
<div className="error-message">
|
||||
<img
|
||||
src="/images/alert-red.svg"
|
||||
className="confirm-page-container-error__icon"
|
||||
className="error-message__icon"
|
||||
/>
|
||||
<div className="confirm-page-container-error__text">
|
||||
<div className="error-message__text">
|
||||
{ `ALERT: ${error}` }
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
ConfirmPageContainerError.propTypes = {
|
||||
ErrorMessage.propTypes = {
|
||||
errorMessage: PropTypes.string,
|
||||
errorKey: PropTypes.string,
|
||||
}
|
||||
|
||||
ConfirmPageContainerError.contextTypes = {
|
||||
ErrorMessage.contextTypes = {
|
||||
t: PropTypes.func,
|
||||
}
|
||||
|
||||
export default ConfirmPageContainerError
|
||||
export default ErrorMessage
|
1
ui/app/components/error-message/index.js
Normal file
1
ui/app/components/error-message/index.js
Normal file
@ -0,0 +1 @@
|
||||
export { default } from './error-message.component'
|
@ -1,4 +1,4 @@
|
||||
.confirm-page-container-error {
|
||||
.error-message {
|
||||
min-height: 32px;
|
||||
border: 1px solid $monzo;
|
||||
color: $monzo;
|
@ -6,6 +6,8 @@
|
||||
|
||||
@import './confirm-page-container/index';
|
||||
|
||||
@import './error-message/index';
|
||||
|
||||
@import './export-text-container/index';
|
||||
|
||||
@import './info-box/index';
|
||||
|
Loading…
Reference in New Issue
Block a user