fix: minor ui fixes (#488)

This commit is contained in:
Aaryan Khandelwal 2023-03-22 16:58:32 +05:30 committed by GitHub
parent 283950c8e2
commit 2e346158ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 305 additions and 202 deletions

View file

@ -74,13 +74,15 @@ export const WorkspaceSidebarDropdown = () => {
return (
<div className="relative">
<Menu as="div" className="col-span-4 inline-block w-full px-5 py-3 text-left">
<div className="flex w-full items-center justify-between gap-2.5">
<Menu.Button
className={`inline-flex w-full items-center rounded-md px-1 py-2 text-sm font-semibold text-gray-700 focus:outline-none `}
>
<div className="flex w-full items-center gap-x-2 rounded-md bg-gray-100 px-2 py-1.5">
<div className="relative flex h-6 w-6 items-center justify-center rounded bg-gray-700 p-2 uppercase text-white">
<Menu as="div" className="col-span-4 inline-block w-full p-3 text-left">
<div className="flex items-center justify-between gap-2.5">
<Menu.Button className="flex w-full items-center rounded-md py-2 text-sm font-semibold text-gray-700 focus:outline-none">
<div
className={`flex w-full items-center gap-x-2 rounded-md bg-gray-100 px-2 py-1.5 ${
sidebarCollapse ? "justify-center" : ""
}`}
>
<div className="relative grid h-6 w-6 place-items-center rounded bg-gray-700 uppercase text-white">
{activeWorkspace?.logo && activeWorkspace.logo !== "" ? (
<Image
src={activeWorkspace.logo}
@ -95,12 +97,8 @@ export const WorkspaceSidebarDropdown = () => {
</div>
{!sidebarCollapse && (
<p className="text-base">
{activeWorkspace?.name
? activeWorkspace.name.length > 17
? `${activeWorkspace.name.substring(0, 15)}...`
: activeWorkspace.name
: "Loading..."}
<p>
{activeWorkspace?.name ? truncateText(activeWorkspace.name, 14) : "Loading..."}
</p>
)}
</div>
@ -130,12 +128,9 @@ export const WorkspaceSidebarDropdown = () => {
className="fixed left-2 z-20 mt-1 flex w-full max-w-[17rem] origin-top-left flex-col rounded-md
bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none"
>
<div className="flex flex-col items-start justify-start gap-3 px-5 py-3">
<Menu.Item as="div" className="text-sm text-gray-500">
{user?.email}
</Menu.Item>
<div className="flex flex-col items-start justify-start gap-3 p-3">
<div className="text-sm text-gray-500">{user?.email}</div>
<span className="text-sm font-semibold text-gray-500">Workspace</span>
{workspaces ? (
<div className="flex h-full w-full flex-col items-start justify-start gap-3.5">
{workspaces.length > 0 ? (

View file

@ -37,7 +37,7 @@ export const WorkspaceSidebarMenu: React.FC = () => {
const { collapsed: sidebarCollapse } = useTheme();
return (
<div className="flex w-full flex-col items-start justify-start gap-2 px-5 py-1">
<div className="flex w-full flex-col items-start justify-start gap-2 px-3 py-1">
{workspaceLinks(workspaceSlug as string).map((link, index) => (
<Link key={index} href={link.href}>
<a
@ -49,12 +49,16 @@ export const WorkspaceSidebarMenu: React.FC = () => {
sidebarCollapse ? "justify-center" : ""
}`}
>
<link.icon
className={`${
link.href === router.asPath ? "text-gray-900" : "text-gray-600"
} h-5 w-5 flex-shrink-0 group-hover:text-gray-900`}
aria-hidden="true"
/>
<span className="grid h-5 w-5 flex-shrink-0 place-items-center">
<link.icon
className={`${
link.href === router.asPath ? "text-gray-900" : "text-gray-600"
} group-hover:text-gray-900`}
aria-hidden="true"
height="20"
width="20"
/>
</span>
{!sidebarCollapse && link.name}
</a>
</Link>