Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions dashboard/src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ const Sidebar = (props: SidebarProps) => {

const MapacheHeader = (props: { isSidebarExpanded: boolean }) => {
return (
<div className="flex items-center p-4">
<div className="flex min-w-[60px] items-center justify-center">
<div className="flex items-center p-4 overflow-hidden">
<div className="flex min-w-[60px] items-center justify-center flex-shrink-0">
<img src="/logo/mapache.png" className="h-10" />
</div>
<div
className={`whitespace-nowrap pl-4 ${props.isSidebarExpanded ? "slide-in" : "slide-out"}`}
className={`whitespace-nowrap pl-4 overflow-hidden ${props.isSidebarExpanded ? "slide-in" : "slide-out"}`}
>
<h2>Mapache</h2>
</div>
Expand Down Expand Up @@ -111,17 +111,17 @@ const Sidebar = (props: SidebarProps) => {
}}
>
<div
className={`flex w-full items-center rounded-md ${
className={`flex w-full items-center rounded-md overflow-hidden ${
props.isSelected ? "bg-card/50" : ""
} h-10 p-1 hover:bg-card`}
>
<div className="flex min-w-[60px] items-center justify-center">
<div className="flex min-w-[60px] items-center justify-center flex-shrink-0">
<props.icon
className={`${props.isSelected ? "text-white" : "text-neutral-400"}`}
/>
</div>
<div
className={`whitespace-nowrap font-semibold ${props.isSelected ? "text-white" : "text-neutral-400"} ${props.isSidebarExpanded ? "slide-in" : "slide-out"}`}
className={`whitespace-nowrap font-semibold overflow-hidden ${props.isSelected ? "text-white" : "text-neutral-400"} ${props.isSidebarExpanded ? "slide-in" : "slide-out"}`}
>
{props.text}
</div>
Expand All @@ -141,26 +141,26 @@ const Sidebar = (props: SidebarProps) => {
className={`mx-2 my-2 flex cursor-pointer items-center overflow-hidden rounded-lg bg-gradient-to-br from-gr-pink to-gr-purple bg-[length:100%_100%] p-[2px] transition-all duration-150`}
onClick={(e) => e.stopPropagation()}
>
<div className="flex h-12 w-full items-center rounded-lg bg-card/50 p-1 hover:bg-card">
<div className="flex min-w-[60px] items-center justify-center">
<div className="flex h-12 w-full items-center rounded-lg bg-card/50 p-1 hover:bg-card overflow-hidden">
<div className="flex min-w-[60px] items-center justify-center flex-shrink-0">
<VehicleClassIcon
vehicleClass={currentVehicle.type}
iconType={"pixel"}
/>
</div>
<div
className={`whitespace-nowrap font-semibold text-white ${props.isSidebarExpanded ? "slide-in" : "slide-out"}`}
className={`whitespace-nowrap font-semibold text-white overflow-hidden ${props.isSidebarExpanded ? "slide-in" : "slide-out"}`}
>
<div className="flex w-full items-center justify-between">
<div className="flex w-[160px] flex-col items-start justify-center">
<div className="text-sm font-semibold">
<div className="flex w-[160px] flex-col items-start justify-center overflow-hidden">
<div className="text-sm font-semibold truncate w-full">
{currentVehicle.name}
</div>
<div className="text-xs text-neutral-400">
<div className="text-xs text-neutral-400 truncate w-full">
{currentVehicle.id} • {currentVehicle.type}
</div>
</div>
<div className="flex items-center justify-center">
<div className="flex items-center justify-center flex-shrink-0">
<ChevronsUpDown />
</div>
</div>
Expand Down Expand Up @@ -286,4 +286,4 @@ const Sidebar = (props: SidebarProps) => {
);
};

export default Sidebar;
export default Sidebar;
5 changes: 4 additions & 1 deletion dashboard/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,8 @@
}

.slide-out {
animation: slideOut 0.3s ease forwards;
opacity: 0;
transform: translateX(-100%);
width: 0;
transition: all 0.3s ease;
}