-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated the email sending automation
- Loading branch information
Showing
6 changed files
with
137 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
"use client"; | ||
import React, { useEffect, useRef } from "react"; | ||
import { motion } from "framer-motion"; | ||
import Link from "next/link"; | ||
import Image from "next/image"; | ||
|
||
const transition = { | ||
type: "spring", | ||
mass: 0.5, | ||
damping: 11.5, | ||
stiffness: 100, | ||
restDelta: 0.001, | ||
restSpeed: 0.001, | ||
}; | ||
|
||
export const MenuItem = ({ | ||
setActive, | ||
active, | ||
item, | ||
children, | ||
}) => { | ||
return ( | ||
<div onMouseEnter={() => setActive(item)} onClick={() => setActive(item)} className="relative"> | ||
<motion.p | ||
transition={{ duration: 0.3 }} | ||
className="cursor-pointer text-black hover:opacity-[0.9] dark:text-white" | ||
> | ||
<button>{item}</button> | ||
</motion.p> | ||
{active !== null && ( | ||
<motion.div | ||
initial={{ opacity: 0, scale: 0.85, y: 10 }} | ||
animate={{ opacity: 1, scale: 1, y: 0 }} | ||
transition={transition} | ||
> | ||
{active === item && children && ( | ||
<div className="absolute top-[calc(100%_+_1.2rem)] left-1/2 transform -translate-x-1/2 pt-4"> | ||
<motion.div | ||
transition={transition} | ||
layoutId="active" | ||
className="bg-white dark:bg-[#050A0F] backdrop-blur-sm rounded-2xl overflow-hidden border border-black/[0.2] dark:border-white/[0.2] shadow-xl" | ||
> | ||
<motion.div layout className="w-max h-full p-4"> | ||
{children} | ||
</motion.div> | ||
</motion.div> | ||
</div> | ||
)} | ||
</motion.div> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export const Menu = ({ | ||
setActive, | ||
children, | ||
}) => { | ||
const menuRef = useRef(null); | ||
|
||
useEffect(() => { | ||
const handleClickOutside = (event) => { | ||
if (menuRef.current && !menuRef.current.contains(event.target)) { | ||
setActive(null); | ||
} | ||
}; | ||
|
||
document.addEventListener('mousedown', handleClickOutside); | ||
return () => { | ||
document.removeEventListener('mousedown', handleClickOutside); | ||
}; | ||
}, [setActive]); | ||
|
||
return ( | ||
<div className="flex justify-center w-full"> | ||
<nav | ||
ref={menuRef} | ||
onMouseLeave={() => setActive(null)} | ||
className="relative rounded-full border border-transparent dark:bg-[#050A0F] dark:border-white/[0.2] bg-white shadow-input flex justify-center space-x-4 px-10 py-6" | ||
> | ||
{children} | ||
</nav> | ||
</div> | ||
); | ||
}; | ||
|
||
export const ProductItem = ({ | ||
title, | ||
description, | ||
href, | ||
src, | ||
setActive | ||
}) => { | ||
return ( | ||
<div > | ||
<Link href={href} className="flex space-x-2"> | ||
<Image | ||
src={src} | ||
width={140} | ||
height={70} | ||
alt={title} | ||
className="flex-shrink-0 rounded-md shadow-2xl" | ||
/> | ||
<div> | ||
<h4 className="text-xl font-bold mb-1 text-black dark:text-white"> | ||
{title} | ||
</h4> | ||
<p className="text-neutral-700 text-sm max-w-[10rem] dark:text-neutral-300"> | ||
{description} | ||
</p> | ||
</div> | ||
</Link> | ||
</div> | ||
); | ||
}; | ||
|
||
export const HoveredLink = ({ children, ...rest }) => { | ||
return ( | ||
<Link {...rest} className="text-neutral-700 dark:text-neutral-200 hover:text-black"> | ||
{children} | ||
</Link> | ||
); | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters