Fix book card button to render when url is set but amazonUrl is not; v1.1.38
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -3905,7 +3905,7 @@ async function handleAssetUpload(event: ChangeEvent<HTMLInputElement>) {
|
|||||||
<input id={`book-amazon-label-${book.id}`} type="text" value={book.amazonLabel ?? ''} placeholder="View on Amazon" onChange={e => updateLink(book.id, 'amazonLabel', e.target.value)} />
|
<input id={`book-amazon-label-${book.id}`} type="text" value={book.amazonLabel ?? ''} placeholder="View on Amazon" onChange={e => updateLink(book.id, 'amazonLabel', e.target.value)} />
|
||||||
</div>
|
</div>
|
||||||
<div className="admin-field">
|
<div className="admin-field">
|
||||||
<label htmlFor={`book-url-${book.id}`}>Link URL <span className="admin-field-optional">(optional fallback)</span></label>
|
<label htmlFor={`book-url-${book.id}`}>Link URL <span className="admin-field-optional">(used if no Amazon URL is set)</span></label>
|
||||||
<input id={`book-url-${book.id}`} type="url" value={book.url ?? ''} placeholder="https://..." onChange={e => updateLink(book.id, 'url', e.target.value)} />
|
<input id={`book-url-${book.id}`} type="url" value={book.url ?? ''} placeholder="https://..." onChange={e => updateLink(book.id, 'url', e.target.value)} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+2
-2
@@ -1787,8 +1787,8 @@ function BooksSectionSection({ content }: { content: SiteContent }) {
|
|||||||
<div className="book-card-meta">
|
<div className="book-card-meta">
|
||||||
<span className="book-card-title">{book.label}</span>
|
<span className="book-card-title">{book.label}</span>
|
||||||
{book.description && <p className="book-card-description">{book.description}</p>}
|
{book.description && <p className="book-card-description">{book.description}</p>}
|
||||||
{book.amazonUrl && (
|
{(book.amazonUrl || book.url) && (
|
||||||
<a href={book.amazonUrl} target="_blank" rel="noopener noreferrer" className="btn-primary book-card-btn">
|
<a href={book.amazonUrl || book.url} target="_blank" rel="noopener noreferrer" className="btn-primary book-card-btn">
|
||||||
{book.amazonLabel || 'View on Amazon'}
|
{book.amazonLabel || 'View on Amazon'}
|
||||||
</a>
|
</a>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user