Skip to content

Commit 18833af

Browse files
committedFeb 13, 2024·
Hjelpetekst for category filter. Fikser bug med cookie state for categories
1 parent 9ef57ea commit 18833af

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed
 

‎src/components/left-section/search/search-input/search-settings/SearchSettings.module.css

+6
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,9 @@
5858
display: flex;
5959
align-items: center;
6060
}
61+
62+
.topRight {
63+
display: flex;
64+
align-items: center;
65+
gap: 0.25rem;
66+
}

‎src/components/left-section/search/search-input/search-settings/SearchSettings.tsx

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { Button, Label, Radio, RadioGroup } from '@navikt/ds-react';
2+
import { Button, HelpText, Label, Radio, RadioGroup } from '@navikt/ds-react';
33
import { ChevronDownIcon, XMarkIcon } from '@navikt/aksel-icons';
44
import { classNames } from '../../../../../utils/classNames';
55
import { useSearchState } from '../../../../../context/search-state/useSearchState';
@@ -21,7 +21,14 @@ export const SearchSettings = () => {
2121
<div className={style.container}>
2222
<div className={style.topRow}>
2323
<Label size={'small'}>{'Søk'}</Label>
24-
<div>
24+
<div className={style.topRight}>
25+
{searchSettingsIsOpen && (
26+
<HelpText title={'Tips!'}>
27+
{
28+
'Du kan avgrense søket til enkelte hovedkategorier med sjekkboksene til venstre i menyen.'
29+
}
30+
</HelpText>
31+
)}
2532
{isCustom && (
2633
<Button
2734
size={'xsmall'}

‎src/context/search-state/search-settings-cookies.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@ export const getInitialSearchParams = (basePath: string): ContentSearchParams =>
99

1010
if (cookieValue) {
1111
try {
12-
const parsed = JSON.parse(cookieValue);
13-
1412
return {
15-
...parsed,
13+
...JSON.parse(cookieValue),
1614
...initialSearchParams,
1715
};
1816
} catch (e) {

0 commit comments

Comments
 (0)
Please sign in to comment.