diff --git a/apps/omstillingsstoenad-ui/src/components/soknad/7-barnepensjon/BarnInfokort.tsx b/apps/omstillingsstoenad-ui/src/components/soknad/7-barnepensjon/BarnInfokort.tsx index e82fb49e2..3c59cf74a 100644 --- a/apps/omstillingsstoenad-ui/src/components/soknad/7-barnepensjon/BarnInfokort.tsx +++ b/apps/omstillingsstoenad-ui/src/components/soknad/7-barnepensjon/BarnInfokort.tsx @@ -3,7 +3,7 @@ import ikon from '../../../assets/ikoner/barn1.svg' import React, { memo } from 'react' import { useTranslation } from 'react-i18next' import { IValg } from '../../../typer/Spoersmaal' -import { BodyShort, Heading, BodyLong, Link, Tag } from '@navikt/ds-react' +import { BodyShort, Heading, Tag, Button, VStack } from '@navikt/ds-react' import { DeleteFilled, EditFilled } from '@navikt/ds-icons' import { Infokort, InfokortHeader, InfokortInformasjonsboks } from '../../felles/StyledComponents' import styled from 'styled-components' @@ -14,17 +14,6 @@ const InfokortInformasjonsElement = styled.div` margin: 10px 0 10px 0; ` -const InfokortFooter = styled.div` - margin-bottom: 1rem; -` - -const InfokortFooterItem = styled(Link)` - display: flex; - justify-content: center; - flex-grow: 1; - text-align: center; -` - interface Props { barn: IBarn index: number @@ -85,28 +74,16 @@ const BarnInfokort = memo(({ barn, index, fjern, setAktivBarnIndex }: Props) => )} - - - - { - e.preventDefault() - setAktivBarnIndex() - }} - > - - {t('knapp.endre')} - - - - fjern(index)}> - - {t('knapp.fjernFraSoeknad')} - - - + + + + + ) }) diff --git a/apps/omstillingsstoenad-ui/src/components/soknad/7-barnepensjon/LeggTilBarnSkjema.tsx b/apps/omstillingsstoenad-ui/src/components/soknad/7-barnepensjon/LeggTilBarnSkjema.tsx index a0e141e7d..77c507857 100644 --- a/apps/omstillingsstoenad-ui/src/components/soknad/7-barnepensjon/LeggTilBarnSkjema.tsx +++ b/apps/omstillingsstoenad-ui/src/components/soknad/7-barnepensjon/LeggTilBarnSkjema.tsx @@ -108,6 +108,8 @@ const LeggTilBarnSkjema = ({ avbryt, lagre, barn, fnrRegistrerteBarn }: Props) = const { state: bruker } = useBrukerContext() const { state: soeknad } = useSoknadContext() + const endrerBarn = !!barn?.fornavn?.length + const methods = useForm({ defaultValues: { ...barn, @@ -502,7 +504,7 @@ const LeggTilBarnSkjema = ({ avbryt, lagre, barn, fnrRegistrerteBarn }: Props) = onClick={handleSubmit(leggTilOgLukk)} style={{ minWidth: '80px' }} > - {t('knapp.leggTil')} + {endrerBarn ? t('knapp.lagreEndring') : t('knapp.leggTil')} diff --git a/apps/omstillingsstoenad-ui/src/components/soknad/7-barnepensjon/__snapshots__/OpplysningerOmBarn.test.jsx.snap b/apps/omstillingsstoenad-ui/src/components/soknad/7-barnepensjon/__snapshots__/OpplysningerOmBarn.test.jsx.snap index c108e450c..255d2daab 100644 --- a/apps/omstillingsstoenad-ui/src/components/soknad/7-barnepensjon/__snapshots__/OpplysningerOmBarn.test.jsx.snap +++ b/apps/omstillingsstoenad-ui/src/components/soknad/7-barnepensjon/__snapshots__/OpplysningerOmBarn.test.jsx.snap @@ -117,7 +117,7 @@ exports[`Opplysninger om barn > Snapshot 1`] = ` class="sc-blHHSb hqrzOP" >
Snapshot 1`] = ` class="sc-ivxoEo jSWAwx" >