Skip to content

Commit 9632d6b

Browse files
committed
lint: make eslint happy
1 parent c1d38b8 commit 9632d6b

File tree

2 files changed

+30
-34
lines changed

2 files changed

+30
-34
lines changed

components/magicui/animated-grid-pattern.tsx

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use client";
22

3-
import { motion } from "motion/react";
3+
import {motion} from "motion/react";
44
import {
55
ComponentPropsWithoutRef,
66
useEffect,
@@ -9,37 +9,36 @@ import {
99
useState,
1010
} from "react";
1111

12-
import { cn } from "@/lib/utils";
12+
import {cn} from "@/lib/utils";
1313

1414
export interface AnimatedGridPatternProps
1515
extends ComponentPropsWithoutRef<"svg"> {
1616
width?: number;
1717
height?: number;
1818
x?: number;
1919
y?: number;
20-
strokeDasharray?: any;
20+
strokeDasharray?: string | number;
2121
numSquares?: number;
2222
maxOpacity?: number;
2323
duration?: number;
2424
repeatDelay?: number;
2525
}
2626

2727
export function AnimatedGridPattern({
28-
width = 40,
29-
height = 40,
30-
x = -1,
31-
y = -1,
32-
strokeDasharray = 0,
33-
numSquares = 50,
34-
className,
35-
maxOpacity = 0.5,
36-
duration = 4,
37-
repeatDelay = 0.5,
38-
...props
39-
}: AnimatedGridPatternProps) {
28+
width = 40,
29+
height = 40,
30+
x = -1,
31+
y = -1,
32+
strokeDasharray = 0,
33+
numSquares = 50,
34+
className,
35+
maxOpacity = 0.5,
36+
duration = 4,
37+
...props
38+
}: AnimatedGridPatternProps) {
4039
const id = useId();
4140
const containerRef = useRef(null);
42-
const [dimensions, setDimensions] = useState({ width: 0, height: 0 });
41+
const [dimensions, setDimensions] = useState({width: 0, height: 0});
4342
const [squares, setSquares] = useState(() => generateSquares(numSquares));
4443

4544
function getPos() {
@@ -51,7 +50,7 @@ export function AnimatedGridPattern({
5150

5251
// Adjust the generateSquares function to return objects with an id, x, and y
5352
function generateSquares(count: number) {
54-
return Array.from({ length: count }, (_, i) => ({
53+
return Array.from({length: count}, (_, i) => ({
5554
id: i,
5655
pos: getPos(),
5756
}));
@@ -63,9 +62,9 @@ export function AnimatedGridPattern({
6362
currentSquares.map((sq) =>
6463
sq.id === id
6564
? {
66-
...sq,
67-
pos: getPos(),
68-
}
65+
...sq,
66+
pos: getPos(),
67+
}
6968
: sq,
7069
),
7170
);
@@ -81,7 +80,7 @@ export function AnimatedGridPattern({
8180
// Resize observer to update container dimensions
8281
useEffect(() => {
8382
const resizeObserver = new ResizeObserver((entries) => {
84-
for (let entry of entries) {
83+
for (const entry of entries) {
8584
setDimensions({
8685
width: entry.contentRect.width,
8786
height: entry.contentRect.height,
@@ -126,12 +125,12 @@ export function AnimatedGridPattern({
126125
/>
127126
</pattern>
128127
</defs>
129-
<rect width="100%" height="100%" fill={`url(#${id})`} />
128+
<rect width="100%" height="100%" fill={`url(#${id})`}/>
130129
<svg x={x} y={y} className="overflow-visible">
131-
{squares.map(({ pos: [x, y], id }, index) => (
130+
{squares.map(({pos: [x, y], id}, index) => (
132131
<motion.rect
133-
initial={{ opacity: 0 }}
134-
animate={{ opacity: maxOpacity }}
132+
initial={{opacity: 0}}
133+
animate={{opacity: maxOpacity}}
135134
transition={{
136135
duration,
137136
repeat: 1,

components/magicui/rainbow-button.tsx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
import { cn } from "@/lib/utils";
2-
import { Slot } from "@radix-ui/react-slot";
3-
import { cva, VariantProps } from "class-variance-authority";
1+
import {cn} from "@/lib/utils";
2+
import {Slot} from "@radix-ui/react-slot";
3+
import {cva, VariantProps} from "class-variance-authority";
44
import React from "react";
55

6-
interface RainbowButtonProps
7-
extends React.ButtonHTMLAttributes<HTMLButtonElement> {}
8-
96
const rainbowButtonVariants = cva(
107
cn(
118
"relative cursor-pointer group transition-all animate-rainbow",
@@ -44,12 +41,12 @@ interface RainbowButtonProps
4441
}
4542

4643
const RainbowButton = React.forwardRef<HTMLButtonElement, RainbowButtonProps>(
47-
({ className, variant, size, asChild = false, ...props }, ref) => {
44+
({className, variant, size, asChild = false, ...props}, ref) => {
4845
const Comp = asChild ? Slot : "button";
4946
return (
5047
<Comp
5148
data-slot="button"
52-
className={cn(rainbowButtonVariants({ variant, size, className }))}
49+
className={cn(rainbowButtonVariants({variant, size, className}))}
5350
ref={ref}
5451
{...props}
5552
/>
@@ -59,4 +56,4 @@ const RainbowButton = React.forwardRef<HTMLButtonElement, RainbowButtonProps>(
5956

6057
RainbowButton.displayName = "RainbowButton";
6158

62-
export { RainbowButton, rainbowButtonVariants, type RainbowButtonProps };
59+
export {RainbowButton, rainbowButtonVariants, type RainbowButtonProps};

0 commit comments

Comments
 (0)