Skip to content

Commit

Permalink
Update conditional for aria-describedby on shop page
Browse files Browse the repository at this point in the history
  • Loading branch information
thatblindgeye committed Jul 28, 2021
1 parent 5ac5c6d commit ef7d1b1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/components/Items/CartAddModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ export default function CartAddModal({ attemptCardAdd, closeModal }) {
<div className='modal-mask' onClick={closeModal}>
<div
className='modal-container elevation-08dp'
role='dialog'
aria-labelledby='modal-title'
onClick={(e) => e.stopPropagation()}
>
<h3 className='modal-message'>{attemptCardAdd.message}</h3>
<h3 id='modal-title' className='modal-message'>
{attemptCardAdd.message}
</h3>
<div className='modal-actions'>
<Link
to='/cart'
Expand Down
2 changes: 1 addition & 1 deletion src/components/Items/ItemCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function ItemCard({ item }) {
to={`/shop/${id}`}
className='item-link'
aria-describedby={`price-${id} ${
stock < 10 ? `stock-warning-${id}` : null
stock < 20 ? `stock-warning-${id}` : null
}`}
>
{name}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Pages/Item.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export default function Item() {
<div className='details-container'>
<h1>{item.name}</h1>
<StockWarning id={item.id} stock={item.stock} />
<div>{item.price}</div>
<div>${item.price}</div>
<div className='description-container'>
<h2 className='container-label'>Description</h2>
<div className='item-description'>{item.description}</div>
Expand Down

0 comments on commit ef7d1b1

Please sign in to comment.