Skip to content

Commit

Permalink
Revert to themes/Theme named import
Browse files Browse the repository at this point in the history
  • Loading branch information
TimRoe committed Sep 5, 2024
1 parent 2ae18bf commit 6803880
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/components/src/utils/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Namespace import is required. Destructuring causes error in va-mobile-app See #390.
import * as Tokens from '@department-of-veterans-affairs/mobile-tokens'

import {
AccessibilityInfo,
ColorSchemeName,
Expand All @@ -9,6 +6,7 @@ import {
StyleProp,
ViewStyle,
} from 'react-native'
import { Theme, themes } from '@department-of-veterans-affairs/mobile-tokens'
import { useEffect, useState } from 'react'

/** Function to prefill base gray colors */
Expand All @@ -34,9 +32,9 @@ export function useColorScheme(): ColorSchemeName {
}

/** Returns light/dark theme based on useColorScheme */
export function useTheme(): Tokens.Theme {
export function useTheme(): Theme {
const themeName: ColorSchemeName = useColorScheme() || 'light'
return Tokens.themes[themeName]
return themes[themeName]
}

/**
Expand Down

0 comments on commit 6803880

Please sign in to comment.