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
  • Loading branch information
thienlnam authored Jul 13, 2021
2 parents 5b90ea6 + 993be46 commit d0c9578
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 d0c9578

Please sign in to comment.