Skip to content

Commit

Permalink
chore: consider font scale for menu item text
Browse files Browse the repository at this point in the history
  • Loading branch information
enesozturk committed Mar 3, 2021
1 parent 928c5c8 commit c17327d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ const MENU_TRANSFORM_ORIGIN_TOLERENCE = 10;

const IS_IOS = Platform.OS === 'ios';

const FONT_SCALE = Dimensions.get('screen').fontScale;

export {
CONTEXT_MENU_STATE,
WINDOW_HEIGHT,
Expand All @@ -48,4 +50,5 @@ export {
SPRING_CONFIGURATION_MENU,
MENU_TRANSFORM_ORIGIN_TOLERENCE,
IS_IOS,
FONT_SCALE,
};
11 changes: 9 additions & 2 deletions src/utils/calculations.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import styleGuide from '../styleGuide';
import { MENU_WIDTH, MENU_TRANSFORM_ORIGIN_TOLERENCE } from '../constants';
import {
MENU_WIDTH,
MENU_TRANSFORM_ORIGIN_TOLERENCE,
FONT_SCALE,
} from '../constants';

export const MenuItemHeight = () => {
'worklet';
return styleGuide.typography.callout.lineHeight + styleGuide.spacing * 2.5;
return (
styleGuide.typography.callout.lineHeight * FONT_SCALE +
styleGuide.spacing * 2.5
);
};

export const calculateMenuHeight = (
Expand Down

0 comments on commit c17327d

Please sign in to comment.