Skip to content

Commit

Permalink
Pass list children as props in detail element
Browse files Browse the repository at this point in the history
  • Loading branch information
dgcohen committed Dec 11, 2024
1 parent 52a1e65 commit 5ba879f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
12 changes: 9 additions & 3 deletions src/components/BibPage/BibDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import type {
} from "../../types/bibDetailsTypes"
import { rtlOrLtr, isItTheLastElement } from "../../utils/bibUtils"
import type { ReactNode } from "react"
import { child } from "winston"

interface BibDetailsProps {
details: AnyBibDetail[]
Expand Down Expand Up @@ -60,9 +61,14 @@ const DetailElement = (label: string, listChildren: ReactNode[]) => {
<>
<dt>{label}</dt>
<dd>
<List noStyling data-testid={kebabCase(label)} type="ol">
{listChildren}
</List>
<List
noStyling
data-testid={kebabCase(label)}
type="ol"
listItems={listChildren.map((listElement) => (
<>{listElement}</>
))}
/>
</dd>
</>
)
Expand Down
8 changes: 2 additions & 6 deletions src/components/HoldPages/HoldConfirmationItemDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,15 @@ const HoldConfirmationItemDetails = ({
mb="l"
mt={0}
>
{pickupLocationLabel ? (
{pickupLocationLabel && (
<PlainTextElement
label="Pickup location"
value={[pickupLocationLabel]}
/>
) : (
<></>
)}
<PlainTextElement label="Call number" value={[item.callNumber]} />
{item.barcode ? (
{item.barcode && (
<PlainTextElement label="Barcode" value={[item.barcode]} />
) : (
<></>
)}
</List>
)
Expand Down
4 changes: 1 addition & 3 deletions src/components/HoldPages/HoldRequestItemDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@ const HoldRequestItemDetails = ({ item }: HoldRequestItemDetailsProps) => {
link="internal"
/>
<PlainTextElement label="Call number" value={[item.callNumber]} />
{item.volume ? (
{item.volume && (
<PlainTextElement label="Volume/date" value={[item.volume]} />
) : (
<></>
)}
</List>
)
Expand Down

0 comments on commit 5ba879f

Please sign in to comment.