Skip to content

Commit

Permalink
Add Images/STLs labels even when no images/STLs (#271)
Browse files Browse the repository at this point in the history
Improves UI by making it clearer which upload does what, even when there
are no images/STLs uploaded yet.
  • Loading branch information
chennisden authored Aug 7, 2024
1 parent caf3f31 commit 0cf2077
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion frontend/src/components/listing/ListingImages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const ListingImages = (props: Props) => {

return images.length > 0 || edit ? (
<div className="flex flex-col items-center justify-center my-4 p-4 relative">
{images.length > 0 && (
{images.length > 0 ? (
<>
<Button
onClick={() => setCollapsed(!collapsed)}
Expand Down Expand Up @@ -89,6 +89,10 @@ const ListingImages = (props: Props) => {
</div>
)}
</>
) : (
<p>
<strong>Images</strong>
</p>
)}
{edit && (
<ListingFileUpload
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/components/listing/ListingSTLs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const ListingSTLs = (props: Props) => {

return stls.length > 0 || edit ? (
<div className="flex flex-col items-center justify-center my-4 p-4 relative">
{stls.length > 0 && (
{stls.length > 0 ? (
<>
<Button
onClick={() => setCollapsed(!collapsed)}
Expand Down Expand Up @@ -114,6 +114,10 @@ const ListingSTLs = (props: Props) => {
</div>
)}
</>
) : (
<p>
<strong>STLs</strong>
</p>
)}
{edit && (
<ListingFileUpload
Expand Down

0 comments on commit 0cf2077

Please sign in to comment.