InvestWeb/layouts/NavTemplates.tsx

58 lines
1.3 KiB
TypeScript
Raw Normal View History

import { m } from "framer-motion";
import Link from "next/link";
import { ReactComponentElement, ReactElement } from "react";
const DefaultNavOption = ({
label,
href,
}: {
label: string;
href: string;
}): ReactElement => {
return (
2022-12-12 07:25:11 -05:00
<Link href={href} key={label} className="w-full text-center">
<m.div
2022-12-13 03:15:00 -05:00
variants={defaultNavVariants}
initial="initial"
whileHover="whileHover"
whileTap="whileTap"
2022-12-12 07:25:11 -05:00
>
2022-12-10 05:54:00 -05:00
<p className="pointer-events-auto relative select-none pl-3 pr-3 font-plusJakarta text-white md:pl-5 md:pr-5">
{label}
</p>
2022-12-12 07:25:11 -05:00
</m.div>
</Link>
);
};
2022-12-13 03:15:00 -05:00
const defaultNavVariants = {
initial: {
scale: 1,
},
whileHover: {
scale: 1.05,
transition: {
duration: 0.2,
},
},
whileTap: {
scale: 0.95,
transition: {
duration: 0.2,
},
},
};
interface NavTemplate {
content: ReactComponentElement<any> | ReactElement;
}
2022-12-08 21:40:02 -05:00
const homeMain: NavTemplate[] = [
{ content: <DefaultNavOption label="Home" href="/" /> },
2022-12-12 09:18:03 -05:00
// { content: <DefaultNavOption label="About" href="/about" /> },
2022-12-10 05:54:00 -05:00
{ content: <DefaultNavOption label="Team" href="/team" /> },
2022-12-12 09:18:03 -05:00
// { content: <DefaultNavOption label="Contact" href="/contact" /> },
2022-12-08 21:40:02 -05:00
];
export { type NavTemplate, homeMain };