doc: add conditional rendering
This commit is contained in:
1 parent
24e9fce241
commit
6b7c245f44
1 file changed
+7
-1
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user