Skip to content

Commit fe8f131

Browse files
committed
Remove icons from side menu in lesemodus, fix andre barn duplication
1 parent 28d4194 commit fe8f131

File tree

5 files changed

+186
-142
lines changed

5 files changed

+186
-142
lines changed

src/barnebidrag/components/forms/samvær/Samvær.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ export const SamværBarn = ({ gjelderBarn }: { gjelderBarn: string }) => {
457457
<span>{DateToDDMMYYYYString(dateOrNull())}</span>
458458
</BodyShort>
459459
</div>
460-
{valideringsfeil?.harPeriodiseringsfeil && (
460+
{!lesemodus && valideringsfeil?.harPeriodiseringsfeil && (
461461
<div className="mb-4">
462462
<BehandlingAlert variant="warning">
463463
<Heading size="xsmall" level="6">

src/barnebidrag/components/forms/underholdskostnad/AndreBarn.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import StatefulAlert from "@common/components/StatefulAlert";
44
import text from "@common/constants/texts";
55
import { useBehandlingProvider } from "@common/context/BehandlingContext";
66
import { PlusIcon } from "@navikt/aksel-icons";
7-
import { Button, Heading } from "@navikt/ds-react";
7+
import { BodyShort, Button, Heading } from "@navikt/ds-react";
88
import { calculateAge } from "@utils/date-utils";
99
import React, { useState } from "react";
1010
import { useFieldArray, useFormContext, useWatch } from "react-hook-form";
@@ -109,6 +109,7 @@ export const AndreBarn = () => {
109109
</Button>
110110
)}
111111
{openForm && <AddBarnForm setOpenAddBarnForm={setOpenForm} onSave={onCreateBarn} />}
112+
{andreBarnFieldArray.length < 1 && <BodyShort>{text.description.ingenBarn}</BodyShort>}
112113
{andreBarnFieldArray.map((underhold, index) => {
113114
const underholdFieldName = `underholdskostnaderAndreBarn.${index}` as const;
114115
return (

src/barnebidrag/components/forms/underholdskostnad/Barnetilsyn.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ export const RolleInfoBox = ({
210210
};
211211

212212
export const Barnetilsyn = ({ index }: { index: number }) => {
213-
const { setSaveErrorState } = useBehandlingProvider();
213+
const { setSaveErrorState, lesemodus } = useBehandlingProvider();
214214
const { aktiveOpplysninger } = useGetOpplysningerBarnetilsyn();
215215
const { underholdskostnader, erBisysVedtak } = useGetBehandlingV2();
216216
const underholdFieldName = `underholdskostnaderMedIBehandling.${index}` as const;
@@ -269,7 +269,7 @@ export const Barnetilsyn = ({ index }: { index: number }) => {
269269
checked={underhold.harTilsynsordning || hasAtLeastOnePeriodOrActiveOpplysninger}
270270
onChange={onToggle}
271271
size="small"
272-
readOnly={hasAtLeastOnePeriodOrActiveOpplysninger}
272+
readOnly={lesemodus || hasAtLeastOnePeriodOrActiveOpplysninger}
273273
>
274274
{text.label.barnHarTilsysnsordning}
275275
</Switch>

0 commit comments

Comments
 (0)