* hide standard text when we have a description

* lookup description in message bundle

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
This commit is contained in:
Erik Jan de Wit 2024-10-10 15:17:14 +02:00 committed by Pedro Igor
parent eb5afeeabb
commit b4caeee0c7

View file

@ -5,9 +5,9 @@ import {
Page,
Text,
TextContent,
TextVariants,
} from "@patternfly/react-core";
import { useTranslation } from "react-i18next";
import { label } from "../user-profile/utils";
import { getNetworkErrorDescription } from "../utils/errors";
type ErrorPageProps = {
@ -30,7 +30,7 @@ export const ErrorPage = (props: ErrorPageProps) => {
<Page>
<Modal
variant={ModalVariant.small}
title={t("somethingWentWrong")}
title={errorMessage ? "" : t("somethingWentWrong")}
titleIconVariant="danger"
showClose={false}
isOpen
@ -41,9 +41,10 @@ export const ErrorPage = (props: ErrorPageProps) => {
]}
>
<TextContent>
{errorMessage ? (
<Text>{label(t, errorMessage)}</Text>
) : (
<Text>{t("somethingWentWrongDescription")}</Text>
{errorMessage && (
<Text component={TextVariants.small}>{errorMessage}</Text>
)}
</TextContent>
</Modal>