Skip to content

Commit

Permalink
refaktor
Browse files Browse the repository at this point in the history
trekker komponenter ut i egne filer
  • Loading branch information
toresbe committed Dec 3, 2024
1 parent 2cf0416 commit ec61b83
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
8 changes: 2 additions & 6 deletions src/lib/hooks/data/useBegrunnelse.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {useBehandlingsId} from "../common/useBehandlingsId";
import {useConfigFeatureFlags} from "../../config";
import * as React from "react";
import {useEffect} from "react";
import {
Expand All @@ -15,8 +14,6 @@ import {logAmplitudeEvent} from "../../amplitude/Amplitude";
export const useBegrunnelse = () => {
const behandlingsId = useBehandlingsId();

// TODO: Avklare denne. Er det behov lenger?
const {begrunnelseNyTekst} = useConfigFeatureFlags();
const [isError, setIsError] = React.useState(false);
const queryClient = useQueryClient();
const {isPending, queryKey} = useHentBegrunnelse(behandlingsId);
Expand All @@ -31,7 +28,6 @@ export const useBegrunnelse = () => {
logAmplitudeEvent("begrunnelse fullført", {
hvaLengde: (Math.round((begrunnelse?.hvaSokesOm?.length ?? 0) / 20) - 1) * 20,
hvorforLengde: (Math.round((begrunnelse?.hvorforSoke?.length ?? 0) / 20) - 1) * 20,
begrunnelseNyTekst,
});

try {
Expand All @@ -45,8 +41,8 @@ export const useBegrunnelse = () => {
};

useEffect(() => {
logAmplitudeEvent("begrunnelse åpnet", {begrunnelseNyTekst}).then();
}, [begrunnelseNyTekst]);
logAmplitudeEvent("begrunnelse åpnet").then();
}, [true]);

return {get, put, isPending, isError};
};
1 change: 0 additions & 1 deletion src/sider/02-begrunnelse/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {begrunnelseSchema, FormValues, MAX_LEN_HVA, MAX_LEN_HVORFOR} from "./sch
export const Begrunnelse = () => {
const {get: defaultValues} = useBegrunnelse();
const {t} = useTranslation("skjema");
// TODO: Avklare denne. Er det behov lenger?
const featureFlagData = useContextFeatureToggles();
const isKategorierEnabled = featureFlagData?.["sosialhjelp.soknad.kategorier"] ?? false;
const {forsorgerplikt} = useForsorgerplikt();
Expand Down

0 comments on commit ec61b83

Please sign in to comment.