Skip to content

Commit b32d508

Browse files
committed
ny komponent klar, men er fortsatt bug med at ikke alle elementer vises. testes
1 parent bace059 commit b32d508

File tree

3 files changed

+99
-13
lines changed

3 files changed

+99
-13
lines changed

src/components/_common/linkpanel/LinkPanelNavnoSimple/LinkPanelNavnoSimple.tsx

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
import React from 'react';
2-
import { Heading } from '@navikt/ds-react';
32
import { classNames } from 'utils/classnames';
43
import { LenkeBase } from 'components/_common/lenke/lenkeBase/LenkeBase';
54

65
import style from './LinkPanelNavnoSimple.module.scss';
76

8-
type DsHeadingSize = React.ComponentProps<typeof Heading>['size'];
9-
107
type Props = {
118
href: string;
129
analyticsLinkGroup?: string;
1310
icon?: React.ReactNode;
1411
children: React.ReactNode;
12+
iconClassname?: string;
1513
} & React.ComponentProps<typeof LenkeBase>;
1614

1715
// This component is meant to be used with "simple" content, ie just a line of text
@@ -23,6 +21,7 @@ export const LinkPanelNavnoSimple = ({
2321
icon,
2422
children,
2523
className,
24+
iconClassname,
2625
...rest
2726
}: Props) => {
2827
return (
@@ -33,7 +32,7 @@ export const LinkPanelNavnoSimple = ({
3332
analyticsComponent={'Lenkepanel navno enkel'}
3433
analyticsLinkGroup={analyticsLinkGroup}
3534
>
36-
{icon && <div className={style.icon}>{icon}</div>}
35+
{icon && <div className={classNames(iconClassname, style.icon)}>{icon}</div>}
3736
<div className={classNames('navds-heading', 'navds-heading--medium')}>
3837
<span className={style.text}>{children}</span>
3938
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
@use 'common' as common;
2+
3+
.personShortcuts {
4+
@include common.full-width-mixin();
5+
padding-top: 2.25rem;
6+
padding-bottom: 2.25rem;
7+
background-color: var(--bg-color, var(--a-red-50));
8+
9+
@media #{common.$mq-screen-mobile} {
10+
padding-top: 2rem;
11+
padding-bottom: 1.75rem;
12+
}
13+
14+
.header {
15+
margin-bottom: 0.5rem;
16+
}
17+
18+
.list {
19+
display: grid;
20+
grid-template-columns: auto auto;
21+
list-style: none;
22+
padding: 0;
23+
column-gap: 2rem;
24+
25+
@media #{common.$mq-screen-mobile} {
26+
grid-template-columns: auto;
27+
}
28+
29+
.listItem {
30+
width: 100%;
31+
display: flex;
32+
padding: 0.75rem 0;
33+
border-top: 1px solid var(--Global-Gray-300, #cbcfd5);
34+
35+
&:nth-child(1),
36+
&:nth-child(2) {
37+
border-top: none;
38+
}
39+
40+
@media #{common.$mq-screen-mobile} {
41+
&:nth-child(2) {
42+
border-top: 1px solid var(--Global-Gray-300, #cbcfd5);
43+
}
44+
}
45+
46+
a {
47+
padding: 0;
48+
gap: 0.5rem;
49+
}
50+
}
51+
52+
.link {
53+
.icon {
54+
width: 2.25rem;
55+
height: 100%;
56+
color: black;
57+
display: flex;
58+
margin: 4px;
59+
align-items: flex-start;
60+
}
61+
}
62+
}
63+
}

src/components/parts/frontpage-person-shortcuts/FrontpagePersonShortcutsPart.tsx

+33-9
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
11
import React from 'react';
2+
import {
3+
BriefcaseClockIcon,
4+
CalendarIcon,
5+
FolderFileIcon,
6+
TasklistStartIcon,
7+
WalletIcon,
8+
} from '@navikt/aksel-icons';
29
import { Header } from 'components/_common/headers/Header';
310
import { EditorHelp } from 'components/_editor-only/editor-help/EditorHelp';
411
import { LinkPanelNavnoSimple } from 'components/_common/linkpanel/LinkPanelNavnoSimple/LinkPanelNavnoSimple';
512
import { PartComponentProps, PartType } from 'types/component-props/parts';
6-
import { Icon } from 'types/content-props/pictograms';
13+
import style from './FrontpagePersonShortcutsPart.module.scss';
714

815
type Shortcut = {
916
target: {
1017
_path: string;
1118
displayName: string;
1219
data: {
1320
url?: string;
14-
icon?: Icon;
1521
title?: string;
1622
};
1723
};
1824
customTitle: string;
19-
customIcon?: Icon;
2025
};
2126

2227
export type PartConfigFrontpagePersonShortcuts = {
@@ -34,13 +39,13 @@ export const FrontpagePersonShortcutsPart = ({
3439
}
3540

3641
return (
37-
<div>
42+
<div className={style.personShortcuts}>
3843
{sectionTitle && (
39-
<Header size="large" level="2">
44+
<Header size="large" level="2" className={style.header}>
4045
{sectionTitle}
4146
</Header>
4247
)}
43-
<ul>
48+
<ul className={style.list}>
4449
{shortcuts.map((item) => {
4550
const { target, customTitle } = item;
4651
if (!target?.data) {
@@ -49,14 +54,33 @@ export const FrontpagePersonShortcutsPart = ({
4954

5055
const href = target.data.url || target._path;
5156
const title = customTitle || target.data.title || target.displayName;
52-
// const illustration = customIllustration || target.data.illustration;
5357

5458
return (
55-
<li key={title}>
59+
<li key={title} className={style.listItem}>
5660
<LinkPanelNavnoSimple
5761
href={href}
5862
analyticsLinkGroup={title}
59-
// icon={<IllustrationStatic illustration={illustration} />}
63+
className={style.link}
64+
//Hardkoder ikonene istedenfor å legge de inn i Enonic da det
65+
//kun er her vi bruker ikoner
66+
icon={
67+
<>
68+
{title === 'Saksbehandlingstider' && (
69+
<BriefcaseClockIcon title="Koffert med klokke" />
70+
)}
71+
{title === 'Utbetalingsdatoer' && (
72+
<CalendarIcon title="Kalender" />
73+
)}
74+
{title === 'Satser' && <WalletIcon title="Lommebok" />}
75+
{title === 'Søknad og skjema' && (
76+
<TasklistStartIcon title="Oppgaveliste start" />
77+
)}
78+
{title === 'Ettersendelse' && (
79+
<FolderFileIcon title="Mappefil" />
80+
)}
81+
</>
82+
}
83+
iconClassname={style.icon}
6084
>
6185
{title}
6286
</LinkPanelNavnoSimple>

0 commit comments

Comments
 (0)