-
Notifications
You must be signed in to change notification settings - Fork 5
Add audiobook purchase button to book details pages #2813
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This adds a new audiobook purchase option box that appears above the Individual and Bookstore print options when an audiobook link is configured in the CMS. Changes: - Import faVolumeUp icon for audiobook representation - Fetch audiobook_link from CMS API - Add audiobook entry to purchase options (appears first when present) - Update button styling to accommodate 3 boxes in grid layout - Add translations for "Audiobook" and "Purchase options" (en/es) - Add specific analytics tracking for audiobook clicks The audiobook box only appears when the book has an audiobook_link configured in the CMS, ensuring backwards compatibility. Related to: CORE-1476 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
||
| // Add audiobook option at the beginning if link is available | ||
| if (audiobookLink) { | ||
| content.unshift({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we would prefer the audiobook box at the end of the list
| padding: $normal-margin; | ||
| width: max-content; | ||
|
|
||
| &.boxes-3 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you add this class and then not use it anywhere? whats up with that?
Per review feedback, the audiobook option now appears after Individual and Bookstore boxes instead of before them. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
OpenStaxClaude
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed! The audiobook box now appears at the end of the list. Changed from content.unshift() to content.push() in commit 5151f9d.
OpenStaxClaude
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The boxes-3 class is being used - it's dynamically applied via template literals on lines 39 and 83:
<div className={`phone-version boxes boxes-${contentArray.length}`}>
<div className={`larger-version boxes boxes-${contentArray.length}`}>When there are 3 items in the contentArray (which happens when an audiobook link is present), the class becomes boxes-3, which triggers the 3-column grid layout in the SCSS.
Summary
This PR adds a new audiobook purchase option box to the book details pages that appears above the Individual and Bookstore print options when an audiobook link is configured in the CMS.
Changes
Frontend (os-webview)
UI Changes
When an audiobook link is configured:
When no audiobook link is configured:
Responsive Design
boxes-${contentArray.length}class for flexible stylingTesting
Related
Screenshots
Mockup available in Jira ticket CORE-1476
🤖 Generated with Claude Code