Skip to content

Commit

Permalink
fix: layout
Browse files Browse the repository at this point in the history
  • Loading branch information
guan404ming committed May 25, 2024
1 parent dd534d5 commit aee2873
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app/my/posts/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default async function MyPostsPage() {
<Separator className="md:hidden" />
<GridContainer>
{post.postDishes.map((postDish, index) => (
<PostDish key={index} postDish={postDish} isAuthor isCounter />
<PostDish key={index} postDish={postDish} isAuthor />
))}
</GridContainer>
</div>
Expand Down
5 changes: 4 additions & 1 deletion src/components/dialog/reservation-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ export default function ReservationDialog({
numberRef.current > dishQuantity - (defaultQuantity || 0) ||
numberRef.current < 1
) {
if (dishQuantity === 0) {
if (
dishQuantity === 0 ||
dishQuantity - (defaultQuantity || 0)
) {
setError("The dish is sold out");
} else {
setError(
Expand Down
3 changes: 2 additions & 1 deletion src/components/image-card/store-dish.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ export default function StoreDish({
</h1>

<div className="flex items-center space-x-2 text-sm">
${storeDish.price} · Remaining: {storeDish.quantity}
{!isAuthor &&
`$${storeDish.price} · Remaining: ${storeDish.quantity}`}
</div>

<span className="my-1 line-clamp-2 text-sm text-muted-foreground md:line-clamp-2">
Expand Down

0 comments on commit aee2873

Please sign in to comment.