8a48765a46
集中保留原版权声明,移除文件头检查和全局测试忽略规则。验证:全量单测、受影响用例复测及静态检查通过。
27 lines
874 B
React
27 lines
874 B
React
import { createContext, useContext } from 'react';
|
|
import { theme } from 'antd';
|
|
|
|
export function useConsoleThemeStyle() {
|
|
const { token } = theme.useToken();
|
|
return {
|
|
'--console-surface': token.colorBgContainer,
|
|
'--console-bg': token.colorBgLayout,
|
|
'--console-heading': token.colorTextHeading,
|
|
'--console-text': token.colorText,
|
|
'--console-muted': token.colorTextSecondary,
|
|
'--console-border': token.colorBorderSecondary,
|
|
'--console-fill': token.colorFillAlter,
|
|
'--console-primary': token.colorPrimary,
|
|
};
|
|
}
|
|
|
|
export const ConsoleContext = createContext(null);
|
|
export const useConsolePage = () => useContext(ConsoleContext);
|
|
export const ConsoleSearchContext = createContext(false);
|
|
export const useConsoleControlSize = (size) =>
|
|
useContext(ConsoleSearchContext)
|
|
? 'middle'
|
|
: size === 'default'
|
|
? 'middle'
|
|
: size;
|