Skip to content

Commit

Permalink
Don't show Get the book menu on Coming soon books
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyEJohnson committed Oct 23, 2023
1 parent 667a45e commit beadd83
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/app/components/book-tile/book-tile.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ function useBookInfo(id) {
}

export default function BookTile({ book: [book] }) {
const { coverUrl, title, slug } = book;
const { coverUrl, title, slug, bookState } = book;
const info = useBookInfo(book.id);
const comingSoon = info?.book_state === 'coming_soon';
const assignable = info?.assignable_book === true;
Expand All @@ -165,7 +165,13 @@ export default function BookTile({ book: [book] }) {
<div className="text-block">
<a href={`/details/${slug}`}>{title}</a>
</div>
<GetTheBookDropdown bookInfo={book} />
{
bookState === 'coming_soon' ?
<div className='navmenu'>
<button type='button' disabled>Coming soon</button>
</div> :
<GetTheBookDropdown bookInfo={book} />
}
</div>
);
}
5 changes: 5 additions & 0 deletions src/app/components/book-tile/book-tile.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@
justify-content: space-between;
padding: 0 $normal-margin;
width: 100%;

&[disabled] {
font-style: italic;
pointer-events: none;
}
}

[role="menu"] {
Expand Down

0 comments on commit beadd83

Please sign in to comment.