diff --git a/src/components/SubHero.jsx b/src/components/SubHero.jsx index e2f0104..db49d28 100644 --- a/src/components/SubHero.jsx +++ b/src/components/SubHero.jsx @@ -2,21 +2,21 @@ import { useEffect, useRef, useState } from "react"; import { Link, useLocation } from "react-router-dom"; const menuMap = { - "/company": { label: "Company" }, - "/uam": { label: "UAM / UATM" }, + "/company": { label: "Company" }, + "/uam": { label: "UAM / UATM" }, "/business": { label: "Business" }, "/solution": { label: "Solution" }, - "/contact": { label: "Contact Us" }, + "/contact": { label: "Contact Us" }, }; export default function SubHero({ title, desc, navItems, bgImage }) { const { pathname } = useLocation(); - const topPath = "/" + pathname.split("/")[1]; + const topPath = "/" + pathname.split("/")[1]; const topLabel = menuMap[topPath]?.label || ""; const curLabel = navItems?.find((n) => n.to === pathname)?.label || ""; const [dropOpen, setDropOpen] = useState(false); - const [scrollY, setScrollY] = useState(0); + const [scrollY, setScrollY] = useState(0); const dropRef = useRef(null); useEffect(() => { @@ -33,9 +33,9 @@ export default function SubHero({ title, desc, navItems, bgImage }) { return () => document.removeEventListener("mousedown", handler); }, []); - const parallaxY = scrollY * 0.45; + const parallaxY = scrollY * 0.45; const fadeOpacity = Math.max(0, 1 - scrollY / 420); - const titleLines = typeof title === "string" ? title.split("\n") : [title]; + const titleLines = typeof title === "string" ? title.split("\n") : [title]; return ( <> @@ -55,27 +55,21 @@ export default function SubHero({ title, desc, navItems, bgImage }) {