Skip to content

Commit 4d2c4f8

Browse files
committed
No request info button for partners with no books
1 parent 3a9e4a3 commit 4d2c4f8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/app/pages/partners/partner-details/partner-details.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,18 @@ function useRealTitles(books) {
3939

4040
// -- RESTORE this to use the new form
4141
function RequestInfoButton({infoText='Request info', partnerName}) {
42-
const {toggleForm} = usePartnerContext();
42+
const {toggleForm, books} = usePartnerContext();
43+
const validTitle = books.find((b) => b.length > 0); // Quirk: no books is an array of one empty string
4344

4445
function gotoForm() {
4546
analyticsEvents.requestInfo(partnerName);
4647
toggleForm();
4748
}
4849

50+
if (!validTitle) {
51+
return null;
52+
}
53+
4954
return (
5055
<section>
5156
<button

0 commit comments

Comments
 (0)