2022-06-28 15:38:30 +08:00
|
|
|
/* eslint-disable import/prefer-default-export */
|
2022-06-29 20:34:00 +08:00
|
|
|
import { useToken as useInternalToken } from '.';
|
|
|
|
import defaultAlgorithm from './themes/default';
|
|
|
|
import darkAlgorithm from './themes/dark';
|
2022-06-28 15:38:30 +08:00
|
|
|
|
|
|
|
// ZombieJ: We export as object to user but array in internal.
|
|
|
|
// This is used to minimize the bundle size for antd package but safe to refactor as object also.
|
|
|
|
// Please do not export internal `useToken` directly to avoid something export unexpected.
|
2022-06-29 20:34:00 +08:00
|
|
|
/** Get current context Design Token. Will be different if you using nest theme config. */
|
|
|
|
function useToken() {
|
|
|
|
const [theme, token, hashId] = useInternalToken();
|
2022-06-28 15:38:30 +08:00
|
|
|
|
|
|
|
return { theme, token, hashId };
|
|
|
|
}
|
2022-06-29 20:34:00 +08:00
|
|
|
|
|
|
|
export default {
|
|
|
|
useToken,
|
|
|
|
defaultAlgorithm,
|
|
|
|
darkAlgorithm,
|
|
|
|
};
|