Skip to content

Commit

Permalink
Fix disabled steps in uinnlogget (or innlogget post) stepper
Browse files Browse the repository at this point in the history
  • Loading branch information
eriksson-daniel committed Aug 30, 2024
1 parent d9ffb86 commit aa6133a
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions frontend/src/components/case/common/post/post-form-container.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { skipToken } from '@reduxjs/toolkit/query';
import { useInnsendingsytelseName } from '@app/hooks/use-innsendingsytelser';
import { usePageInit } from '@app/hooks/use-page-init';
import { useIsAuthenticated } from '@app/hooks/use-user';
import { Innsendingsytelse } from '@app/innsendingsytelser/innsendingsytelser';
import { FormTitleContainer } from '@app/routes/form-title-container';
import { ContentContainer } from '@app/styled-components/content-container';
Expand All @@ -16,7 +14,6 @@ interface Props {
steps: string[];
title_fragment: string;
page_title: string;
loginRequired?: boolean;
}

export const PostFormContainer = ({
Expand All @@ -27,28 +24,25 @@ export const PostFormContainer = ({
steps,
title_fragment,
page_title,
loginRequired = false,
}: Props) => {
const [undertittel] = useInnsendingsytelseName(innsendingsytelse);
const { data: isAuthenticated } = useIsAuthenticated(loginRequired ? undefined : skipToken);

usePageInit(`${steps[activeStep - 1] ?? ''} \u2013 ${title_fragment}`);

const [label1, label2, label3] = steps;

const stepperSteps: StepProps[] = [
{
disabled: isAuthenticated === false,
to: '../begrunnelse',
label: label1,
},
{
disabled: !isValid || isAuthenticated === false,
disabled: !isValid,
to: '../oppsummering',
label: label2,
},
{
disabled: !isValid || isAuthenticated === false,
disabled: !isValid,
to: '../innsending',
label: label3,
},
Expand Down

0 comments on commit aa6133a

Please sign in to comment.