Skip to content

Commit

Permalink
[TS migration] Migrate 'getContextMenuItemStyles' style to TypeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
BartoszGrajdek committed Oct 23, 2023
1 parent 1ff328b commit 3d30bef
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/styles/getContextMenuItemStyles/index.native.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import styles from '../styles';
import GetContextMenuItemStyle from './types';

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

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

export default (windowWidth) => {
if (windowWidth > variables.mobileResponsiveWidthBreakpoint) {
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 3d30bef

Please sign in to comment.