💫 WIP: Context Menu Auxiliary Preview

Summary: Expose `auxiliaryPreviewConfig` via props.
This commit is contained in:
Dominic Go 2022-05-01 06:07:08 +08:00
parent b1208deb27
commit 4b286a093c
3 changed files with 6 additions and 0 deletions

View File

@ -46,6 +46,7 @@ export class ContextMenuView extends
useActionSheetFallback,
menuConfig,
previewConfig,
auxiliaryPreviewConfig,
shouldUseDiscoverabilityTitleAsFallbackValueForSubtitle,
// event props
onMenuWillShow,
@ -77,6 +78,7 @@ export class ContextMenuView extends
// B. Pass down props...
menuConfig,
previewConfig,
auxiliaryPreviewConfig,
onMenuWillShow,
onMenuWillHide,
onMenuWillCancel,
@ -224,6 +226,7 @@ export class ContextMenuView extends
ref={r => { this.nativeRef = r! }}
menuConfig={props.menuConfig}
previewConfig={props.previewConfig}
auxiliaryPreviewConfig={props.auxiliaryPreviewConfig}
// Events: `onPress`-Related
onMenuWillShow={this._handleOnMenuWillShow}

View File

@ -9,6 +9,7 @@ export type RenderItem = () => React.ReactElement;
export type ContextMenuViewBaseProps = Pick<RNIContextMenuViewProps,
| 'menuConfig'
| 'previewConfig'
| 'auxiliaryPreviewConfig'
| 'shouldUseDiscoverabilityTitleAsFallbackValueForSubtitle'
| 'isContextMenuEnabled'
// Lifecycle Events

View File

@ -2,6 +2,7 @@ import { requireNativeComponent, Platform, ViewProps, HostComponent, View } from
import type { MenuConfig } from '../types/MenuConfig';
import type { MenuPreviewConfig } from '../types/MenuPreviewConfig';
import type { MenuAuxiliaryPreviewConfig } from '../types/MenuAuxiliaryPreviewConfig';
import type { OnMenuWillShowEvent, OnMenuWillHideEvent, OnMenuDidShowEvent, OnMenuDidHideEvent, OnMenuWillCancelEvent, OnMenuDidCancelEvent, OnMenuWillCreateEvent, OnPressMenuItemEvent, OnPressMenuPreviewEvent, } from '../types/MenuEvents';
@ -13,6 +14,7 @@ export type RNIContextMenuViewProps = ViewProps & {
menuConfig?: MenuConfig;
previewConfig?: MenuPreviewConfig;
auxiliaryPreviewConfig?: MenuAuxiliaryPreviewConfig;
/**
* On iOS 15+, the `MenuActionConfig.discoverabilityTitle` is no longer