doc: add conditional rendering

This commit is contained in:
Leon Xu committed 2022-05-07 15:58:45 -07:00
1 parent 24e9fce241
commit 6b7c245f44
1 file changed
+7 -1
+7 -1
View File
@@ -30,12 +30,18 @@ function Orders() {
}, [user]);
return (
<section className="orders">
<h1>Your Orders</h1>
{!user ? (
<h1 className="orders__error">Sorry, you have no orders!</h1>
) : (
<>
<h1>Your Orders</h1>{" "}
<article className="orders__order">
{orders?.map((order) => (
<Order order={order} />
))}
</article>
</>
)}
</section>
);
}