Skip to content

Commit 3645f46

Browse files
committed
feat: extract ITab interface to tabComponent
1 parent c2bf6b0 commit 3645f46

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

src/components/tabs/index.tsx

+1-12
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,9 @@ import {
1111
classNames,
1212
} from 'mo/common/className';
1313

14-
import { Tab, tabItemClassName } from './tab';
14+
import { Tab, ITab, tabItemClassName } from './tab';
1515

1616
import './style.scss';
17-
export interface ITab {
18-
path?: string;
19-
key?: string;
20-
name?: string;
21-
modified?: boolean;
22-
value?: string;
23-
language?: string | undefined;
24-
tip?: string | React.ReactNode;
25-
label?: React.ReactNode;
26-
renderPanel?: React.ReactNode;
27-
}
2817

2918
export type TabsType = 'line' | 'card';
3019
export interface ITabsProps {

src/components/tabs/tab.tsx

+12
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@ import {
1616
} from 'mo/common/className';
1717
import TabDot from './tabDot';
1818

19+
export interface ITab {
20+
path?: string;
21+
key?: string;
22+
name?: string;
23+
modified?: boolean;
24+
value?: string;
25+
language?: string | undefined;
26+
tip?: string | React.ReactNode;
27+
label?: React.ReactNode;
28+
renderPanel?: React.ReactNode;
29+
}
30+
1931
export const tabClassName = prefixClaName('tab');
2032
export const tabItemClassName = getBEMElement(tabClassName, 'item');
2133

src/model/workbench/editor.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import 'reflect-metadata';
22
import { EventBus } from 'mo/common/event';
33
import { observable } from 'mo/common/observable';
4-
import { ITab } from 'mo/components/tabs';
4+
import { ITab } from 'mo/components/tabs/tab';
55
import { container, inject, injectable } from 'tsyringe';
66

77
export enum EditorEvent {

src/services/workbench/editorService.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { singleton, container } from 'tsyringe';
22

33
import { Component } from 'mo/react';
44
import { emit } from 'mo/common/event';
5-
import { ITab } from 'mo/components/tabs';
5+
import { ITab } from 'mo/components/tabs/tab';
66
import {
77
EditorEvent,
88
EditorModel,

0 commit comments

Comments
 (0)