Skip to content

Commit

Permalink
fix: correct type on dock component
Browse files Browse the repository at this point in the history
  • Loading branch information
itsarghyadas committed Dec 19, 2024
1 parent bc7808d commit 49e7e31
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions registry/default/magicui/dock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
useMotionValue,
useSpring,
useTransform,
MotionProps,
} from "framer-motion";

import { cn } from "@/lib/utils";
Expand All @@ -26,7 +27,7 @@ const DEFAULT_MAGNIFICATION = 60;
const DEFAULT_DISTANCE = 140;

const dockVariants = cva(
"supports-backdrop-blur:bg-white/10 supports-backdrop-blur:dark:bg-black/10 mx-auto mt-8 flex h-[58px] w-max items-center justify-center gap-2 rounded-2xl border p-2 backdrop-blur-md",
"supports-backdrop-blur:bg-white/10 supports-backdrop-blur:dark:bg-black/10 mx-auto mt-8 flex h-[58px] w-max items-center justify-center gap-2 rounded-2xl border p-2 backdrop-blur-md"
);

const Dock = React.forwardRef<HTMLDivElement, DockProps>(
Expand All @@ -40,7 +41,7 @@ const Dock = React.forwardRef<HTMLDivElement, DockProps>(
direction = "middle",
...props
},
ref,
ref
) => {
const mouseX = useMotionValue(Infinity);

Expand Down Expand Up @@ -74,12 +75,13 @@ const Dock = React.forwardRef<HTMLDivElement, DockProps>(
{renderChildren()}
</motion.div>
);
},
}
);

Dock.displayName = "Dock";

export interface DockIconProps {
export interface DockIconProps
extends Omit<MotionProps & React.HTMLAttributes<HTMLDivElement>, "children"> {
size?: number;
magnification?: number;
distance?: number;
Expand Down Expand Up @@ -110,7 +112,7 @@ const DockIcon = ({
const sizeTransform = useTransform(
distanceCalc,
[-distance, 0, distance],
[size, magnification, size],
[size, magnification, size]
);

const scaleSize = useSpring(sizeTransform, {
Expand All @@ -125,7 +127,7 @@ const DockIcon = ({
style={{ width: scaleSize, height: scaleSize, padding }}
className={cn(
"flex aspect-square cursor-pointer items-center justify-center rounded-full",
className,
className
)}
{...props}
>
Expand Down

0 comments on commit 49e7e31

Please sign in to comment.