Skip to content

Commit

Permalink
Adjust css and add memo
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszmigas committed Mar 3, 2024
1 parent fb65540 commit f7ba745
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions apps/web/src/components/appHeaderBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { IconButton } from "./iconButton";
import { Button } from "./ui/button";
import { cn } from "@/utils/css";
import { useWorkspacesStore } from "@/store";
import { memo } from "react";

const WorkspaceTab = (props: {
index: number;
Expand All @@ -17,7 +18,7 @@ const WorkspaceTab = (props: {
return (
<Button
className={cn(
"border-b-4 h-full text-sm hover:text-primary py-[6px] rounded-none",
"border-b-4 h-8 text-sm hover:text-primary pt-1 rounded-none",
isSelected ? "border-primary" : "border-transparent"
)}
variant="ghost"
Expand All @@ -29,14 +30,14 @@ const WorkspaceTab = (props: {
);
};

export const AppHeaderBar = () => {
export const AppHeaderBar = memo(() => {
const { workspaces, selectedWorkspaceIndex, addWorkspace } =
useWorkspacesStore((state) => state);

return (
<div className="border-b flex flex-row justify-between items-center px-small gap-big">
<MenuBar />
<div className="flex-1 flex flex-row justify-center overflow-auto">
<div className="flex-1 flex flex-row justify-center overflow-auto items-center">
<ScrollArea className="whitespace-nowrap">
<div className="h-full flex-row flex items-center">
{workspaces.map((tab, index) => (
Expand All @@ -55,5 +56,5 @@ export const AppHeaderBar = () => {
<ModeToggle />
</div>
);
};
});

0 comments on commit f7ba745

Please sign in to comment.