Skip to content

Commit

Permalink
feat(j-s): Show district court abbreviation on mobile (#17075)
Browse files Browse the repository at this point in the history
* Add court abbr to getAllCases call

* Refactoring

* Refactoring

* Refactoring

* Refactoring

* Add abbr to mobile as well

* >merge

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
2 people authored and thorhildurt committed Dec 11, 2024
1 parent b4d6789 commit 595e2eb
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { AnimatePresence } from 'framer-motion'
import { Box, FocusableBox, Text } from '@island.is/island-ui/core'
import {
displayFirstPlusRemaining,
districtCourtAbbreviation,
formatDOB,
} from '@island.is/judicial-system/formatters'
import { tables } from '@island.is/judicial-system-web/messages'
Expand Down Expand Up @@ -69,6 +70,7 @@ const MobileCase: FC<PropsWithChildren<Props>> = ({
isLoading = false,
}) => {
const { formatMessage } = useIntl()
const courtAbbreviation = districtCourtAbbreviation(theCase.court?.name)

return (
<CategoryCard
Expand All @@ -91,7 +93,12 @@ const MobileCase: FC<PropsWithChildren<Props>> = ({
<Text title={theCase.policeCaseNumbers?.join(', ')}>
{displayFirstPlusRemaining(theCase.policeCaseNumbers)}
</Text>
{theCase.courtCaseNumber && <Text>{theCase.courtCaseNumber}</Text>}

{theCase.courtCaseNumber && (
<Text>{`${courtAbbreviation ? `${courtAbbreviation}: ` : ''}${
theCase.courtCaseNumber
}`}</Text>
)}
<br />
{theCase.defendants && theCase.defendants.length > 0 && (
<>
Expand Down

0 comments on commit 595e2eb

Please sign in to comment.