UPDATE Dropdown and Topbar components for improved styling and functionality
This commit is contained in:
@@ -47,12 +47,12 @@ const Dropdown = ({ label, children, className }: DropdownProps) => {
|
||||
ref={ref}>
|
||||
<button
|
||||
onClick={toggleDropdown}
|
||||
className="inline-flex justify-between w-full rounded-xl border border-gray-300 shadow-sm px-4 py-2 bg-white text-sm font-medium text-gray-600 hover:bg-gray-50"
|
||||
className="inline-flex justify-between w-full rounded-xl px-4 py-2 bg-white text-sm font-medium text-gray-600 hover:bg-gray-50"
|
||||
>
|
||||
{label}
|
||||
</button>
|
||||
{isOpen && (
|
||||
<ul className="absolute w-48 origin-top-right rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none">
|
||||
<ul className="absolute w-48 origin-top-right rounded-md bg-white shadow-lg font-medium">
|
||||
{children}
|
||||
</ul>
|
||||
)}
|
||||
|
||||
@@ -25,21 +25,14 @@ const Topbar = ({sidebarToggled, setSidebarToggled, user, className}: props) =>
|
||||
{ user ? (
|
||||
<div>
|
||||
<img
|
||||
className={"w-8 h-8 rounded-full inline-block mr-2"}
|
||||
className={"w-8 h-8 rounded-full inline-block"}
|
||||
src={user.profilePicture}
|
||||
referrerPolicy="no-referrer"
|
||||
/>
|
||||
|
||||
<Dropdown label={user.name}>
|
||||
<DropdownItem item="Logout" onClick={() => globalThis.location.href = logoutUrl} className="text-red-600" />
|
||||
<DropdownItem item="Logout" onClick={() => globalThis.location.href = logoutUrl} className={"text-red-500 font-medium"} />
|
||||
</Dropdown>
|
||||
|
||||
{/*<Dropdown label={user.name}>*/}
|
||||
{/* <DropdownItem>*/}
|
||||
{/* <a href={logoutUrl}>Logout</a>*/}
|
||||
{/* </DropdownItem>*/}
|
||||
{/*</Dropdown>*/}
|
||||
|
||||
</div>
|
||||
) :
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user