Update context menu presentation (#10426)

This commit is contained in:
DS Boyce
2026-05-07 13:24:55 -07:00
committed by GitHub
parent 10cb0dbf21
commit 9a2cabf64c
12 changed files with 115 additions and 153 deletions
+51 -1
View File
@@ -1,6 +1,25 @@
import {type StyleProp, type ViewStyle} from 'react-native'
import {atoms as a, useTheme} from '#/alf'
import * as Menu from '#/components/Menu'
import {Text} from '#/components/Typography'
import {type AuxiliaryViewProps} from './types'
export * from '#/components/Menu'
export {
ContainerItem,
type MenuControlProps as ContextMenuControlProps,
Divider,
Group,
Item,
ItemIcon,
ItemRadio,
ItemText,
LabelText,
Root,
Trigger,
useMenuContext as useContextMenuContext,
useMenuControl as useContextMenuControl,
} from '#/components/Menu'
export function Provider({children}: {children: React.ReactNode}) {
return children
@@ -10,3 +29,34 @@ export function Provider({children}: {children: React.ReactNode}) {
export function AuxiliaryView({}: AuxiliaryViewProps) {
return null
}
export function Outer({
children,
label,
style,
}: {
children: React.ReactNode
label?: string
style?: StyleProp<ViewStyle>
}) {
const t = useTheme()
return (
<Menu.Outer style={style}>
{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>
)
}