Skip to content

Commit

Permalink
enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
Tushar98644 committed Jul 18, 2023
1 parent be64490 commit 2b6e95b
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 22 deletions.
3 changes: 1 addition & 2 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ GOOGLE_SECRET="Your OAuth google_secret"
SECRET="YOUR NEXT_AUTH secret"
MONGODB_URI="your mongodb cluster uri"
NEXT_PUBLIC_ADMIN_EMAIL="Your Admin_email"
OPENAI_API_KEY="Your OpenAI API key"

OPENAI_API_KEY="Your OpenAI API key"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The site is deployed through Vercel, which you can view from [here](https://proj
* Jest

## 🤝 Credits
3D Animation : [LottieFiles](https://lottiefiles.com/animation/3d)
3D Animation : [LottieFiles](https://lottiefiles.com/animation/3d) <br>
ChatBot Model : [OpenAI Api](https://platform.openai.com/account/usage)

## Prerequisites
Expand Down
53 changes: 36 additions & 17 deletions src/components/Navbar/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ const Navbar = () => {
}, []);

return (
<div className='nav font-bold grid md:grid-cols-7 grid-cols-2 py-7 px-6 z-10 gap-2 border-b border-black shadow-xl bg-black items-center fixed w-full'>
<div className='nav font-bold grid md:grid-cols-7 grid-cols-2 md:py-7 py-1 px-6 z-10 gap-2 border-b border-black shadow-xl bg-black items-center fixed w-full'>
<span className='bg-gradient-to-r from-[#4ca5ff] to-[#b673f8] md:col-span-2 md:block hidden text-center px-2 lg:text-4xl md:text-2xl font-black animate-pulse bg-clip-text text-transparent'>PROJECT HUB</span>
{isMobile ? (
<>
<div className=''>
<div>
<button type="button" className=" justify-self-start items-center p-2 w-10 h-10 justify-center text-sm text-gray-500 rounded-lg md:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600" aria-controls="navbar-cta" aria-expanded={isMenuOpen} onClick={toggleMenu}>
<span className="sr-only">Open main menu</span>
<svg className="w-5 h-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 17 14">
<path stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M1 1h15M1 7h15M1 13h15" />
</svg>
Expand All @@ -37,7 +36,7 @@ const Navbar = () => {
<img src="/logo-1.png" alt="" width={100} height={100} />
</div>
{isMenuOpen && (
<div className="items-center justify-between w-full md:flex md:w-auto" id="navbar-cta">
<div className="">
<ul className="flex flex-col font-medium p-4 md:p-0 mt-4 border border-gray-100 rounded-lg bg-gray-50 md:flex-row md:space-x-8 md:mt-0 md:border-0 md:bg-white dark:bg-gray-800 md:dark:bg-gray-900 dark:border-gray-700">
<li>
<Link href="/" className="block py-2 pl-3 pr-4 text-white bg-blue-700 rounded md:bg-transparent md:text-blue-700 md:p-0 md:dark:text-blue-500" aria-current="page">Home</Link>
Expand All @@ -54,30 +53,50 @@ const Navbar = () => {
</>
) : (
<>
<nav className='col-span-3 md:block hidden'>
<ul className='md:grid grid-cols-3 hidden xl:text-xl lg:text-lg text-nav-text cursor-pointer hover:transition items-center gap-6'>
<nav className={session ? 'col-span-4' : 'col-span-3'}>
<ul className='grid grid-cols-4 xl:text-xl lg:text-lg text-nav-text cursor-pointer hover:transition items-center gap-'>
{session && (
<>
{session?.user?.email === process.env.NEXT_PUBLIC_ADMIN_EMAIL ? (
<><li className='hover:text-white'><Link href='/project'>Add project</Link></li><li className='hover:text-white'><Link href='/'>View Projects</Link></li><li className='hover:text-white'>
<Link href='/admin'>
Admin Panel
</Link>
</li></>
<>
<li className='hover:text-white'>
<Link href='/project'>Add project</Link>
</li>
<li className='hover:text-white'>
<Link href='/'>View Projects</Link>
</li>
<li className='hover:text-white'>
<Link href='/admin'> Admin Panel </Link>
</li>
<li className='hover:text-white'>
<Link href='/message'>Messages</Link>
</li>
</>
) : (
<><li className='hover:text-white'><Link href='/project'>Add project</Link></li><li className='hover:text-white'><Link href='/'>View Projects</Link></li><li className='hover:text-white'>
<Link href='/contact'>
Contact Admin
</Link>
</li></>
<>
<li className='hover:text-white'>
<Link href='/project'>
Add project
</Link>
</li>
<li className='hover:text-white'>
<Link href='/'>
View Projects
</Link>
</li>
<li className='hover:text-white'>
<Link href='/contact'>
Contact Admin
</Link>
</li></>
)
}
</>
)}
</ul>
</nav>
{session ? (
<div className='grid grid-cols-1 col-span-2 justify-items-center'>
<div className='grid grid-cols-1 col-span-1 justify-items-center'>
<div className='box w-[12vw] text-center lg:h-12 md:h-10 sm:h-9 h-8 justify-center'>
<button className='text-nav-text text-[1.4vw] pt-1 cursor-pointer' onClick={() => signOut()}>Log out</button>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/chatbot/chatbot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const Chat = () => {
<div className='text-gray-500'>
{session && (
<div
className="fixed bottom-10 right-16 cursor-pointer z-50"
className="fixed bottom-6 right-8 md:right-20 md:bottom-16 cursor-pointer z-50"
onClick={toggleChat}
>
<Image
Expand All @@ -30,7 +30,7 @@ const Chat = () => {
</div>
)}
{isChatOpen && (
<div className="fixed bottom-28 right-10 z-40 md:w-96 w-80">
<div className="fixed bottom-24 right-7 md:right-20 md:bottom-36 z-40 md:w-96 w-80">
<div className="bg-white rounded-lg shadow-lg w-500 h-400 p-4">
<div className="h-60 overflow-y-auto whitespace-normal">
{messages.map((m) => (
Expand Down

0 comments on commit 2b6e95b

Please sign in to comment.