Skip to content

Commit

Permalink
feat: show a message in my account if the tab list is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
KimiaMontazeri committed Nov 27, 2023
1 parent bf9b04e commit 120bfde
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions frontend/src/pages/my-account/MyAccount.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,37 @@ const MyAccount = () => {
switch (tabValue) {
case 'Workshops':
if (workshops) {
if (workshops.length === 0) {
return (
<Stack alignItems="center">
<Typography>You are not registered in any workshop!</Typography>
</Stack>
);
}
return <List type="Workshops" items={workshops} />;
}
break;
case 'Presentations':
if (talks) {
if (talks.length === 0) {
return (
<Stack alignItems="center">
<Typography>You are not registered in any presentation!</Typography>
</Stack>
);
}
return <List type="Talks" items={talks} />;
}
break;
case 'Cart':
if (cart) {
if (cart.length === 0) {
return (
<Stack alignItems="center">
<Typography>Your cart is empty!</Typography>
</Stack>
);
}
return <List type="Cart" items={cart} />;
}
break;
Expand Down

0 comments on commit 120bfde

Please sign in to comment.