Skip to content

Commit

Permalink
feat(ojoi-web): Categories page (#16762)
Browse files Browse the repository at this point in the history
* Moved adverts query to server side, added ui for main categories on the front page.

* Updated client, added sub categories.

* Set tag url to search

* Malaflokkar page is now ready and functioning properly.

* Removed console logs

* Fixed PR comments.

* Moved nested href property to a calculated value

* Sorted imports

* Simplified logic and updated from Link to LinkV2

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
jonbjarnio and kodiakhq[bot] authored Nov 11, 2024
1 parent 1faaeec commit 6895b8f
Show file tree
Hide file tree
Showing 8 changed files with 437 additions and 295 deletions.
28 changes: 28 additions & 0 deletions apps/web/components/OfficialJournalOfIceland/OJOIUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,31 @@ export const formatDate = (date?: string, df = 'dd.MM.yyyy') => {
throw new Error(`Could not format date: ${date}`)
}
}

export const getStringArrayFromQueryString = (
value?: string | string[],
): string[] => {
if (!value) {
return []
}

if (Array.isArray(value)) {
return value
}

return value.split(',')
}

export const getStringFromQueryString = (
value?: string | string[],
): string | undefined => {
if (!value) {
return undefined
}

if (Array.isArray(value)) {
return value[0]
}

return value
}
Loading

0 comments on commit 6895b8f

Please sign in to comment.