Skip to content

Commit 8c084a3

Browse files
committed
revert: slow-pulse
1 parent 9e96afb commit 8c084a3

File tree

3 files changed

+15
-48
lines changed

3 files changed

+15
-48
lines changed

src/components/Nav/Client/index.tsx

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,14 @@ const Menu = dynamic(() => import("../Menu"), {
2323
loading: () => (
2424
<div className="me-8 flex w-full items-center gap-10 px-6 max-md:hidden">
2525
{Array.from({ length: 5 }).map((_, i) => (
26-
<Skeleton variant="slow-pulse" key={i} className="h-6 w-12 py-2" />
26+
<Skeleton key={i} className="h-6 w-12 py-2" />
2727
))}
2828
</div>
2929
),
3030
})
3131

3232
const MobileMenuLoading = () => (
33-
<Skeleton
34-
variant="slow-pulse"
35-
data-label="mobile-menu"
36-
className="ms-2 size-6"
37-
/>
33+
<Skeleton data-label="mobile-menu" className="ms-2 size-6" />
3834
)
3935

4036
const MobileNavMenu = dynamic(() => import("../Mobile"), {
@@ -48,22 +44,13 @@ const SearchProvider = dynamic(() => import("../../Search"), {
4844
<>
4945
<div className="flex items-center gap-6 px-2 max-md:hidden xl:px-3">
5046
<Skeleton
51-
variant="slow-pulse"
5247
data-label="search-xl"
5348
className="hidden h-6 w-[169px] xl:flex"
5449
/>
55-
<Skeleton
56-
variant="slow-pulse"
57-
data-label="search"
58-
className="size-6 xl:hidden"
59-
/>
50+
<Skeleton data-label="search" className="size-6 xl:hidden" />
6051
</div>
6152
<div className="flex items-center md:hidden">
62-
<Skeleton
63-
variant="slow-pulse"
64-
data-label="search"
65-
className="mx-2 size-6"
66-
/>
53+
<Skeleton data-label="search" className="mx-2 size-6" />
6754
<MobileMenuLoading />
6855
</div>
6956
</>
@@ -74,10 +61,7 @@ const LanguagePicker = dynamic(() => import("../../LanguagePicker"), {
7461
ssr: false,
7562
loading: () => (
7663
// LG skeleton width approximates English "[icon] Languages EN" text width
77-
<Skeleton
78-
variant="slow-pulse"
79-
className="h-6 max-md:hidden md:mx-2 md:w-[54px] lg:mx-3 lg:w-[8.875rem]"
80-
/>
64+
<Skeleton className="h-6 max-md:hidden md:mx-2 md:w-[54px] lg:mx-3 lg:w-[8.875rem]" />
8165
),
8266
})
8367

@@ -97,7 +81,7 @@ const ClientSideNav = () => {
9781
<>
9882
{desktopScreen && (
9983
<Menu
100-
className="animate-fade-in max-md:hidden"
84+
className="animate-fade-in- animate-fade-in- max-md:hidden"
10185
sections={linkSections}
10286
/>
10387
)}

src/components/ui/skeleton.tsx

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { cva, type VariantProps } from "class-variance-authority"
2-
31
import { cn } from "@/lib/utils/cn"
42

53
import { Card, CardBanner, CardContent } from "../ui/card"
@@ -24,27 +22,17 @@ const widths = [
2422
"w-1/5",
2523
]
2624

27-
const skeletonVariants = cva(
28-
"h-4 rounded bg-disabled opacity-5 dark:opacity-60",
29-
{
30-
variants: {
31-
variant: {
32-
pulse: "animate-pulse-light",
33-
"slow-pulse": "animate-slow-pulse dark:opacity-0 opacity-0",
34-
},
35-
},
36-
defaultVariants: {
37-
variant: "pulse",
38-
},
39-
}
40-
)
41-
42-
type SkeletonProps = React.HTMLAttributes<HTMLDivElement> &
43-
VariantProps<typeof skeletonVariants>
25+
type SkeletonProps = React.HTMLAttributes<HTMLDivElement>
4426

45-
const Skeleton = ({ className, variant, ...props }: SkeletonProps) => {
27+
const Skeleton = ({ className, ...props }: SkeletonProps) => {
4628
return (
47-
<div className={cn(skeletonVariants({ variant }), className)} {...props} />
29+
<div
30+
className={cn(
31+
"h-4 animate-pulse-light rounded bg-disabled opacity-5 dark:opacity-60",
32+
className
33+
)}
34+
{...props}
35+
/>
4836
)
4937
}
5038

tailwind.config.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -301,10 +301,6 @@ const config = {
301301
"pulse-light": {
302302
"50%": { opacity: "0.2" },
303303
},
304-
"slow-pulse": {
305-
"70%": { opacity: "0" },
306-
"85%": { opacity: "0.2" },
307-
},
308304
"fade-in": {
309305
"0%": { opacity: "0" },
310306
"100%": { opacity: "1" },
@@ -324,7 +320,6 @@ const config = {
324320
"spin-9": "spin 18s linear infinite",
325321
"counter-spin-9": "spin 18s linear infinite reverse",
326322
"pulse-light": "pulse-light 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",
327-
"slow-pulse": "slow-pulse 4s linear infinite",
328323
"fade-in": "fade-in 150ms ease-in-out",
329324
},
330325
// Add custom border-radius tailwinds extension for "4xl" as "2rem"

0 commit comments

Comments
 (0)