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.

some final fixes

Steven Tey114946f3510a
diff --git a/components/app/links/link-card-placeholder.tsx b/components/app/links/link-card-placeholder.tsx
index e5ea360d28..26130e71ba 100644
--- a/components/app/links/link-card-placeholder.tsx
+++ b/components/app/links/link-card-placeholder.tsx
@@ -1,6 +1,6 @@
export default function LinkCardPlaceholder() {
return (
- <li className="flex items-center rounded-lg bg-white p-4 shadow transition-all hover:shadow-md">
+ <li className="flex items-center rounded-lg bg-white px-4 py-[1.15rem] shadow transition-all hover:shadow-md">
<div className="mr-2 h-10 w-10 animate-pulse rounded-full bg-gray-200" />
<div>
<div className="mb-2.5 flex items-center space-x-2">
diff --git a/components/app/links/links-container.tsx b/components/app/links/links-container.tsx
index 6f8052299e..8ab30ba277 100644
--- a/components/app/links/links-container.tsx
+++ b/components/app/links/links-container.tsx
@@ -19,7 +19,7 @@ export default function LinksContainer({
slug: string;
};
- const { project: { domain } = {}, loading } = useProject();
+ const { project: { domain } = {} } = useProject();
const { data: links } = useSWR<LinkProps[]>(
domain
@@ -36,14 +36,14 @@ export default function LinksContainer({
<MaxWidthWrapper className="pb-10">
<LinkFilters />
<ul className="grid grid-cols-1 gap-3">
- {links && !loading ? (
+ {links && domain ? ( // need to include `domain` because if not it flashes the "no links" placeholder
links.length > 0 ? (
links.map((props) => <LinkCard key={props.key} props={props} />)
) : (
<NoLinksPlaceholder AddEditLinkButton={AddEditLinkButton} />
)
) : (
- Array.from({ length: 3 }).map((_, i) => (
+ Array.from({ length: 5 }).map((_, i) => (
<LinkCardPlaceholder key={i} />
))
)}
diff --git a/lib/swr/use-project.ts b/lib/swr/use-project.ts
index 640e3f2f5c..715dc4734d 100644
--- a/lib/swr/use-project.ts
+++ b/lib/swr/use-project.ts
@@ -11,13 +11,13 @@ export default function useProject() {
slug: string;
};
- const {
- data: project,
- isValidating,
- error,
- } = useSWR<ProjectProps>(slug && `/api/projects/${slug}`, fetcher, {
- dedupingInterval: 30000,
- });
+ const { data: project, error } = useSWR<ProjectProps>(
+ slug && `/api/projects/${slug}`,
+ fetcher,
+ {
+ dedupingInterval: 30000,
+ },
+ );
const isOwner = useMemo(() => {
if (project && Array.isArray(project.users)) {
@@ -28,7 +28,6 @@ export default function useProject() {
return {
project,
isOwner,
- loading: isValidating,
error,
};
}