Tailwind dropdown with react - reactjs

I have the dropdown working, but I am not 100% sure it is the preferred solution. Therefore, that is the first part of my question. The main question is about the CSS.
When I click on the button the drop-down appears, but it is off the screen to the right, pretty much cut in half.
How can I get it to stay on the screen? The issue seems to be around the absolute, but when I remove it the header expands when you click the button.
<ul className="dropdown-menu min-w-max items-center absolute bg-white text-base z-50 float-left
py-2 list-none text-left rounded-lg shadow-lg mt-1 m-0 bg-clip-padding border-none">
----- full code----
import React, {Component} from 'react';
export default class MobileHeader extends Component {
constructor(props) {
super(props);
this.state = {isToggleOn: true};
this.handleClick = this.handleClick.bind(this);
}
handleClick() {
this.setState(prevState => ({
isToggleOn: !prevState.isToggleOn
}));
}
render() {
return(
<nav className="flex items-center justify-between flex-wrap bg-gray-800 p-3 fixed w-full z-10 top-0">
<div className="flex items-center flex-shrink-0 text-white mr-6">
<a className="text-white no-underline hover:text-white hover:no-underline" href="#">
<span className="text-2xl pl-2"><i className="em em-grinning"></i>Demo</span>
</a>
</div>
<div className="block lg:hidden">
<button id="nav-toggle" onClick={this.handleClick}
className="flex items-center px-3 py-2 border rounded text-gray-500
border-gray-600 hover:text-white hover:border-white">
<svg className="fill-current h-3 w-3" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
<title>Menu</title>
<path d="M0 3h20v2H0V3zm0 6h20v2H0V9zm0 6h20v2H0v-2z"/>
</svg>
{
this.state.isToggleOn ? '' :
<ul className="dropdown-menu min-w-max items-center absolute bg-white text-base z-50 float-left
py-2 list-none text-left rounded-lg shadow-lg mt-1 m-0 bg-clip-padding border-none">
<li><a className="dropdown-item text-sm py-2 px-4 font-normal block w-full whitespace-nowrap bg-transparent
text-gray-700 hover:bg-gray-100" href="#">Action</a>
</li>
<li><a className="dropdown-item text-sm py-2 px-4 font-normal block w-full whitespace-nowrap bg-transparent
text-gray-700 hover:bg-gray-100" href="#">Action</a>
</li>
<li><a className="dropdown-item text-sm py-2 px-4 font-normal block w-full whitespace-nowrap bg-transparent
text-gray-700 hover:bg-gray-100" href="#">Action</a>
</li>
<li><a className="dropdown-item text-sm py-2 px-4 font-normal block w-full whitespace-nowrap bg-transparent
text-gray-700 hover:bg-gray-100" href="#">Action</a>
</li>
</ul>
}
</button>
</div>
</nav>
)
}
}

Try to keep only z-index to 50 in the dropdown using class z-50 like this
<ul className="dropdown-menu min-w-max items-center bg-white text-base z-50 float-left py-2 list-none text-left rounded-lg shadow-lg mt-1 m-0 bg-clip-padding border-none ">
<li><a className="dropdown-item text-sm py-2 px-4 font-normal block w-full whitespace-nowrap bg-transparent text-gray-700 hover:bg-gray-100" href="#">Action</a></li>
<li><a className="dropdown-item text-sm py-2 px-4 font-normal block w-full whitespace-nowrap bg-transparent text-gray-700 hover:bg-gray-100" href="#">Action</a></li>
<li><a className="dropdown-item text-sm py-2 px-4 font-normal block w-full whitespace-nowrap bg-transparent text-gray-700 hover:bg-gray-100" href="#">Action</a></li>
<li><a className="dropdown-item text-sm py-2 px-4 font-normal block w-full whitespace-nowrap bg-transparent text-gray-700 hover:bg-gray-100" href="#">Action</a></li>
</ul>

Related

Jest how to test react component which partial elements are lazy load?

The code below comes from https://headlessui.com/react/popover.
As you can see, it uses a function to render Popover.Button.
In enzyme, no matter use shallow or mount, the result tree without elements wrapped by React.Fragment.
So I want to ask is there a way to render the whole dom in enzyme or #testing-library/react
export default function Example() {
return (
<div className="fixed top-16 w-full max-w-sm px-4">
<Popover className="relative">
{({ open }) => (
<>
<Popover.Button
className={`
${open ? '' : 'text-opacity-90'}
group inline-flex items-center rounded-md bg-orange-700 px-3 py-2 text-base font-medium text-white hover:text-opacity-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75`}
>
<span>Solutions</span>
<ChevronDownIcon
className={`${open ? '' : 'text-opacity-70'}
ml-2 h-5 w-5 text-orange-300 transition duration-150 ease-in-out group-hover:text-opacity-80`}
aria-hidden="true"
/>
</Popover.Button>
<Transition
as={Fragment}
enter="transition ease-out duration-200"
enterFrom="opacity-0 translate-y-1"
enterTo="opacity-100 translate-y-0"
leave="transition ease-in duration-150"
leaveFrom="opacity-100 translate-y-0"
leaveTo="opacity-0 translate-y-1"
>
<Popover.Panel className="absolute left-1/2 z-10 mt-3 w-screen max-w-sm -translate-x-1/2 transform px-4 sm:px-0 lg:max-w-3xl">
<div className="overflow-hidden rounded-lg shadow-lg ring-1 ring-black ring-opacity-5">
<div className="relative grid gap-8 bg-white p-7 lg:grid-cols-2">
{solutions.map((item) => (
<a
key={item.name}
href={item.href}
className="-m-3 flex items-center rounded-lg p-2 transition duration-150 ease-in-out hover:bg-gray-50 focus:outline-none focus-visible:ring focus-visible:ring-orange-500 focus-visible:ring-opacity-50"
>
<div className="flex h-10 w-10 shrink-0 items-center justify-center text-white sm:h-12 sm:w-12">
<item.icon aria-hidden="true" />
</div>
<div className="ml-4">
<p className="text-sm font-medium text-gray-900">
{item.name}
</p>
<p className="text-sm text-gray-500">
{item.description}
</p>
</div>
</a>
))}
</div>
<div className="bg-gray-50 p-4">
<a
href="##"
className="flow-root rounded-md px-2 py-2 transition duration-150 ease-in-out hover:bg-gray-100 focus:outline-none focus-visible:ring focus-visible:ring-orange-500 focus-visible:ring-opacity-50"
>
<span className="flex items-center">
<span className="text-sm font-medium text-gray-900">
Documentation
</span>
</span>
<span className="block text-sm text-gray-500">
Start integrating products and tools
</span>
</a>
</div>
</div>
</Popover.Panel>
</Transition>
</>
)}
</Popover>
</div>
)
}

My Navbar hamburger menu component in NextJS isn't working

For context, I followed this navbar component guide https://dev.to/andrewespejo/how-to-design-a-simple-and-beautiful-navbar-using-nextjs-and-tailwindcss-26p1
As stated, I am creating a website, but the Hamburger menu, when clicked, won't drop down. I also used TailwindCSS to create responsiveness within the website, where the hamburger menu only shows within the mobile view of the website. I believe the ternary operator should be working, but I don't believe the onClick method is working.
import Link from 'next/link';
import { useState } from 'react';
export const Navbar = () => {
const [navbar, setNavbar] = useState(false);
const handleClick = () => {
setNavbar(!navbar);
console.log("clicked");
};
return (
<>
<nav className='flex items-center flex-wrap bg-blue-400 p-3 '>
<Link href='/'>
<a className='inline-flex items-center p-2 mr-4 '>
<svg
viewBox='0 0 24 24'
xmlns='http://www.w3.org/2000/svg'
className='fill-current text-white h-8 w-8 mr-2'
>
<path d='M12.001 4.8c-3.2 0-5.2 1.6-6 4.8 1.2-1.6 2.6-2.2 4.2-1.8.913.228 1.565.89 2.288 1.624C13.666 10.618 15.027 12 18.001 12c3.2 0 5.2-1.6 6-4.8-1.2 1.6-2.6 2.2-4.2 1.8-.913-.228-1.565-.89-2.288-1.624C16.337 6.182 14.976 4.8 12.001 4.8zm-6 7.2c-3.2 0-5.2 1.6-6 4.8 1.2-1.6 2.6-2.2 4.2-1.8.913.228 1.565.89 2.288 1.624 1.177 1.194 2.538 2.576 5.512 2.576 3.2 0 5.2-1.6 6-4.8-1.2 1.6-2.6 2.2-4.2 1.8-.913-.228-1.565-.89-2.288-1.624C10.337 13.382 8.976 12 6.001 12z' />
</svg>
<span className='text-xl text-white font-bold uppercase tracking-wide'>
Portfolio
</span>
</a>
</Link>
<button className=' inline-flex p-3 hover:bg-blue-500 rounded lg:hidden text-white ml-auto hover:text-white outline-none' onClick={handleClick}>
<svg
className='w-6 h-6'
fill='none'
stroke='currentColor'
viewBox='0 0 24 24'
xmlns='http://www.w3.org/2000/svg'
>
<path
strokeLinecap='round'
strokeLinejoin='round'
strokeWidth={2}
d='M4 6h16M4 12h16M4 18h16'
/>
</svg>
</button>
<div className={` ${
navbar ? '' : 'hidden'
} w-full lg:inline-flex lg:flex-grow lg:w-auto`}>
<div className='lg:inline-flex lg:flex-row lg:ml-auto lg:w-auto w-full lg:items-center items-start flex flex-col lg:h-auto'>
<Link href='/'>
<a className='lg:inline-flex lg:w-auto w-full px-3 py-2 rounded text-white font-bold items-center justify-center hover:bg-blue-500 hover:text-white '>
Home
</a>
</Link>
<Link href='/'>
<a className='lg:inline-flex lg:w-auto w-full px-3 py-2 rounded text-white font-bold items-center justify-center hover:bg-blue-500 hover:text-white'>
Experience
</a>
</Link>
<Link href='/about'>
<a className='lg:inline-flex lg:w-auto w-full px-3 py-2 rounded text-white font-bold items-center justify-center hover:bg-blue-500 hover:text-white'>
About
</a>
</Link>
<Link href='/'>
<a className='lg:inline-flex lg:w-auto w-full px-3 py-2 rounded text-white font-bold items-center justify-center hover:bg-blue-500 hover:text-white'>
Projects
</a>
</Link>
<Link href='/'>
<a className='lg:inline-flex lg:w-auto w-full px-3 py-2 rounded text-white font-bold items-center justify-center hover:bg-blue-500 hover:text-white'>
Contact
</a>
</Link>
</div>
</div>
</nav>
</>
);
};
`
I have tried testing the onclick function by adding test buttons but they weren't displaying on the navbar.
try giving the onclick an anonymous function.
<button className='inline-flex p-3 hover:bg-blue-500 rounded lg:hidden text-white ml-auto hover:text-white outline-none' onClick={()=>handleClick()}>

HTTP 302 Redirect when using OAuth nextjs

i'm trying to put OAuth in my project but after i log in with my gmail the default redirect page will show up and say's that i have to
Try signing in with a different account.
here's my code
import Image from "next/image"
import { signIn } from "next-auth/react"
export default function Login({ provider }) {
return (
<div className="flex flex-col items-center space-y-20 pt-48">
<Image
src="/image/pictures/twitter-icon-svg-28.jpg"
width={150}
height={150}
objectFit="contain"
className="bg-transparent"
/>
{Object.values(provider).map(provider => {
return (
<div key={provider.name} className="flex flex-col items-center space-y-20 pt-48">
<button onClick={() => signIn(provider.id, { callbackUrl: "/" })}>
<a href="#_" className="relative inline-flex items-center justify-center px-6 py-3 text-lg font-medium tracking-tighter text-white bg-gray-800 rounded-md group">
<span className="absolute inset-0 w-full h-full mt-1 ml-1 transition-all duration-300 ease-in-out bg-blue-600 rounded-md group-hover:mt-0 group-hover:ml-0"></span>
<span className="absolute inset-0 w-full h-full bg-white rounded-md "></span>
<span className="absolute inset-0 w-full h-full transition-all duration-200 ease-in-out delay-100 bg-blue-600 rounded-md opacity-0 group-hover:opacity-100 "></span>
<span className="relative text-blue-600 transition-colors duration-200 ease-in-out delay-100 group-hover:text-white">
Signin With {provider.name}
</span>
</a>
</button>
</div>
)
})}
</div>
)
}
i set everything needed for google credential and nextauth_URL in env.local file but i don't know why am i getting 302 redirect error and cant log in into my website

How do I dynamically change the position of an element in react (tailwind)?

I have a project on react . In it I make a card, when you hover over it, information about this card should appear next to it. Here is the code:
export const CourseCard: React.FC<CourseCardProps> = () => {
const [isShown, setIsShown] = useState(false)
const [xInfoPos, setXInfoPos] = useState("0")
const [yInfoPos, setYInfoPos] = useState("0")
const cardRef = useRef<HTMLDivElement>(null)
const infoCardRef = useRef<HTMLDivElement>(null)
const formateXCord = (x : Number | undefined) => {
return "left-[" + x + "px]"
}
const formateYCord = (y : Number | undefined ) => {
return "top-[" + y + "px]"
}
const carMouseHandler = () => {
const cardEl = cardRef.current?.getBoundingClientRect()
const infoCardEl = infoCardRef.current?.getBoundingClientRect()
setXInfoPos(formateXCord(cardEl?.right))
setYInfoPos(formateYCord(cardEl?.top))
setIsShown(true)
}
return (
<>
<div ref={cardRef} onMouseEnter={carMouseHandler} onMouseLeave={()=>setIsShown(false)} className="py-0 px-4 relative snap-center flex flex-col w-1/4">
<div className="relative rounded-t-xl rounded-b-none bg-white shrink-0">
<img className="block w-full h-auto rounded-t rounded-b-none" src={cardImage} />
<button className="absolute top-2.5 right-2.5 h-6 w-6 rounded-full bg-gray-700 text-white font-bold text-center">♡</button>
</div>
<div className="py-2.5 px-3.5 bg-white border-[1px] border-solid border-gray-300 rounded-b border-t-0 flex-1 flex flex-col">
<div className="mb-2 flex flex-wrap items-center">
<span className="text-lg leading-4 text-cyan-600 mr-2"></span>
<span className="text-sm leading-4 text-blue-400 line-through"></span>
</div>
<h3 className="text-lg leading-4 mb-2 text-black font-normal h-14 overflow-hidden">TITLE</h3>
<div className="text-sm leading-5 opacity-40 mt-auto">Teacher Name</div>
</div>
{isShown &&
<div ref={infoCardRef} className={`flex flex-col absolute ${xInfoPos} ${yInfoPos} z-20 rounded-t-md w-full py-4 px-4 bg-slate-100`} >
<div className="mb-2 text-sm leading-5 text-black flex items-center">
<img className="block rounded-full w-7 h-7 shrink-0 mr-2" src={cardImage} />
Autor
</div>
<div className="text-lg leading-5 font-light text-black mb-2">
Title
</div>
<ul className="list-none p-0 mb-2 w-full block">
<li className="top-0 left-0 bg-white w-full" >
<img className="block w-full rounded-md top-0 left-0 right-0 bottom-0 h-full object-cover" src={cardImage}></img>
</li>
</ul>
<div className="text-sm leading-5 text-black mb-2">
Description
</div>
<ul className="-mx-2 list-none p-0 flex flex-wrap">
<li className="w-1/2 mb-2.5 text-sm leading-5 text-gray-800 flex items-center">
<img className="block shrink-0 mr-2.5"></img>
file
</li>
<li className="px-2.5 w-1/2 mb-2.5 text-sm leading-5 text-gray-800 flex items-center">
<img className="block shrink-0 mr-2.5"></img>
clock
</li>
<li className="w-1/2 mb-2.5 text-sm leading-5 text-gray-800 flex items-center">
<img className="block shrink-0 mr-2.5"></img>
books
</li>
<li className="px-2.5 w-1/2 mb-2.5 text-sm leading-5 text-gray-800 flex items-center">
<img className="block shrink-0 mr-2.5"></img>
lang
</li>
</ul>
<div className="pt-2 text-base leading-5 font-light text-gray-800 border-t border-solid border-t-black">footer</div>
</div>
}
</div>
</>
);
};
But I ran into a problem , the project uses tailwind and the concatenation doesn't work with it
"left-[" + x + "px]"
I found an article describing it https://v2.tailwindcss.com/docs/just-in-time-mode
but if I write like this
"left-[400px]"
it works.
The solution suggested in this article does not work because there can be many variants of x and y.
Right now the information is blocking the card which the cursor is pointing at.
Can you tell me how to solve this problem or give me another way to solve it?
Note: Information about the card should appear depending on the location of the card itself. If the card is located at the bottom then the information appears above it, if it is at the top then the information appears below it. Otherwise, on the right or left of the card.
My answer has two part.
Part one: tailwind generate style when you use and if you want to use dynamically you mist have confidence that style exist and you can generate all dynamic style one by one like this
"left-[400px]"
And part two: you have to use your classname like below
className={`left-[${x}px]`}

How can I right-align these items?

I am using React with Tailwind CSS. I would like to right-align my navigation links. Here is a pic of what I did:
Actually, I would like to have Dashboard Team Project Calendar Reports on the right.
Here is my code:
import React, { useState } from "react";
import { Transition } from "#headlessui/react";
function Nav() {
const [isOpen, setIsOpen] = useState(false);
return (
<div>
<nav className="bg-gray-800">
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div className="flex items-center justify-between h-16">
<div className="flex items-center">
<div className="flex-shrink-0">
<img className="h-8 w-32" alt="Workflow" />
</div>
<div className="hidden md:block">
<div className="space-x-4">
<a
href="#"
className=" hover:bg-gray-700 text-white px-3 py-2 rounded-md text-sm font-medium"
>
Dashboard
</a>
<a
href="#"
className="text-gray-300 hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium"
>
Team
</a>
<a
href="#"
className="text-gray-300 hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium"
>
Projects
</a>
<a
href="#"
className="text-gray-300 hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium"
>
Calendar
</a>
<a
href="#"
className="text-gray-300 hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium"
>
Reports
</a>
</div>
</div>
</div>
<div className="-mr-2 flex md:hidden">
<button
onClick={() => setIsOpen(!isOpen)}
type="button"
className="bg-gray-900 inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-white hover:bg-gray-800 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-800 focus:ring-white"
aria-controls="mobile-menu"
aria-expanded="false"
>
<span className="sr-only">Open main menu</span>
{!isOpen ? (
<svg
className="block h-6 w-6"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
aria-hidden="true"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M4 6h16M4 12h16M4 18h16"
/>
</svg>
) : (
<svg
className="block h-6 w-6"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
aria-hidden="true"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M6 18L18 6M6 6l12 12"
/>
</svg>
)}
</button>
</div>
</div>
</div>
<Transition
show={isOpen}
enter="transition ease-out duration-100 transform"
enterFrom="opacity-0 scale-95"
enterTo="opacity-100 scale-100"
leave="transition ease-in duration-75 transform"
leaveFrom="opacity-100 scale-100"
leaveTo="opacity-0 scale-95"
>
{(ref) => (
<div className="md:hidden" id="mobile-menu">
<div ref={ref} className="px-2 pt-2 pb-3 space-y-1 sm:px-3">
<a
href="#"
className="hover:bg-gray-700 text-white block px-3 py-2 rounded-md text-base font-medium"
>
Dashboard
</a>
<a
href="#"
className="text-gray-300 hover:bg-gray-700 hover:text-white block px-3 py-2 rounded-md text-base font-medium"
>
Team
</a>
<a
href="#"
className="text-gray-300 hover:bg-gray-700 hover:text-white block px-3 py-2 rounded-md text-base font-medium"
>
Projects
</a>
<a
href="#"
className="text-gray-300 hover:bg-gray-700 hover:text-white block px-3 py-2 rounded-md text-base font-medium"
>
Calendar
</a>
<a
href="#"
className="text-gray-300 hover:bg-gray-700 hover:text-white block px-3 py-2 rounded-md text-base font-medium"
>
Reports
</a>
</div>
</div>
)}
</Transition>
</nav>
</div>
);
}
export default Nav;
I tried to do that items-end but without any effects…
You can see my project there:
My project
Thank you very much!
I've modified your nav component as below, hope this can help you:
function Nav() {
const [isOpen, setIsOpen] = useState(false);
return (
<div>
<nav className="bg-gray-800">
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div className="flex items-center justify-between h-16">
<div className="flex items-center w-full"> //added w-full
<div className="flex-shrink-0">
<img className="h-8 w-32" alt="Workflow" />
</div>
<div className="hidden md:block m-auto"> //added m-auto
<div className="items-end space-x-4">
<a
href="#"
className=" hover:bg-gray-700 text-white px-3 py-2 rounded-md text-sm font-medium"
>
Dashboard
</a>
<a
href="#"
className="text-gray-300 hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium"
>
Team
</a>
<a
href="#"
className="text-gray-300 hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium"
>
Projects
</a>
<a
href="#"
className="text-gray-300 hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium"
>
Calendar
</a>
<a
href="#"
className="text-gray-300 hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium"
>
Reports
</a>
</div>
</div>
</div>
<div className="-mr-2 flex md:hidden">
<button
onClick={() => setIsOpen(!isOpen)}
type="button"
className="bg-gray-900 inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-white hover:bg-gray-800 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-800 focus:ring-white"
aria-controls="mobile-menu"
aria-expanded="false"
>
<span className="sr-only">Open main menu</span>
{!isOpen ? (
<svg
className="block h-6 w-6"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
aria-hidden="true"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M4 6h16M4 12h16M4 18h16"
/>
</svg>
) : (
<svg
className="block h-6 w-6"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
aria-hidden="true"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M6 18L18 6M6 6l12 12"
/>
</svg>
)}
</button>
</div>
</div>
</div>
<Transition
show={isOpen}
enter="transition ease-out duration-100 transform"
enterFrom="opacity-0 scale-95"
enterTo="opacity-100 scale-100"
leave="transition ease-in duration-75 transform"
leaveFrom="opacity-100 scale-100"
leaveTo="opacity-0 scale-95"
>
{(ref) => (
<div className="md:hidden" id="mobile-menu">
<div ref={ref} className="px-2 pt-2 pb-3 space-y-1 sm:px-3">
<a
href="#"
className="hover:bg-gray-700 text-white block px-3 py-2 rounded-md text-base font-medium"
>
Dashboard
</a>
<a
href="#"
className="text-gray-300 hover:bg-gray-700 hover:text-white block px-3 py-2 rounded-md text-base font-medium"
>
Team
</a>
<a
href="#"
className="text-gray-300 hover:bg-gray-700 hover:text-white block px-3 py-2 rounded-md text-base font-medium"
>
Projects
</a>
<a
href="#"
className="text-gray-300 hover:bg-gray-700 hover:text-white block px-3 py-2 rounded-md text-base font-medium"
>
Calendar
</a>
<a
href="#"
className="text-gray-300 hover:bg-gray-700 hover:text-white block px-3 py-2 rounded-md text-base font-medium"
>
Reports
</a>
</div>
</div>
)}
</Transition>
</nav>
</div>
);
}
export default Nav;
try this,
...
<div className="flex justify-between h-16"> <------ "just give justify-between"
<div className="flex items-center"> <----- "delete this div and </div> also"
<div className="flex-shrink-0">
...
Happy coding :)

Resources