Skip to content

Commit

Permalink
Only show colour picker if there is a choice
Browse files Browse the repository at this point in the history
  • Loading branch information
jb3 committed Aug 25, 2024
1 parent 923de5c commit b036845
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions thallium-frontend/src/components/StoreItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ const StoreItem: React.FC<StoreItemProps> = ({ template }: StoreItemProps) => {
<h3>{template.title}</h3>
<img src={template.mockup_file_url} alt={template.title} />

{colours === 1 && (
{(colours === 1 && uniqueColours.length > 1) && (
<div>
{uniqueColours.map((colour) => (
<ColourSwatch
Expand Down Expand Up @@ -263,9 +263,10 @@ const StoreItem: React.FC<StoreItemProps> = ({ template }: StoreItemProps) => {
))}
</SizeHolder>

{selectedVariant && (
{selectedVariant ?
<p>${selectedVariant.price} USD</p>
)}
: <p>Select a size to view price</p>
}

<CartButton
disabled={selectedVariant === null}
Expand Down

0 comments on commit b036845

Please sign in to comment.