Skip to content

Commit

Permalink
Add console.warn() about the deprecation and change double quotes to…
Browse files Browse the repository at this point in the history
… single
  • Loading branch information
Maja Klajić committed Jul 31, 2020
1 parent 7951be9 commit 20d24d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import getTheme, {
defaultThemeVariables,
dimensionRelativeToIphone,
calculateLineHeight,
} from "./theme";
} from './theme';

setDefaultThemeStyle();

Expand Down
6 changes: 5 additions & 1 deletion theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,16 @@ export function dimensionRelativeToIphone(dimension, actualRefVal = window.width
return getSizeRelativeToReference(dimension, 375, actualRefVal);
}

// This function is depricated and replaced with calculateLineHeight.
// This function is deprecated and replaced with calculateLineHeight.
// It remains present here because of the backward compatibility.
export function formatLineHeight(fontSize) {
// adds required padding to lineHeight to support
// different alphabets (Kanji, Greek, etc.)

console.warn(
"formatLineHeight is deprecated and will be removed. Please use calculateLineHeight instead, it can simply be renamed as it takes the same argument and returns the same expected value, but more consistently across all fontSize."
);

if (fontSize < 22) {
// minimum lineHeight for different alphabets is 25
return 25;
Expand Down

0 comments on commit 20d24d0

Please sign in to comment.