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.

another fix

Kiran Kccf195937eb2
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/page-client.tsx
index 0f362b393f..fd3263f730 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/page-client.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/page-client.tsx
@@ -1,6 +1,9 @@
"use client";
-import { useCheckFolderPermission } from "@/lib/swr/use-folder-permissions";
+import {
+ useCheckFolderPermission,
+ useFolderPermissions,
+} from "@/lib/swr/use-folder-permissions";
import useLinks from "@/lib/swr/use-links";
import useWorkspace from "@/lib/swr/use-workspace";
import { FolderSwitcher } from "@/ui/folders/folder-switcher";
@@ -67,6 +70,7 @@ function WorkspaceLinks() {
const folderId = searchParams.get("folderId");
+ const { isLoading } = useFolderPermissions();
const canCreateLinks = useCheckFolderPermission(
folderId,
"folders.links.write",
@@ -79,13 +83,7 @@ function WorkspaceLinks() {
<div className="flex w-full items-center pt-3">
<MaxWidthWrapper className="flex flex-col gap-y-3">
<div className="flex flex-wrap items-center justify-between gap-2 lg:flex-nowrap">
- {flags?.linkFolders ? (
- <FolderSwitcher />
- ) : (
- <h1 className="order-1 text-2xl font-semibold tracking-tight text-black">
- Links
- </h1>
- )}
+ {flags?.linkFolders && <FolderSwitcher />}
<div className="flex w-full grow gap-2 md:w-auto">
<div className="grow basis-0 md:grow-0">
@@ -153,7 +151,12 @@ function WorkspaceLinks() {
/>
</div>
- {canCreateLinks ? (
+ {isLoading ? (
+ <div className="flex grow-0 animate-pulse items-center space-x-2">
+ <div className="h-10 w-24 rounded-md bg-gray-200" />
+ <div className="h-10 w-10 rounded-md bg-gray-200" />
+ </div>
+ ) : canCreateLinks ? (
<>
<div className="grow-0">
<CreateLinkButton />
diff --git a/apps/web/ui/folders/folder-switcher.tsx b/apps/web/ui/folders/folder-switcher.tsx
index 0212f56e20..f552bb688e 100644
--- a/apps/web/ui/folders/folder-switcher.tsx
+++ b/apps/web/ui/folders/folder-switcher.tsx
@@ -338,7 +338,7 @@ const FolderActions = ({
const FolderSwitcherPlaceholder = () => {
return (
<div className="flex animate-pulse items-center space-x-1.5 rounded-lg px-1.5 py-2 sm:w-60">
- <div className="hidden h-8 w-28 animate-pulse rounded-md bg-gray-200 sm:block sm:w-40" />
+ <div className="hidden h-10 animate-pulse rounded-md bg-gray-200 sm:block sm:w-40" />
</div>
);
};