Skip to content

Commit

Permalink
Merge pull request #30159 from software-mansion-labs/ts-migration/get…
Browse files Browse the repository at this point in the history
…-context-menu-item-styles

[No QA] [TS migration] Migrate 'getContextMenuItemStyles' style to TypeScript
  • Loading branch information
Hayata Suenaga authored Nov 8, 2023
2 parents e25d03a + 29423c8 commit e1c98cb
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 12 deletions.
9 changes: 0 additions & 9 deletions src/styles/getContextMenuItemStyles/index.js

This file was deleted.

3 changes: 0 additions & 3 deletions src/styles/getContextMenuItemStyles/index.native.js

This file was deleted.

6 changes: 6 additions & 0 deletions src/styles/getContextMenuItemStyles/index.native.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import styles from '@styles/styles';
import GetContextMenuItemStyle from './types';

const getContextMenuItemStyle: GetContextMenuItemStyle = () => [styles.popoverMenuItem];

export default getContextMenuItemStyle;
12 changes: 12 additions & 0 deletions src/styles/getContextMenuItemStyles/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import styles from '@styles/styles';
import variables from '@styles/variables';
import GetContextMenuItemStyle from './types';

const GetContextMenuItemStyles: GetContextMenuItemStyle = (windowWidth) => {
if (windowWidth && windowWidth > variables.mobileResponsiveWidthBreakpoint) {
return [styles.popoverMenuItem, styles.contextMenuItemPopoverMaxWidth];
}
return [styles.popoverMenuItem];
};

export default GetContextMenuItemStyles;
5 changes: 5 additions & 0 deletions src/styles/getContextMenuItemStyles/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import {ViewStyle} from 'react-native';

type GetContextMenuItemStyle = (windowWidth?: number) => ViewStyle[];

export default GetContextMenuItemStyle;

0 comments on commit e1c98cb

Please sign in to comment.