Skip to content

Commit

Permalink
ui: Fix sidebar list spinner
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamedBassem committed Mar 2, 2024
1 parent a1ed172 commit e70a221
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ function renderBookmark(bookmark: ZBookmark) {
break;
}
return (
<Slot key={bookmark.id} className="border-grey-100 mb-4 border bg-gray-50 duration-300 ease-in hover:border-blue-300 hover:transition-all">
<Slot
key={bookmark.id}
className="border-grey-100 mb-4 border bg-gray-50 duration-300 ease-in hover:border-blue-300 hover:transition-all"
>
{comp}
</Slot>
);
Expand Down
28 changes: 14 additions & 14 deletions packages/web/app/dashboard/components/AllLists.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ export default function AllLists() {

const { setOpen } = useNewListModal();

if (!lists) {
return <LoadingSpinner />;
}

return (
<ul className="max-h-full gap-y-2 overflow-auto text-sm font-medium">
<NewListModal />
Expand All @@ -21,20 +25,16 @@ export default function AllLists() {
<Plus />
</Link>
</li>
{lists && lists.lists.length == 0 && <li>No lists</li>}
{lists ? (
lists.lists.map((l) => (
<SidebarItem
key={l.id}
logo={<span className="text-lg"> {l.icon}</span>}
name={l.name}
path={`/dashboard/lists/${l.id}`}
className="py-0.5"
/>
))
) : (
<LoadingSpinner />
)}
{lists.lists.length == 0 && <li>No lists</li>}
{lists.lists.map((l) => (
<SidebarItem
key={l.id}
logo={<span className="text-lg"> {l.icon}</span>}
name={l.name}
path={`/dashboard/lists/${l.id}`}
className="py-0.5"
/>
))}
</ul>
);
}

0 comments on commit e70a221

Please sign in to comment.