Skip to content

Commit 4513898

Browse files
authored
Merge pull request #1696 from navikt/fix-subsection-navigation-typerror
Fikser undefined typeerror for subSectionNavigation i fragmenter
2 parents d7875a7 + 3de6cb5 commit 4513898

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

src/components/layouts/section-with-header/SectionWithHeaderLayout.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export const SectionWithHeaderLayout = ({ pageProps, layoutProps }: Props) => {
3737

3838
const { title, anchorId, icon, border, toggleCopyButton } = config;
3939
const isEditorView = pageProps.editorView === 'edit';
40-
const { showSubsectionNavigation } = pageProps.data;
40+
const showSubsectionNavigation = pageProps.data?.showSubsectionNavigation;
4141

4242
const iconImgProps = icon?.icon;
4343

src/types/component-props/pages/page-with-side-menus.ts

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ export interface PageWithSideMenusProps extends LayoutCommonProps {
2525
leftMenuToggle: boolean;
2626
leftMenuSticky: boolean;
2727
showInternalNav: boolean;
28-
showSubsectionNavigation?: boolean;
2928
anchorLinks: AnchorLink[];
3029
rightMenuToggle: boolean;
3130
rightMenuSticky: boolean;

src/types/content-props/_content-common.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ type VersionSelectorProps = {
144144

145145
export type ContentCommonProps<Type extends ContentType = ContentType> = {
146146
type: Type;
147-
data: ContentCommonData;
147+
data?: ContentCommonData;
148148
originalType?: ContentType;
149149
children?: ContentCommonProps[];
150150
parent?: ContentCommonProps;

0 commit comments

Comments
 (0)