Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Update folder-dropdown.tsx

Steven Tey0e22b63c76d8
diff --git a/apps/web/ui/folders/folder-dropdown.tsx b/apps/web/ui/folders/folder-dropdown.tsx
index 3516ea9b3c..9fe7699597 100644
--- a/apps/web/ui/folders/folder-dropdown.tsx
+++ b/apps/web/ui/folders/folder-dropdown.tsx
@@ -47,9 +47,7 @@ export const FolderDropdown = ({
}
}, [folderId, folders]);
- const isLoading = loading || !folders;
-
- if (folderId && isLoading) {
+ if (folderId && loading) {
return <FolderSwitcherPlaceholder />;
}
@@ -114,6 +112,11 @@ export const FolderDropdown = ({
);
})}
+ {loading &&
+ Array.from({ length: 3 }).map((_, index) => (
+ <FolderItemPlaceholder key={index} />
+ ))}
+
<Button
key="add-folder"
variant="outline"
@@ -172,6 +175,15 @@ export const FolderDropdown = ({
);
};
+const FolderItemPlaceholder = () => {
+ return (
+ <div className="flex items-center gap-2 px-2 py-1.5">
+ <div className="size-6 animate-pulse rounded-md bg-neutral-200" />
+ <div className="h-4 w-24 animate-pulse rounded-md bg-neutral-200" />
+ </div>
+ );
+};
+
const FolderSwitcherPlaceholder = () => {
return <div className="h-10 w-40 animate-pulse rounded-lg bg-neutral-200" />;
};