Something went wrong. Try again.
Bluesky app fork with some witchin' additions 💫 forked from jollywhoppers.com/witchsky.app
Something went wrong. Try again.
2.2 kB · 87 lines
TSX
at main
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788import {type StyleProp, type ViewStyle} from 'react-native'
import {atoms as a, useTheme} from '#/alf'import * as Menu from '#/components/Menu'import {type TriggerProps as MenuTriggerProps} from '#/components/Menu/types'import {Text} from '#/components/Typography'import {type AuxiliaryViewProps, type TriggerProps} from './types'
export { ContainerItem, type MenuControlProps as ContextMenuControlProps, Divider, Group, Item, ItemIcon, ItemRadio, ItemText, LabelText, Root, useMenuContext as useContextMenuContext, useMenuControl as useContextMenuControl,} from '#/components/Menu'
export function Provider({children}: {children: React.ReactNode}) { return children}
// native onlyexport function AuxiliaryView({}: AuxiliaryViewProps) { return null}
/* * On web the context menu is just a Menu; contentLabel, onTap, style, and * swipeGesture only apply to the native press-and-hold presentation. */export function Trigger({children, label, hint, role}: TriggerProps) { return ( <Menu.Trigger label={label} hint={hint} role={role}> {/* * Menu supplies the same web-arm child props shape as ContextMenu's * TriggerChildProps; only the native arms of the two unions differ, * and those never occur here. */} {children as unknown as MenuTriggerProps['children']} </Menu.Trigger> )}
export function Outer({ children, label, align: _align, style, onCloseAutoFocus,}: { children: React.ReactNode label?: string /** * Native positions the menu against the message bubble explicitly; the web * dropdown is anchored by radix, so this is accepted only for parity. */ align?: 'left' | 'right' style?: StyleProp<ViewStyle> onCloseAutoFocus?: (event: Event) => void}) { const t = useTheme() return ( <Menu.Outer style={style} onCloseAutoFocus={onCloseAutoFocus}> {label ? ( <Text numberOfLines={1} style={[ a.pl_sm, a.pt_md, a.pr_lg, a.pb_md, a.text_xs, t.atoms.text_contrast_medium, ]}> {label} </Text> ) : null} {children} </Menu.Outer> )}