final touches

This commit is contained in:
2024-06-08 22:08:35 -04:00
parent 1fff5d279c
commit cd876ef54e
4 changed files with 264 additions and 37 deletions
+1
View File
@@ -19,6 +19,7 @@
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-separator": "^1.0.3",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-tooltip": "^1.0.7",
"@tanstack/react-table": "^8.13.2",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.0",
+171
View File
@@ -35,6 +35,9 @@ dependencies:
'@radix-ui/react-slot':
specifier: ^1.0.2
version: 1.0.2(@types/[email protected])([email protected])
'@radix-ui/react-tooltip':
specifier: ^1.0.7
version: 1.0.7(@types/[email protected])(@types/[email protected])([email protected])([email protected])
'@tanstack/react-table':
specifier: ^8.13.2
version: 8.13.2([email protected])([email protected])
@@ -204,6 +207,34 @@ packages:
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dev: true
/@floating-ui/[email protected]:
resolution: {integrity: sha512-+2XpQV9LLZeanU4ZevzRnGFg2neDeKHgFLjP6YLW+tly0IvrhqT4u8enLGjLH3qeh85g19xY5rsAusfwTdn5lg==}
dependencies:
'@floating-ui/utils': 0.2.2
dev: false
/@floating-ui/[email protected]:
resolution: {integrity: sha512-Nsdud2X65Dz+1RHjAIP0t8z5e2ff/IRbei6BqFrl1urT8sDVzM1HMQ+R0XcU5ceRfyO3I6ayeqIfh+6Wb8LGTw==}
dependencies:
'@floating-ui/core': 1.6.2
'@floating-ui/utils': 0.2.2
dev: false
/@floating-ui/[email protected]([email protected])([email protected]):
resolution: {integrity: sha512-lNzj5EQmEKn5FFKc04+zasr09h/uX8RtJRNj5gUXsSQIXHVWTVh+hVAg1vOMCexkX8EgvemMvIFpQfkosnVNyA==}
peerDependencies:
react: '>=16.8.0'
react-dom: '>=16.8.0'
dependencies:
'@floating-ui/dom': 1.6.5
react: 18.2.0
react-dom: 18.2.0([email protected])
dev: false
/@floating-ui/[email protected]:
resolution: {integrity: sha512-J4yDIIthosAsRZ5CPYP/jQvUAQtlZTTD/4suA08/FEnlxqW3sKS9iAhgsa9VYLZ6vDHn/ixJgIqRQPotoBjxIw==}
dev: false
/@humanwhocodes/[email protected]:
resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==}
engines: {node: '>=10.10.0'}
@@ -810,6 +841,27 @@ packages:
'@babel/runtime': 7.23.9
dev: false
/@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected])([email protected]):
resolution: {integrity: sha512-wSP+pHsB/jQRaL6voubsQ/ZlrGBHHrOjmBnr19hxYgtS0WvAFwZhK2WP/YY5yF9uKECCEEDGxuLxq1NBK51wFA==}
peerDependencies:
'@types/react': '*'
'@types/react-dom': '*'
react: ^16.8 || ^17.0 || ^18.0
react-dom: ^16.8 || ^17.0 || ^18.0
peerDependenciesMeta:
'@types/react':
optional: true
'@types/react-dom':
optional: true
dependencies:
'@babel/runtime': 7.23.9
'@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
'@types/react': 18.2.57
'@types/react-dom': 18.2.19
react: 18.2.0
react-dom: 18.2.0([email protected])
dev: false
/@radix-ui/[email protected](@types/[email protected])([email protected]):
resolution: {integrity: sha512-fDSBgd44FKHa1FRMU59qBMPFcl2PZE+2nmqunj+BWFyYYjnhIDWL2ItDs3rrbJDQOtzt5nIebLCQc4QRfz6LJw==}
peerDependencies:
@@ -949,6 +1001,36 @@ packages:
react: 18.2.0
dev: false
/@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected])([email protected]):
resolution: {integrity: sha512-cKpopj/5RHZWjrbF2846jBNacjQVwkP068DfmgrNJXpvVWrOvlAmE9xSiy5OqeE+Gi8D9fP+oDhUnPqNMY8/5w==}
peerDependencies:
'@types/react': '*'
'@types/react-dom': '*'
react: ^16.8 || ^17.0 || ^18.0
react-dom: ^16.8 || ^17.0 || ^18.0
peerDependenciesMeta:
'@types/react':
optional: true
'@types/react-dom':
optional: true
dependencies:
'@babel/runtime': 7.23.9
'@floating-ui/react-dom': 2.1.0([email protected])([email protected])
'@radix-ui/react-arrow': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
'@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])
'@radix-ui/react-context': 1.0.1(@types/[email protected])([email protected])
'@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
'@radix-ui/react-use-callback-ref': 1.0.1(@types/[email protected])([email protected])
'@radix-ui/react-use-layout-effect': 1.0.1(@types/[email protected])([email protected])
'@radix-ui/react-use-rect': 1.0.1(@types/[email protected])([email protected])
'@radix-ui/react-use-size': 1.0.1(@types/[email protected])([email protected])
'@radix-ui/rect': 1.0.1
'@types/react': 18.2.57
'@types/react-dom': 18.2.19
react: 18.2.0
react-dom: 18.2.0([email protected])
dev: false
/@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected])([email protected]):
resolution: {integrity: sha512-Qki+C/EuGUVCQTOTD5vzJzJuMUlewbzuKyUy+/iHM2uwGiru9gZeBJtHAPKAEkB5KWGi9mP/CHKcY0wt1aW45Q==}
peerDependencies:
@@ -1049,6 +1131,38 @@ packages:
react: 18.2.0
dev: false
/@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected])([email protected]):
resolution: {integrity: sha512-lPh5iKNFVQ/jav/j6ZrWq3blfDJ0OH9R6FlNUHPMqdLuQ9vwDgFsRxvl8b7Asuy5c8xmoojHUxKHQSOAvMHxyw==}
peerDependencies:
'@types/react': '*'
'@types/react-dom': '*'
react: ^16.8 || ^17.0 || ^18.0
react-dom: ^16.8 || ^17.0 || ^18.0
peerDependenciesMeta:
'@types/react':
optional: true
'@types/react-dom':
optional: true
dependencies:
'@babel/runtime': 7.23.9
'@radix-ui/primitive': 1.0.1
'@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])
'@radix-ui/react-context': 1.0.1(@types/[email protected])([email protected])
'@radix-ui/react-dismissable-layer': 1.0.5(@types/[email protected])(@types/[email protected])([email protected])([email protected])
'@radix-ui/react-id': 1.0.1(@types/[email protected])([email protected])
'@radix-ui/react-popper': 1.1.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
'@radix-ui/react-portal': 1.0.4(@types/[email protected])(@types/[email protected])([email protected])([email protected])
'@radix-ui/react-presence': 1.0.1(@types/[email protected])(@types/[email protected])([email protected])([email protected])
'@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
'@radix-ui/react-slot': 1.0.2(@types/[email protected])([email protected])
'@radix-ui/react-use-controllable-state': 1.0.1(@types/[email protected])([email protected])
'@radix-ui/react-visually-hidden': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
'@types/react': 18.2.57
'@types/react-dom': 18.2.19
react: 18.2.0
react-dom: 18.2.0([email protected])
dev: false
/@radix-ui/[email protected](@types/[email protected])([email protected]):
resolution: {integrity: sha512-D94LjX4Sp0xJFVaoQOd3OO9k7tpBYNOXdVhkltUbGv2Qb9OXdrg/CpsjlZv7ia14Sylv398LswWBVVu5nqKzAQ==}
peerDependencies:
@@ -1107,6 +1221,63 @@ packages:
react: 18.2.0
dev: false
/@radix-ui/[email protected](@types/[email protected])([email protected]):
resolution: {integrity: sha512-Cq5DLuSiuYVKNU8orzJMbl15TXilTnJKUCltMVQg53BQOF1/C5toAaGrowkgksdBQ9H+SRL23g0HDmg9tvmxXw==}
peerDependencies:
'@types/react': '*'
react: ^16.8 || ^17.0 || ^18.0
peerDependenciesMeta:
'@types/react':
optional: true
dependencies:
'@babel/runtime': 7.23.9
'@radix-ui/rect': 1.0.1
'@types/react': 18.2.57
react: 18.2.0
dev: false
/@radix-ui/[email protected](@types/[email protected])([email protected]):
resolution: {integrity: sha512-ibay+VqrgcaI6veAojjofPATwledXiSmX+C0KrBk/xgpX9rBzPV3OsfwlhQdUOFbh+LKQorLYT+xTXW9V8yd0g==}
peerDependencies:
'@types/react': '*'
react: ^16.8 || ^17.0 || ^18.0
peerDependenciesMeta:
'@types/react':
optional: true
dependencies:
'@babel/runtime': 7.23.9
'@radix-ui/react-use-layout-effect': 1.0.1(@types/[email protected])([email protected])
'@types/react': 18.2.57
react: 18.2.0
dev: false
/@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected])([email protected]):
resolution: {integrity: sha512-D4w41yN5YRKtu464TLnByKzMDG/JlMPHtfZgQAu9v6mNakUqGUI9vUrfQKz8NK41VMm/xbZbh76NUTVtIYqOMA==}
peerDependencies:
'@types/react': '*'
'@types/react-dom': '*'
react: ^16.8 || ^17.0 || ^18.0
react-dom: ^16.8 || ^17.0 || ^18.0
peerDependenciesMeta:
'@types/react':
optional: true
'@types/react-dom':
optional: true
dependencies:
'@babel/runtime': 7.23.9
'@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
'@types/react': 18.2.57
'@types/react-dom': 18.2.19
react: 18.2.0
react-dom: 18.2.0([email protected])
dev: false
/@radix-ui/[email protected]:
resolution: {integrity: sha512-fyrgCaedtvMg9NK3en0pnOYJdtfwxUcNolezkNPUsoX57X8oQk+NkqcvzHXD2uKNij6GXmWU9NDru2IWjrO4BQ==}
dependencies:
'@babel/runtime': 7.23.9
dev: false
/@react-spring/[email protected]([email protected]):
resolution: {integrity: sha512-5CWeNJt9pNgyvuSzQH+uy2pvTg8Y4/OisoscZIR8/ZNLIOI+CatFBhGZpDGTF/OzdNFsAoGk3wiUYTwoJ0YIvw==}
peerDependencies:
+43 -18
View File
@@ -1,7 +1,7 @@
"use client";
import Image from "next/image";
import React, { useState } from "react";
import React, { Fragment, useState } from "react";
import { Button } from "../ui/button";
import { cn } from "@/lib/utils";
import {
@@ -34,8 +34,15 @@ import {
} from "../ui/command";
import { useRouter } from "next/navigation";
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
} from "@/components/ui/tooltip";
function Sidebar() {
const [isCollapsed, setIsCollapsed] = useState<boolean>(false);
const [isCollapsed, setIsCollapsed] = useState<boolean>(true);
const router = useRouter();
@@ -87,20 +94,15 @@ function Sidebar() {
];
return (
<div className="border-r border-neutral-700 min-h-screen">
<div
className={cn(
isCollapsed ? "w-[75px]" : "min-w-[275px]",
"border-r border-neutral-700 min-h-screen"
isCollapsed ? "items-center w-[75px]" : "w-[250px]",
"pb-2 px-2 flex flex-col min-h-screen"
)}
>
<div
className={cn(
isCollapsed ? "items-center" : "",
"pb-4 px-2 flex flex-col min-h-screen"
)}
>
<div
className={cn(isCollapsed ? "" : "px-4", "h-16 flex items-center")}
className={cn(isCollapsed ? "" : "px-2", "h-16 flex items-center")}
>
{isCollapsed ? (
<Image
@@ -108,6 +110,10 @@ function Sidebar() {
height={40}
width={40}
alt="yellowbird"
className="cursor-pointer"
onClick={() => {
router.push("/");
}}
/>
) : (
<Image
@@ -115,19 +121,26 @@ function Sidebar() {
height={40}
width={152.5}
alt="yellowbird"
className="cursor-pointer"
onClick={() => {
router.push("/");
}}
/>
)}
</div>
<div className="flex-grow px-4">
<div className="flex-grow px-2">
<div className="max-h-full">
{menuList.map((menu: any, key: number) => (
<>
<div key={key} className="py-2">
<Fragment key={key}>
<div className="py-2">
<div className="text-muted-foreground text-sm pl-1 pb-1">
{!isCollapsed && menu.group}
</div>
{menu.items.map((option: any, optionKey: number) => (
<TooltipProvider key={optionKey}>
<Tooltip>
<TooltipTrigger className="w-full">
<div
key={optionKey}
className="flex gap-2 cursor-pointer p-2 hover:bg-neutral-700 rounded-xl"
@@ -147,10 +160,22 @@ function Sidebar() {
)}
</div>
</div>
</TooltipTrigger>
<TooltipContent
className={cn(
isCollapsed ? "" : "hidden",
"border-0 bg-background drop-shadow-lg"
)}
side="right"
>
{option.text}
</TooltipContent>
</Tooltip>
</TooltipProvider>
))}
</div>
<hr className="border-neutral-600 last:hidden" />
</>
</Fragment>
))}
</div>
</div>
@@ -181,8 +206,8 @@ function Sidebar() {
</div>
<div
className={cn(
isCollapsed ? "justify-center" : "",
"p-2 bg-secondary rounded-lg flex items-center"
isCollapsed ? "justify-center p-2" : "pl-2",
"rounded-lg flex items-center"
)}
>
<Button variant="default" className="w-8 h-8 rounded-full">
@@ -197,7 +222,7 @@ function Sidebar() {
</p>
</div>
<Button variant="ghost" className="">
<LogOutIcon width={20} height={20} className="text-red-500" />
<LogOutIcon width={15} height={20} className="text-red-500" />
</Button>
</>
)}
+30
View File
@@ -0,0 +1,30 @@
"use client"
import * as React from "react"
import * as TooltipPrimitive from "@radix-ui/react-tooltip"
import { cn } from "@/lib/utils"
const TooltipProvider = TooltipPrimitive.Provider
const Tooltip = TooltipPrimitive.Root
const TooltipTrigger = TooltipPrimitive.Trigger
const TooltipContent = React.forwardRef<
React.ElementRef<typeof TooltipPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>
>(({ className, sideOffset = 4, ...props }, ref) => (
<TooltipPrimitive.Content
ref={ref}
sideOffset={sideOffset}
className={cn(
"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
className
)}
{...props}
/>
))
TooltipContent.displayName = TooltipPrimitive.Content.displayName
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }