Skip to content

Commit

Permalink
Legger til et banner på stegene som vi bruker i behandlingsflyten
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasrognes committed Sep 10, 2024
1 parent 1ab9ae8 commit a96a500
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
6 changes: 6 additions & 0 deletions components/SoknadFormWrapper/SoknadFormWrapper.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,9 @@
height: 50px;
align-self: center;
}

.banner {
padding: 0.75rem;
border-radius: 10px;
background-color: var(--a-data-surface-5-subtle);
}
15 changes: 14 additions & 1 deletion components/SoknadFormWrapper/SoknadFormWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import React, { useState } from 'react';
import { Button, Detail } from '@navikt/ds-react';
import { Button, Detail, Heading } from '@navikt/ds-react';
import * as classes from './SoknadFormWrapper.module.css';
import { useAppStateContext } from 'context/appStateContext';
import { FormErrorSummary, SøknadValidationError } from 'components/schema/FormErrorSummary';
import { useIntl } from 'react-intl';
import LagreModal from './LagreModal';
import SlettModal from './SlettModal';
import { isDev, isMock } from 'utils/environments';
import { useStepWizard } from 'hooks/StepWizardHook';

interface Props {
children: React.ReactNode;
Expand All @@ -32,6 +34,12 @@ const SøknadFormWrapper = (props: Props) => {
const [visLagreModal, setVisLagreModal] = useState<boolean>(false);
const [visAvbrytModal, setVisAvbrytModal] = useState<boolean>(false);

const { currentStep } = useStepWizard();

const stegSomBrukesIKelvin: string[] = ['BARNETILLEGG', 'YRKESSKADE', 'STUDENT'];
const skalViseBannerForOmStegBrukesIKelvin =
(isMock() || isDev()) && stegSomBrukesIKelvin.includes(currentStep.name);

return (
<>
<form
Expand All @@ -41,6 +49,11 @@ const SøknadFormWrapper = (props: Props) => {
}}
className={`${classes?.formContent} ${className}`}
>
{skalViseBannerForOmStegBrukesIKelvin && (
<div className={classes.banner}>
<Heading size={'small'}>Dette steget er koblet til Kelvin</Heading>
</div>
)}
{errors && <FormErrorSummary errors={errors} data-testid={'error-summary'} />}
{children}
<div className={classes?.fourButtonWrapper}>
Expand Down

0 comments on commit a96a500

Please sign in to comment.