Skip to content

Commit

Permalink
Merge pull request #3966 from Expensify/Rory-FixLineHeight
Browse files Browse the repository at this point in the history
Only provide a default lineHeight when the fontSize is default

(cherry picked from commit d0c9578)
  • Loading branch information
thienlnam authored and OSBotify committed Jul 13, 2021
1 parent fee2b00 commit 3d07b7a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/Text.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,15 @@ const Text = React.forwardRef(({
const componentStyle = {
color,
fontSize,
lineHeight: 20,
textAlign,
fontFamily: fontFamily[family],
...mergedStyles,
};

if (componentStyle.fontSize === variables.fontSizeNormal) {
componentStyle.lineHeight = 20;
}

return (
// eslint-disable-next-line react/jsx-props-no-spreading
<RNText ref={ref} style={[componentStyle]} {...props}>{children}</RNText>
Expand Down

0 comments on commit 3d07b7a

Please sign in to comment.