Skip to content

Commit 21fc20f

Browse files
committed
refactor: update skeleton components to use Skeleton UI component for consistency and improved styling
1 parent 7037ad5 commit 21fc20f

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

components/domain/domain-search-skeleton.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Skeleton } from "@/components/ui/skeleton";
12
import { cn } from "@/lib/utils";
23

34
export type DomainSearchSkeletonVariant = "sm" | "lg";
@@ -14,23 +15,23 @@ export function DomainSearchSkeleton({
1415
<div className="relative w-full flex-1">
1516
<div
1617
className={cn(
17-
"flex w-full animate-pulse items-center gap-3 rounded-lg bg-muted/30 px-4 ring-1 ring-border/60",
18+
"flex w-full animate-pulse items-center gap-3 rounded-lg bg-muted/30 px-3 ring-1 ring-border/60",
1819
variant === "lg" ? "h-12" : "h-10",
1920
)}
2021
>
2122
{/* Search icon placeholder */}
22-
<div className="size-5 shrink-0 rounded bg-muted/50" />
23+
<Skeleton className="size-5 shrink-0" />
2324

2425
{/* Input text placeholder */}
25-
<div className="h-4 flex-1 rounded bg-muted/50" />
26+
<Skeleton className="h-4 flex-1" />
2627

2728
{/* Right side addon placeholder */}
2829
{variant === "lg" ? (
2930
// Inspect button placeholder (homepage)
30-
<div className="h-8 w-20 shrink-0 rounded-md bg-muted/50" />
31+
<Skeleton className="h-8 w-20 shrink-0" />
3132
) : (
3233
// Keyboard shortcut placeholder (header)
33-
<div className="hidden h-6 w-14 shrink-0 rounded border bg-muted/50 sm:block" />
34+
<Skeleton className="hidden h-6 w-14 shrink-0 sm:block" />
3435
)}
3536
</div>
3637
</div>

components/domain/domain-suggestions-skeleton.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Skeleton } from "@/components/ui/skeleton";
12
import { MAX_HISTORY_ITEMS } from "@/lib/constants";
23
import { cn } from "@/lib/utils";
34

@@ -11,18 +12,18 @@ export function DomainSuggestionsSkeleton({
1112
return (
1213
<div className={cn("relative", className)}>
1314
<div className="overflow-hidden py-0.5">
14-
<div className="flex gap-2 px-0.5 pb-2">
15+
<div className="flex gap-2 pl-0.5">
1516
{Array.from({ length: count }).map((_, i) => (
1617
<div
1718
// biome-ignore lint/suspicious/noArrayIndexKey: fine for skeletons
1819
key={i}
1920
className="flex h-8 flex-shrink-0 animate-pulse items-center gap-2 rounded-md bg-muted/15 px-3 ring-1 ring-border/60"
2021
>
2122
{/* Favicon placeholder */}
22-
<div className="size-4 rounded bg-muted/50" />
23+
<Skeleton className="size-4" />
2324
{/* Domain text placeholder with varying widths */}
24-
<div
25-
className="h-3.5 rounded bg-muted/50"
25+
<Skeleton
26+
className="h-3.5"
2627
style={{
2728
width: `${80 + ((i * 20) % 60)}px`,
2829
}}

components/home-hero.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ export function HomeHero({ intervalMs = 2400, className }: HomeHeroProps) {
6262
Inspect any domain&rsquo;s
6363
</span>
6464
<motion.span
65-
className="ml-2.5 inline-flex items-center rounded-lg bg-muted/70 px-2 py-0.5 text-foreground shadow-sm ring-1 ring-border/60 backdrop-blur supports-[backdrop-filter]:backdrop-blur-md sm:rounded-xl sm:px-3 sm:py-1"
65+
className="ml-2.5 inline-flex items-center rounded-lg bg-muted/70 px-2 py-0.5 text-foreground shadow-sm ring-1 ring-border/60 backdrop-blur will-change-[width,transform] supports-[backdrop-filter]:backdrop-blur-md sm:rounded-xl sm:px-3 sm:py-1"
6666
aria-live="polite"
6767
aria-atomic="true"
6868
initial={false}
6969
animate={{ width: measuredWidth ?? undefined }}
7070
transition={{ duration: 0.85, ease: [0.22, 1, 0.36, 1] }}
71-
style={{ willChange: "width", width: measuredWidth ?? undefined }}
71+
style={{ width: measuredWidth ?? undefined }}
7272
>
7373
<span className="relative flex h-[1.15em] w-full items-center overflow-hidden whitespace-nowrap">
7474
<span className="-translate-x-1/2 absolute left-1/2">
@@ -83,7 +83,7 @@ export function HomeHero({ intervalMs = 2400, className }: HomeHeroProps) {
8383
ease: [0.22, 1, 0.36, 1],
8484
duration: 0.5,
8585
}}
86-
className="inline-block transform-gpu will-change-transform"
86+
className="inline-block will-change-[transform,opacity]"
8787
>
8888
{rotatingWords[index]}
8989
</motion.span>

0 commit comments

Comments
 (0)