Skip to content

Commit 7034998

Browse files
committed
bruk InternalLinkMixin
1 parent 08e44d4 commit 7034998

File tree

2 files changed

+15
-19
lines changed

2 files changed

+15
-19
lines changed

packages/nextjs/src/components/pages/contact-step-page/ContactStepPage.module.scss

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
grid-template-areas:
99
'header'
1010
'content'
11-
'link';
11+
'backLink';
1212

1313
@media #{common.$mq-screen-tablet-and-desktop} {
1414
grid-template-columns: 1fr 40rem 1fr;
1515
grid-template-areas:
1616
'pictogram header .'
1717
'. content .'
18-
'. link .';
18+
'. backLink .';
1919
column-gap: var(--a-spacing-10);
2020
}
2121
.pictogram {
@@ -60,7 +60,7 @@
6060
}
6161
}
6262
}
63-
.link {
64-
grid-area: link;
63+
.backLink {
64+
grid-area: backLink;
6565
}
6666
}

packages/nextjs/src/components/pages/contact-step-page/ContactStepPage.tsx

+11-15
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { IllustrationStatic } from 'components/_common/illustration/static/Illus
66
import { PictogramsProps } from 'types/content-props/pictograms';
77
import { LenkeBase } from 'components/_common/lenke/lenkeBase/LenkeBase';
88
import { LenkeInline } from 'components/_common/lenke/lenkeInline/LenkeInline';
9-
import { LinkWithIngressMixin } from 'types/component-props/_mixins';
9+
import { InternalLinkMixin } from 'types/component-props/_mixins';
1010
import style from './ContactStepPage.module.scss';
1111

1212
export type ContactStepPageProps = ContentCommonProps & {
@@ -18,13 +18,8 @@ export type ContactStepPageProps = ContentCommonProps & {
1818
html: string;
1919
linkPanelsHeading: string;
2020
linkPanelsSubHeading: string;
21-
linkPanels: LinkWithIngressMixin[];
22-
link: {
23-
internal: {
24-
target: { _path: string };
25-
text: string;
26-
};
27-
};
21+
linkPanels: (InternalLinkMixin & { ingress?: string })[];
22+
backLink: InternalLinkMixin;
2823
};
2924
};
3025

@@ -38,7 +33,7 @@ export const ContactStepPage = (props: ContactStepPageProps) => {
3833
linkPanelsHeading,
3934
linkPanelsSubHeading,
4035
linkPanels,
41-
link,
36+
backLink,
4237
} = data;
4338

4439
return (
@@ -69,15 +64,16 @@ export const ContactStepPage = (props: ContactStepPageProps) => {
6964
<li key={index}>
7065
<LinkPanel
7166
as={LenkeBase}
72-
//TODO finn utav ekstern lenke
73-
href={linkPanel.link.internal.target._path}
67+
href={linkPanel.target._path}
7468
className={style.linkPanel}
7569
// TODO finn utav analytics
7670
// analyticsComponent={'mellomsteg'}
7771
// analyticsLinkGroup={currentStepData.stepsHeadline}
7872
// analyticsLabel={step.label}s
7973
>
80-
<LinkPanel.Title>{linkPanel.link.internal.text}</LinkPanel.Title>
74+
<LinkPanel.Title>
75+
{linkPanel.text ?? linkPanel.target.displayName}
76+
</LinkPanel.Title>
8177
{linkPanel.ingress && (
8278
<LinkPanel.Description>
8379
{linkPanel.ingress}
@@ -88,9 +84,9 @@ export const ContactStepPage = (props: ContactStepPageProps) => {
8884
))}
8985
</ul>
9086
</div>
91-
<div className={style.link}>
92-
<LenkeInline href={link.internal.target._path}>{link.internal.text}</LenkeInline>
93-
</div>
87+
<LenkeInline href={backLink.target._path} className={style.backLink}>
88+
{backLink.text ?? backLink.target.displayName}
89+
</LenkeInline>
9490
</div>
9591
);
9692
};

0 commit comments

Comments
 (0)