|
|
@@ -1,10 +1,10 @@
|
|
|
"use client";
|
|
|
|
|
|
import { CloseOutlined } from "@ant-design/icons";
|
|
|
-import type { MenuProps } from "antd";
|
|
|
-import { Dropdown } from "antd";
|
|
|
import { useSortable } from "@dnd-kit/sortable";
|
|
|
import { CSS } from "@dnd-kit/utilities";
|
|
|
+import type { MenuProps } from "antd";
|
|
|
+import { Dropdown, theme } from "antd";
|
|
|
import { useRouter } from "next/navigation";
|
|
|
import type React from "react";
|
|
|
import { useMemo } from "react";
|
|
|
@@ -24,6 +24,16 @@ const Tab: React.FC<TabProps> = ({ tab, active }) => {
|
|
|
);
|
|
|
const setActiveTab = useTabStore((state) => state.setActiveTab);
|
|
|
|
|
|
+ const {
|
|
|
+ token: {
|
|
|
+ colorPrimary,
|
|
|
+ colorBgContainer,
|
|
|
+ colorText,
|
|
|
+ colorTextLightSolid,
|
|
|
+ colorBorder,
|
|
|
+ },
|
|
|
+ } = theme.useToken();
|
|
|
+
|
|
|
// Setup drag and drop (disable for home tab)
|
|
|
const {
|
|
|
attributes,
|
|
|
@@ -129,10 +139,10 @@ const Tab: React.FC<TabProps> = ({ tab, active }) => {
|
|
|
marginRight: "4px",
|
|
|
cursor: tab.closable ? "grab" : "pointer",
|
|
|
borderRadius: "4px",
|
|
|
- backgroundColor: active ? "#1890ff" : "#fff",
|
|
|
- color: active ? "#fff" : "#000",
|
|
|
+ backgroundColor: active ? colorPrimary : colorBgContainer,
|
|
|
+ color: active ? colorTextLightSolid : colorText,
|
|
|
border: "1px solid",
|
|
|
- borderColor: active ? "#1890ff" : "#d9d9d9",
|
|
|
+ borderColor: active ? colorPrimary : colorBorder,
|
|
|
transition: "all 0.3s",
|
|
|
userSelect: "none",
|
|
|
whiteSpace: "nowrap",
|