Skip to content

Commit

Permalink
chore: common types, add iosIconConfiguration property
Browse files Browse the repository at this point in the history
  • Loading branch information
fobos531 committed Sep 29, 2022
1 parent 3fdc4c6 commit 69cab8c
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions packages/zeego/src/menu/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Text, View, ImageRequireSource, ImageProps } from 'react-native'
import type { MenuContentProps as RadixContentProps } from '@radix-ui/react-dropdown-menu'
import type { ContextMenuView } from 'react-native-ios-context-menu'
import type { ImageSystemConfig } from 'react-native-ios-context-menu/lib/typescript/types/ImageItemConfig'

type ViewStyle = React.ComponentProps<typeof View>['style']
type TextStyle = React.ComponentProps<typeof Text>['style']
Expand Down Expand Up @@ -56,39 +57,38 @@ export type MenuItemProps = (
key: string
}

export type MenuItemIconProps = {
export interface MenuItemCommonProps {
/**
* The name of an iOS-only SF Symbol. For a full list, see https://developer.apple.com/sf-symbols/.
*
* @platform ios
*/
iosIconName?: string
/**
* Custom configuration for the SF Symbol icon provided by `iosIconName`. This can be used for iOS15+
* features like weight, scale, colors etc. The options correspond to the ImageSystemConfig in
* react-native-ios-context-menu
*
* @platform ios
*/
iosIconConfiguration?: ImageSystemConfig
/**
* The name of an android-only resource drawable. For a full list, see https://developer.android.com/reference/android/R.drawable.html.
*
* @platform android
*/
androidIconName?: string
}

export type MenuItemIconProps = MenuItemCommonProps & {
/**
* You can also pass the icon as a React Native component child. This will only work on Web, not iOS or android.
*/
children?: React.ReactNode
style?: ViewStyle
}

export type MenuItemImageProps = {
/**
* The name of an iOS-only SF Symbol. For a full list, see https://developer.apple.com/sf-symbols/.
*
* @platform ios
*/
iosIconName?: string
/**
* The name of an android-only resource drawable. For a full list, see https://developer.android.com/reference/android/R.drawable.html.
*
* @platform android
*/
androidIconName?: string
export type MenuItemImageProps = MenuItemCommonProps & {
/**
* `source={require('path/to/image')}`
*/
Expand Down

0 comments on commit 69cab8c

Please sign in to comment.