Skip to content

Commit

Permalink
Remove optional chaining in DRB and add underline overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
dgcohen committed Oct 26, 2023
1 parent 5751417 commit 13a5408
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
22 changes: 11 additions & 11 deletions src/components/DRB/DRBCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,9 @@ interface DRBCardProps {
*/
const DRBCard = ({ drbResult }: DRBCardProps) => {
return (
<Card
backgroundColor="var(--nypl-colors-ui-bg-default)"
sx={{
padding: "var(--nypl-space-xs)",
}}
>
<Card backgroundColor="var(--nypl-colors-ui-bg-default)" p="xs">
<CardContent>
<DSLink href={drbResult.url} target="_blank">
<DSLink href={drbResult.url} target="_blank" isUnderlined={false}>
<Text size="body2">{drbResult.title}</Text>
</DSLink>

Expand All @@ -44,19 +39,24 @@ const DRBCard = ({ drbResult }: DRBCardProps) => {
</Text>
)}

{drbResult?.readOnlineUrl && (
{drbResult.readOnlineUrl && (
<DSLink
href={drbResult.readOnlineUrl}
target="_blank"
type="buttonPrimary"
mb={drbResult?.downloadLink ? "s" : ""}
mb={drbResult.downloadLink ? "s" : ""}
isUnderlined={false}
>
Read Online
</DSLink>
)}

{drbResult?.downloadLink && (
<DSLink href={drbResult.downloadLink.url} target="_blank">
{drbResult.downloadLink && (
<DSLink
href={drbResult.downloadLink.url}
target="_blank"
isUnderlined={false}
>
<Text
size="body2"
sx={{ display: "flex", alignItems: "center" }}
Expand Down
6 changes: 4 additions & 2 deletions src/components/SearchResult/SearchResult.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ const SearchResult = ({ bib }: SearchResultProps) => {
paddingBottom: "m",
}}
>
<CardHeading level="h3">
<DSLink href={`${PATHS.BIB}/${bib.id}`}>{bib.title}</DSLink>
<CardHeading level="h3" size="heading4">
<DSLink href={`${PATHS.BIB}/${bib.id}`} isUnderlined={false}>
{bib.title}
</DSLink>
</CardHeading>
<CardContent>
<Box sx={{ p: { display: "inline", marginRight: "s" } }}>
Expand Down

0 comments on commit 13a5408

Please sign in to comment.