Skip to content

Commit

Permalink
Merge pull request #101 from etn-ccis/fix/font-family-name
Browse files Browse the repository at this point in the history
font families are case sensitive
  • Loading branch information
ektaghag-eaton authored Apr 19, 2024
2 parents d9ff9c4 + d9e5981 commit b402b68
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@brightlayer-ui/react-native-themes",
"author": "Brightlayer UI <[email protected]>",
"license": "BSD-3-Clause",
"version": "7.0.1-alpha.3",
"version": "7.0.1-alpha.4",
"description": "React Native themes for Brightlayer UI applications",
"main": "./dist/index.js",
"scripts": {
Expand Down
15 changes: 10 additions & 5 deletions src/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ export type ExtendedTheme = Omit<MD3Theme, 'colors'> & {
export const useExtendedTheme = (overrides?: $DeepPartial<ExtendedTheme>): ExtendedTheme =>
useTheme<ExtendedTheme>(overrides);

export type bluiFontWeight = '300' | '400' | '600' | '700' | undefined;
export type bluiFontWeight = '300' | '400' | '600' | '700' | '800' | undefined;

export type FontStyle = {
fontFamily: string;
Expand All @@ -240,24 +240,29 @@ export const useFontWeight = (weight: bluiFontWeight): FontStyle => {
switch (weight) {
case '300':
return {
fontFamily: 'OpenSans-light',
fontFamily: 'OpenSans-Light',
fontWeight: '300',
};
case '400':
return {
fontFamily: 'OpenSans-regular',
fontFamily: 'OpenSans-Regular',
fontWeight: '400',
};
case '600':
return {
fontFamily: 'OpenSans-semiBold',
fontFamily: 'OpenSans-SemiBold',
fontWeight: '600',
};
case '700':
return {
fontFamily: 'OpenSans-bold',
fontFamily: 'OpenSans-Bold',
fontWeight: '700',
};
case '800':
return {
fontFamily: 'OpenSans-ExtraBold',
fontWeight: '800',
};
default:
throw new Error(`Invalid font weight: ${weight}`);
}
Expand Down

0 comments on commit b402b68

Please sign in to comment.