Skip to content

Commit

Permalink
feat: useToken - same values provided in style.ts, without requiring …
Browse files Browse the repository at this point in the history
…extra documentation or scripts
  • Loading branch information
ajenkins-mparticle committed Nov 11, 2024
1 parent c2842ac commit 58051ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,4 @@ export {
type INewExperienceReminderOptions,
type NewExperienceReminderHook,
} from '../hooks/NewExperienceReminder/useNewExperienceReminder'
export * from '../hooks/useToken'
5 changes: 5 additions & 0 deletions src/hooks/useToken.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import type { GlobalToken } from 'antd'
import { theme } from 'antd'

export const useTokens = () => theme.useToken().token
export const useToken = (token: keyof GlobalToken) => useTokens()[token]

0 comments on commit 58051ce

Please sign in to comment.