Skip to content

Commit 9f3c9cf

Browse files
committed
fix: ui inconsistencies
1 parent 0762304 commit 9f3c9cf

File tree

2 files changed

+7
-44
lines changed

2 files changed

+7
-44
lines changed

frontend/src/components/home/sections/navbar.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,6 @@ export function Navbar({ sidebarOpen = false }: { sidebarOpen?: boolean }) {
342342
<HoverBorderGradient
343343
containerClassName=""
344344
className="h-8 flex items-center justify-center text-sm font-normal tracking-wide text-white w-fit px-3"
345-
duration={2}
346345
>
347346
<Zap className="w-3 h-3 mr-1.5" />
348347
Integrations

frontend/src/components/ui/hover-border-gradient.tsx

Lines changed: 7 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,32 @@
11
"use client";
2-
import React, { useState, useEffect, useRef } from "react";
2+
import React from "react";
33

44
import { motion } from "framer-motion";
55
import { cn } from "@/lib/utils";
66

7-
type Direction = "TOP" | "LEFT" | "BOTTOM" | "RIGHT";
7+
// Removed Direction type as it's no longer needed
88

99
export function HoverBorderGradient({
1010
children,
1111
containerClassName,
1212
className,
1313
as: Tag = "button",
14-
duration = 1,
15-
clockwise = true,
1614
...props
1715
}: React.PropsWithChildren<
1816
{
1917
as?: React.ElementType;
2018
containerClassName?: string;
2119
className?: string;
22-
duration?: number;
23-
clockwise?: boolean;
2420
} & React.HTMLAttributes<HTMLElement>
2521
>) {
26-
const [hovered, setHovered] = useState<boolean>(false);
27-
const [direction, setDirection] = useState<Direction>("TOP");
28-
29-
const rotateDirection = (currentDirection: Direction): Direction => {
30-
const directions: Direction[] = ["TOP", "LEFT", "BOTTOM", "RIGHT"];
31-
const currentIndex = directions.indexOf(currentDirection);
32-
const nextIndex = clockwise
33-
? (currentIndex - 1 + directions.length) % directions.length
34-
: (currentIndex + 1) % directions.length;
35-
return directions[nextIndex];
36-
};
37-
38-
const movingMap: Record<Direction, string> = {
39-
TOP: "radial-gradient(20.7% 50% at 50% 0%, hsl(0, 0%, 100%) 0%, rgba(255, 255, 255, 0) 100%)",
40-
LEFT: "radial-gradient(16.6% 43.1% at 0% 50%, hsl(0, 0%, 100%) 0%, rgba(255, 255, 255, 0) 100%)",
41-
BOTTOM:
42-
"radial-gradient(20.7% 50% at 50% 100%, hsl(0, 0%, 100%) 0%, rgba(255, 255, 255, 0) 100%)",
43-
RIGHT:
44-
"radial-gradient(16.2% 41.199999999999996% at 100% 50%, hsl(0, 0%, 100%) 0%, rgba(255, 255, 255, 0) 100%)",
45-
};
22+
// Simplified component - using red glow as permanent state
4623

4724
const highlight =
4825
"radial-gradient(75% 181.15942028985506% at 50% 50%, #EF4444 0%, rgba(255, 255, 255, 0) 100%)";
4926

50-
useEffect(() => {
51-
if (!hovered) {
52-
const interval = setInterval(() => {
53-
setDirection((prevState) => rotateDirection(prevState));
54-
}, duration * 1000);
55-
return () => clearInterval(interval);
56-
}
57-
}, [hovered, duration, rotateDirection]);
27+
// Removed the moving gradient animation - using red glow as default state
5828
return (
5929
<Tag
60-
onMouseEnter={(event: React.MouseEvent<HTMLDivElement>) => {
61-
setHovered(true);
62-
}}
63-
onMouseLeave={() => setHovered(false)}
6430
className={cn(
6531
"relative flex rounded-full border content-center bg-black/20 hover:bg-black/10 transition duration-500 dark:bg-white/20 items-center flex-col flex-nowrap gap-10 h-min justify-center overflow-visible p-px decoration-clone w-fit",
6632
containerClassName
@@ -85,13 +51,11 @@ export function HoverBorderGradient({
8551
width: "100%",
8652
height: "100%",
8753
}}
88-
initial={{ background: movingMap[direction] }}
54+
initial={{ background: highlight }}
8955
animate={{
90-
background: hovered
91-
? [movingMap[direction], highlight]
92-
: movingMap[direction],
56+
background: highlight,
9357
}}
94-
transition={{ ease: "linear", duration: duration ?? 1 }}
58+
transition={{ ease: "linear", duration: 1 }}
9559
/>
9660
<div className="bg-black absolute z-1 flex-none inset-[2px] rounded-[100px]" />
9761
</Tag>

0 commit comments

Comments
 (0)