Skip to content

Commit e547d84

Browse files
committed
Fix font weight text
1 parent 3f5ef9b commit e547d84

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

packages/carbon-react-native/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@audira/carbon-react-native",
3-
"version": "1.0.0-beta.23",
3+
"version": "1.0.0-beta.24",
44
"license": "MIT",
55
"homepage": "https://rakadoank.github.io/carbon-react-native",
66
"repository": "https://github.com/RakaDoank/carbon-react-native",

packages/carbon-react-native/src/components/text/Text.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,17 +121,24 @@ function getTextStyle(
121121
return null
122122
}
123123

124+
const
125+
typographyStyle =
126+
TypographyStyleSheet[type],
127+
128+
weight =
129+
StyleSheetObj.Typography[type].fontWeight
130+
124131
if(italic && overrideWeight) {
125-
return [TypographyStyleSheet[type], mapFamilyItalicStyle[overrideWeight]]
132+
return [typographyStyle, mapFamilyItalicStyle[overrideWeight]]
126133
}
127134

128135
if(italic) {
129-
return [TypographyStyleSheet[type], mapFamilyItalicStyle[StyleSheetObj.Typography[type].fontWeight]]
136+
return [typographyStyle, mapFamilyItalicStyle[weight]]
130137
}
131138

132139
if(overrideWeight) {
133-
return [TypographyStyleSheet[type], mapFamilyStyle[overrideWeight]]
140+
return [typographyStyle, mapFamilyStyle[overrideWeight]]
134141
}
135142

136-
return TypographyStyleSheet[type]
143+
return [typographyStyle, mapFamilyStyle[weight]]
137144
}

0 commit comments

Comments
 (0)