Skip to content

Commit c457184

Browse files
authored
Merge pull request #2214 from navikt/contact-step-page
Contact step page
2 parents 17c958b + ada03d6 commit c457184

19 files changed

+356
-90
lines changed

packages/nextjs/src/components/ContentMapper.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import { FormIntermediateStepPage } from './pages/form-intermediate-step-page/Fo
3030
import { CalculatorPage } from './pages/calculator-page/CalculatorPage';
3131
import { AlertInContextPage } from './pages/alert-in-context-page/AlertInContextPage';
3232
import { OfficePage } from './pages/office-page/OfficePage';
33+
import { ContactStepPage } from './pages/contact-step-page/ContactStepPage';
3334

3435
const contentToReactComponent: {
3536
[key in ContentType]?: React.FunctionComponent<ContentProps<key>>;
@@ -61,6 +62,7 @@ const contentToReactComponent: {
6162
[ContentType.Calculator]: CalculatorPage,
6263
[ContentType.UserTestsConfig]: UserTestsConfigPreviewPage,
6364
[ContentType.AlertInContext]: AlertInContextPage,
65+
[ContentType.ContactStepPage]: ContactStepPage,
6466

6567
[ContentType.AreaPage]: DynamicPage,
6668
[ContentType.FrontPage]: DynamicPage,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.headerContainer {
2+
display: flex;
3+
flex-direction: column;
4+
justify-content: center;
5+
6+
.textAboveTitle {
7+
color: var(--a-text-subtle);
8+
font-weight: 400;
9+
font-size: 20px;
10+
line-height: 28px;
11+
letter-spacing: -0.1%;
12+
}
13+
14+
.header {
15+
font-size: 40px;
16+
line-height: 52px;
17+
}
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { BodyShort, Heading } from '@navikt/ds-react';
2+
import { ProductDataMixin } from 'types/component-props/_mixins';
3+
import { ContentProps } from 'types/content-props/_content-common';
4+
import { classNames } from 'utils/classnames';
5+
import style from './HeaderWithParent.module.scss';
6+
7+
type Props = {
8+
contentProps: Pick<ContentProps, 'data'> & {
9+
data: Pick<ProductDataMixin, 'title' | 'illustration'>;
10+
};
11+
textAboveTitle?: string;
12+
className?: string;
13+
};
14+
15+
export const HeaderWithParent = ({ contentProps, textAboveTitle, className }: Props) => {
16+
const { data } = contentProps;
17+
18+
return (
19+
<div className={classNames(style.headerContainer, className)}>
20+
<BodyShort textColor="subtle" className={style.textAboveTitle}>
21+
{textAboveTitle}
22+
</BodyShort>
23+
<Heading level="1" size="large" spacing className={style.header}>
24+
{data.title}
25+
</Heading>
26+
</div>
27+
);
28+
};

packages/nextjs/src/components/_common/illustration/Illustration.module.scss

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
display: flex;
44
justify-content: center;
55
align-items: center;
6+
width: 100%;
7+
height: 100%;
8+
min-width: 4rem;
9+
min-height: 4rem;
610

711
&:empty {
812
display: none;

packages/nextjs/src/components/_common/lenkepanel-liste/LenkepanelListe.module.scss

-35
This file was deleted.

packages/nextjs/src/components/_common/lenkepanel-liste/LenkepanelListe.tsx

-54
This file was deleted.

packages/nextjs/src/components/_common/metatags/HeadWithMetatags.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ const getDescription = (content: ContentProps) => {
2323
return description.slice(0, DESCRIPTION_MAX_LENGTH);
2424
};
2525

26-
const contentTypesWithNoIndex = new Set([ContentType.Error, ContentType.FormIntermediateStepPage]);
26+
const contentTypesWithNoIndex = new Set([
27+
ContentType.Error,
28+
ContentType.FormIntermediateStepPage,
29+
ContentType.ContactStepPage,
30+
]);
2731

2832
const isNoIndex = (content: ContentProps) =>
2933
content.isPagePreview || contentTypesWithNoIndex.has(content.type) || content.data?.noindex;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
.contactStepPage {
2+
padding-bottom: 1rem;
3+
column-gap: 1.75rem;
4+
margin: 1.25rem auto 2.5rem;
5+
display: grid;
6+
grid-template-columns: 1fr 40rem 1fr;
7+
grid-template-areas:
8+
'pictogram header .'
9+
'. content .'
10+
'. backLink .';
11+
12+
@media only screen and (max-width: 1024px) {
13+
grid-template-columns: none;
14+
grid-template-areas:
15+
'. pictogram .'
16+
'. header .'
17+
'. content .'
18+
'. backLink .';
19+
}
20+
.pictogram {
21+
grid-area: pictogram;
22+
display: block;
23+
justify-self: end;
24+
width: 4.5rem;
25+
height: auto;
26+
position: relative;
27+
align-self: flex-start;
28+
29+
@media only screen and (max-width: 1024px) {
30+
width: 4rem;
31+
justify-self: start;
32+
}
33+
}
34+
.header {
35+
grid-area: header;
36+
}
37+
38+
.content {
39+
grid-area: content;
40+
41+
.linkPanels {
42+
display: flex;
43+
flex-direction: column;
44+
gap: 0.5rem;
45+
list-style-type: none;
46+
padding: 0;
47+
48+
.linkPanel {
49+
border-radius: 0.5rem;
50+
border: 1px solid var(--a-border-subtle);
51+
52+
& :global(.navds-link-panel__title) {
53+
color: var(--default-action-color);
54+
font-size: 1.25rem;
55+
}
56+
}
57+
}
58+
}
59+
60+
.backLink {
61+
grid-area: backLink;
62+
}
63+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
import React from 'react';
2+
import { Provider } from 'react-redux';
3+
import type { Decorator, Meta, StoryObj } from '@storybook/react';
4+
import { mockStore } from 'store/store';
5+
import { ContactStepPage } from './ContactStepPage';
6+
7+
const withStore: Decorator = (Story) => (
8+
<Provider store={mockStore}>
9+
<Story />
10+
</Provider>
11+
);
12+
13+
const meta = {
14+
component: ContactStepPage,
15+
decorators: [withStore],
16+
//Ikke en komplett side. Ikke sikkert vi skal sette opp hele sider i storybook.
17+
//Bør kanskje finne en bedre måte å gjøre dette på om vi skal prøve å ha hele sider i storybook.
18+
//Sjekk ut: https://storybook.js.org/docs/writing-stories/build-pages-with-storybook
19+
args: {
20+
_id: '4b4f44c8-d82c-4046-80e8-2b49ff9feca3',
21+
_name: 'skrivtiloss',
22+
_path: '/www.nav.no/tania/skrivtiloss',
23+
creator: 'user:system:su',
24+
modifier: 'user:system:su',
25+
createdTime: '2025-03-06T09:12:39.492046Z',
26+
modifiedTime: '2025-03-13T11:26:18.994311Z',
27+
owner: 'user:system:su',
28+
// @ts-ignore
29+
type: 'no.nav.navno:contact-step-page',
30+
displayName: 'Skriv til oss',
31+
hasChildren: true,
32+
language: 'no',
33+
valid: true,
34+
childOrder: 'modifiedtime DESC',
35+
data: {
36+
audience: {
37+
person: {},
38+
// @ts-ignore
39+
_selected: 'person',
40+
},
41+
steps: {
42+
nextStep: {
43+
_selected: 'internal',
44+
internal: {
45+
internalContent: '5f679435-e468-4196-aa4a-5c86be9438a0',
46+
},
47+
},
48+
label: 'Test',
49+
},
50+
customPath: '/test-kontaktside',
51+
title: 'Skriv til oss',
52+
textAboveTitle: 'Kontakt oss',
53+
ingress: 'yrdyr',
54+
html: '<p>Hva vil du gjøre?</p>\n',
55+
target: '4b4f44c8-d82c-4046-80e8-2b49ff9feca3',
56+
text: 'Skriv til oss om noe annet',
57+
link: {
58+
internal: {
59+
// @ts-ignore
60+
target: '419e1783-25af-4513-aebb-2cce0b6bd7da',
61+
text: 'Kontakt oss på en annen måte',
62+
},
63+
_selected: 'internal',
64+
},
65+
links: [
66+
{
67+
label: 'Melde fra om endringer i saken din',
68+
explanation:
69+
'Når du får støtte fra Nav, må du melde fra om endringer som kan ha betydning for saken din. Det kan for eksempel være endringer i inntekt, bosted, jobb- eller familiesituasjon, eller ferie og opphold i utlandet.',
70+
link: {
71+
internal: {
72+
internalContent: {
73+
// @ts-ignore
74+
createdTime: '2025-03-13T11:18:33.082857Z',
75+
displayName: '"Melde fra om endringer i saken din"',
76+
language: 'no',
77+
modifiedTime: '2025-03-13T11:23:51.173Z',
78+
publish: {
79+
first: '2025-03-13T11:24:01.903Z',
80+
from: '2025-03-13T11:24:01.903Z',
81+
},
82+
type: 'no.nav.navno:contact-step-page',
83+
_id: 'ad33a6f6-403b-4ba4-bd7e-04cc25a473f2',
84+
_path: '/privatperson/meldeifraomendringer',
85+
},
86+
},
87+
_selected: 'internal',
88+
},
89+
},
90+
{
91+
label: 'Få svar på spørsmål',
92+
explanation:
93+
'Du kan blant annet stille oss spørsmål om saken din, hvilke rettigheter du har, hvilke regler som gjelder og hvordan du går frem for å søke.',
94+
link: {
95+
internal: {
96+
internalContent: {
97+
// @ts-ignore
98+
createdTime: '2025-03-13T11:18:33.082857Z',
99+
displayName: 'Skriv til oss',
100+
language: 'no',
101+
modifiedTime: '2025-03-13T11:23:51.173Z',
102+
publish: {
103+
first: '2025-03-13T11:24:01.903Z',
104+
from: '2025-03-13T11:24:01.903Z',
105+
},
106+
type: 'no.nav.navno:contact-step-page',
107+
_id: '"4b4f44c8-d82c-4046-80e8-2b49ff9feca3"',
108+
_path: '/privatperson/velgpengestotteellertjeneste',
109+
},
110+
},
111+
_selected: 'internal',
112+
},
113+
},
114+
],
115+
},
116+
x: {
117+
'no-nav-navno': {
118+
redirectToLayer: {},
119+
virtualParent: {},
120+
previewOnly: {},
121+
searchOrder: {},
122+
},
123+
},
124+
// @ts-ignore
125+
page: {},
126+
attachments: {},
127+
publish: {
128+
from: '2025-03-11T09:40:07.350Z',
129+
first: '2025-03-11T09:40:07.350Z',
130+
},
131+
},
132+
} satisfies Meta<typeof ContactStepPage>;
133+
134+
export default meta;
135+
type Story = StoryObj<typeof meta>;
136+
137+
export const Default: Story = {};
138+
139+
export const English: Story = {
140+
args: {
141+
language: 'en',
142+
},
143+
};
144+
145+
export const EditorView: Story = {
146+
args: {
147+
editorView: 'edit',
148+
},
149+
};

0 commit comments

Comments
 (0)