Minor refactoring

This commit is contained in:
Philipp Czora
2019-03-04 11:19:33 +01:00
parent adf92db9b2
commit f68398e599

View File

@@ -69,8 +69,8 @@ class BackendErrorNotification extends React.Component<Props> {
const { error, t } = this.props; const { error, t } = this.props;
return ( return (
<> <>
{this.renderContext(error)} {this.renderContext()}
{this.renderMoreInformationLink(error)} {this.renderMoreInformationLink()}
<div className="level is-size-7"> <div className="level is-size-7">
<div className="left"> <div className="left">
{t("errors.transactionId")} {error.transactionId} {t("errors.transactionId")} {error.transactionId}
@@ -83,7 +83,8 @@ class BackendErrorNotification extends React.Component<Props> {
); );
}; };
renderContext = (error: BackendError) => { renderContext = () => {
const { error, t} = this.props;
if (error.context) { if (error.context) {
return ( return (
<> <>
@@ -104,8 +105,8 @@ class BackendErrorNotification extends React.Component<Props> {
} }
}; };
renderMoreInformationLink = (error: BackendError) => { renderMoreInformationLink = () => {
const { t } = this.props; const { error, t } = this.props;
if (error.url) { if (error.url) {
return ( return (
<p> <p>