|
@@ -14,6 +14,7 @@ import {
|
|
|
SortableContext,
|
|
SortableContext,
|
|
|
sortableKeyboardCoordinates,
|
|
sortableKeyboardCoordinates,
|
|
|
} from "@dnd-kit/sortable";
|
|
} from "@dnd-kit/sortable";
|
|
|
|
|
+import { theme } from "antd";
|
|
|
import { usePathname } from "next/navigation";
|
|
import { usePathname } from "next/navigation";
|
|
|
import type React from "react";
|
|
import type React from "react";
|
|
|
import { useEffect, useRef } from "react";
|
|
import { useEffect, useRef } from "react";
|
|
@@ -31,6 +32,10 @@ const TabBar: React.FC = () => {
|
|
|
const getBreadcrumb = useMenuStore((state) => state.getBreadcrumb);
|
|
const getBreadcrumb = useMenuStore((state) => state.getBreadcrumb);
|
|
|
const reorderTabs = useTabStore((state) => state.reorderTabs);
|
|
const reorderTabs = useTabStore((state) => state.reorderTabs);
|
|
|
|
|
|
|
|
|
|
+ const {
|
|
|
|
|
+ token: { colorBorder },
|
|
|
|
|
+ } = theme.useToken();
|
|
|
|
|
+
|
|
|
const containerRef = useRef<HTMLDivElement>(null);
|
|
const containerRef = useRef<HTMLDivElement>(null);
|
|
|
|
|
|
|
|
// Setup sensors for drag and drop
|
|
// Setup sensors for drag and drop
|
|
@@ -122,18 +127,14 @@ const TabBar: React.FC = () => {
|
|
|
>
|
|
>
|
|
|
<div
|
|
<div
|
|
|
ref={containerRef}
|
|
ref={containerRef}
|
|
|
|
|
+ className="tab-bar flex items-center p-2 px-4"
|
|
|
style={{
|
|
style={{
|
|
|
- display: "flex",
|
|
|
|
|
- alignItems: "center",
|
|
|
|
|
- padding: "8px 16px",
|
|
|
|
|
- backgroundColor: "#f0f0f0",
|
|
|
|
|
- borderBottom: "1px solid #d9d9d9",
|
|
|
|
|
|
|
+ borderBottom: `1px solid ${colorBorder}`,
|
|
|
overflowX: "auto",
|
|
overflowX: "auto",
|
|
|
overflowY: "hidden",
|
|
overflowY: "hidden",
|
|
|
whiteSpace: "nowrap",
|
|
whiteSpace: "nowrap",
|
|
|
scrollBehavior: "smooth",
|
|
scrollBehavior: "smooth",
|
|
|
}}
|
|
}}
|
|
|
- className="tab-bar"
|
|
|
|
|
>
|
|
>
|
|
|
{tabs.map((tab) => (
|
|
{tabs.map((tab) => (
|
|
|
<Tab key={tab.key} tab={tab} active={activeTab?.key === tab.key} />
|
|
<Tab key={tab.key} tab={tab} active={activeTab?.key === tab.key} />
|