From 04d5860a3ba869ee71ee70e0c844889eeacb0fed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20H=C3=B8egh?= Date: Thu, 5 Dec 2024 20:55:16 +0100 Subject: [PATCH] Add retrying text --- .../src/extensions/forms/Form/Status/Status.tsx | 17 ++++++++++++++--- .../extensions/forms/constants/locales/en-GB.ts | 3 ++- .../extensions/forms/constants/locales/nb-NO.ts | 3 ++- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/packages/dnb-eufemia/src/extensions/forms/Form/Status/Status.tsx b/packages/dnb-eufemia/src/extensions/forms/Form/Status/Status.tsx index 5c2fc06c6a9..19408bcb9a2 100644 --- a/packages/dnb-eufemia/src/extensions/forms/Form/Status/Status.tsx +++ b/packages/dnb-eufemia/src/extensions/forms/Form/Status/Status.tsx @@ -5,7 +5,12 @@ import DataContext from '../../DataContext/Context' import { useSharedState } from '../../../../shared/helpers/useSharedState' import useMounted from '../../../../shared/helpers/useMounted' import setStatus, { Status } from './setStatus' -import { Button, Flex, Section } from '../../../../components' +import { + Button, + Flex, + HeightAnimation, + Section, +} from '../../../../components' import { HeightAnimationAllProps } from '../../../../components/HeightAnimation' import { P } from '../../../../elements' import { useTranslation } from '../../hooks' @@ -37,7 +42,7 @@ function StatusContainer(props: Props) { const translations = useTranslation() - const { id } = useContext(DataContext) || {} + const { id, formState } = useContext(DataContext) || {} const { data } = useSharedState<{ activeStatus?: Status @@ -120,7 +125,13 @@ function StatusContainer(props: Props) { > {title ?? tr.title} -

{description ?? tr.description}

+ +

+ {formState === 'pending' + ? tr.retryingText + : description ?? tr.description} +

+