-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #427 from NYPL/SCC-4427/vqa-round-2-fixes
SCC-4427 - VQA Round 2 Fixes
- Loading branch information
Showing
11 changed files
with
151 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { Button } from "@nypl/design-system-react-components" | ||
import { useContext, type ReactNode } from "react" | ||
|
||
import type Item from "../../models/Item" | ||
import type { ItemMetadata } from "../../types/itemTypes" | ||
import { FeedbackContext } from "../../context/FeedbackContext" | ||
|
||
interface HoldContactButtonProps { | ||
item: Item | ||
children: ReactNode | ||
} | ||
|
||
export const HoldContactButton = ({ | ||
item, | ||
children, | ||
}: HoldContactButtonProps) => { | ||
const { onOpen, setItemMetadata } = useContext(FeedbackContext) | ||
|
||
const onContact = (metadata: ItemMetadata) => { | ||
setItemMetadata(metadata) | ||
onOpen() | ||
} | ||
|
||
return ( | ||
<Button | ||
id="hold-contact" | ||
onClick={() => | ||
onContact({ | ||
id: item.id, | ||
barcode: item.barcode, | ||
callNumber: item.callNumber, | ||
bibId: item.bibId, | ||
notificationText: `Request failed for call number ${item.callNumber}`, | ||
}) | ||
} | ||
buttonType="link" | ||
// TODO: Ask DS team to make button link variant match the default link styles | ||
sx={{ | ||
display: "inline", | ||
fontWeight: "inherit", | ||
fontSize: "inherit", | ||
p: 0, | ||
height: "auto", | ||
textAlign: "left", | ||
minHeight: "auto", | ||
textDecorationStyle: "dotted", | ||
textDecorationThickness: "1px", | ||
textUnderlineOffset: "2px", | ||
}} | ||
> | ||
{children} | ||
</Button> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.