Skip to content

Commit

Permalink
✨ feat: 新增基础的 useToken 方法
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Jan 1, 2023
1 parent 1a0539d commit 95d77fd
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
5 changes: 0 additions & 5 deletions src/index.test.ts

This file was deleted.

5 changes: 2 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export const hello = () => {
return 'world';
};
export * from './types';
export * from './useToken';
3 changes: 3 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import type { AliasToken } from 'antd/es/theme/interface';

export type AntdToken = AliasToken;
9 changes: 9 additions & 0 deletions src/useToken.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { theme } from 'antd';

import { AntdToken } from './types';

export const useToken = (): AntdToken => {
const { token } = theme.useToken();

return token;
};

0 comments on commit 95d77fd

Please sign in to comment.