Skip to content

Commit 0d68c73

Browse files
committed
init
1 parent a9d7029 commit 0d68c73

File tree

4 files changed

+125
-0
lines changed

4 files changed

+125
-0
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,38 @@
1+
import { BodyShort, Heading } from '@navikt/ds-react';
2+
import { Illustration } from 'components/_common/illustration/Illustration';
3+
import { ProductDataMixin } from 'types/component-props/_mixins';
4+
import { ContentProps } from 'types/content-props/_content-common';
5+
6+
// type Props = {
7+
// pageProps: Pick<ContentProps, 'type'> & {
8+
// data: Pick<ProductDataMixin, 'title' | 'illustration' | 'textAboveTitle'>; // data: Pick<ProductDataMixin, 'title'>;
9+
// };
10+
// };
11+
12+
type Props = {
13+
data: Pick<
14+
ProductDataMixin,
15+
'title' | 'illustration'
16+
>;
17+
textAboveTitle?: string;
18+
};
19+
20+
export const ContactPageHeader = (props: Props) => {
21+
// const { textAboveTitle } = contentProps;
22+
const { title, illustration } = props.data;
23+
24+
//const { pageProps } = props;
25+
//const { textAboveTitle, title, illustration } = pageProps.data;
26+
27+
28+
29+
return (
30+
<div>
31+
<Illustration illustration={illustration} />
32+
<BodyShort textColor="subtle">{props.textAboveTitle}</BodyShort>
33+
<Heading level="1" size="large" spacing>
34+
{title}
35+
</Heading>
36+
</div>
37+
);
38+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
import React from 'react';
2+
import { ContentCommonProps, ContentType } from '../../../types/content-props/_content-common';
3+
import { PictogramsProps } from '../../../types/content-props/pictograms';
4+
import { ContactPageHeader } from '../../_common/headers/contactPageHeader/ContactPageHeader';
5+
import { ParsedHtml } from '../../_common/parsedHtml/ParsedHtml';
6+
7+
export type ContactStepPageProps = ContentCommonProps & {
8+
type: ContentType.ContactStepPage;
9+
data: {
10+
title: string;
11+
illustration: PictogramsProps;
12+
textAboveTitle?: string;
13+
html: string;
14+
};
15+
};
16+
17+
export const ContactStepPage = (props: ContactStepPageProps) => {
18+
const { data, type } = props;
19+
const { title, illustration, textAboveTitle, html } = data;
20+
21+
return (
22+
<div>
23+
<ContactPageHeader
24+
pageProps={{
25+
type,
26+
data: {
27+
title,
28+
illustration,
29+
textAboveTitle,
30+
},
31+
}}
32+
/>
33+
<ParsedHtml htmlProps={html} />
34+
35+
{/* <ul>
36+
{currentStepData.steps.map((step) => (
37+
<li key={step.label}>
38+
<FormIntermediateStepLink
39+
{...step}
40+
analyticsComponent={'mellomsteg'}
41+
analyticsLinkGroup={currentStepData.stepsHeadline}
42+
analyticsLabel={step.label}
43+
/>
44+
</li>
45+
))}
46+
</ul> */}
47+
48+
{/* <ul className={style.stepList}>*/}
49+
{/* {currentStepData.steps.map((step) => (*/}
50+
{/* <li key={step.label} className={style.stepItem}>*/}
51+
{/* <FormIntermediateStepLink*/}
52+
{/* {...step}*/}
53+
{/* className={style.stepAction}*/}
54+
{/* analyticsComponent={'mellomsteg'}*/}
55+
{/* analyticsLinkGroup={currentStepData.stepsHeadline}*/}
56+
{/* analyticsLabel={step.label}*/}
57+
{/* />*/}
58+
{/* </li>*/}
59+
{/* ))}*/}
60+
{/* </ul>*/}
61+
{/* </div>*/}
62+
{/* {backUrl && (*/}
63+
{/* <div className={style.buttonGroup}>*/}
64+
{/* <Button*/}
65+
{/* href={backUrl}*/}
66+
{/* shallow={true}*/}
67+
{/* as={LenkeBase}*/}
68+
{/* variant={'tertiary'}*/}
69+
{/* className={style.backButton}*/}
70+
{/* analyticsComponent={'mellomsteg'}*/}
71+
{/* analyticsLinkGroup={currentStepData.stepsHeadline}*/}
72+
{/* analyticsLabel={'Tilbake'}*/}
73+
{/* >*/}
74+
{/* {getTranslations('back')}*/}
75+
{/* </Button>*/}
76+
{/* </div>*/}
77+
{/* )}*/}
78+
{/*</div>*/}
79+
</div>
80+
);
81+
};

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

+4
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ import { AreaPageProps, FrontPageNestedProps, FrontPageProps } from './index-pag
4444
import { FormDetailsPageProps } from './form-details';
4545
import { FormIntermediateStepPageProps } from './form-intermediate-step';
4646
import { FallbackPageProps } from './fallback-page-props';
47+
import { ContactStepPageProps } from '../../components/pages/contact-step-page/ContactStepPage';
4748

4849
export enum ContentType {
4950
Error = 'error',
@@ -93,6 +94,7 @@ export enum ContentType {
9394
AlertInContext = 'no.nav.navno:alert-in-context',
9495
OfficePage = 'no.nav.navno:office-page',
9596
FallbackPage = 'no.nav.navno:fallback-page',
97+
ContactStepPage = 'no.nav.navno:contact-step-page',
9698
}
9799

98100
export const innholdsTypeMap: Record<ContentType, string> = {
@@ -137,6 +139,7 @@ export const innholdsTypeMap: Record<ContentType, string> = {
137139
[ContentType.Video]: 'Qbrick Video',
138140
[ContentType.AlertInContext]: 'Varsel i kontekst',
139141
[ContentType.OfficePage]: 'Kontorside (gammel)',
142+
[ContentType.ContactStepPage]: 'Mellomsteg for kontaktside',
140143

141144
[ContentType.Error]: `Ugyldig type: [${ContentType.Error}]`,
142145
[ContentType.Site]: `Ugyldig type: [${ContentType.Site}]`,
@@ -209,6 +212,7 @@ type SpecificContentProps =
209212
| SiteProps
210213
| TemplateProps
211214
| ContentListProps
215+
| ContactStepPageProps
212216
| ErrorProps
213217
| ExternalLinkProps
214218
| InternalLinkProps

0 commit comments

Comments
 (0)