Update message context menu styles (#10487)

This commit is contained in:
DS Boyce
2026-05-15 09:28:26 -07:00
committed by GitHub
parent b41dbec48f
commit 8756c6c0ac
3 changed files with 12 additions and 5 deletions
+9 -5
View File
@@ -761,6 +761,7 @@ export function Item({
style, style,
onPress, onPress,
position, position,
destructive = false,
...rest ...rest
}: ItemProps) { }: ItemProps) {
const t = useTheme() const t = useTheme()
@@ -819,8 +820,8 @@ export function Item({
) )
const itemContext = useMemo( const itemContext = useMemo(
() => ({disabled: Boolean(rest.disabled)}), () => ({disabled: Boolean(rest.disabled), destructive}),
[rest.disabled], [rest.disabled, destructive],
) )
return ( return (
@@ -872,7 +873,7 @@ export function Item({
export function ItemText({children, style}: ItemTextProps) { export function ItemText({children, style}: ItemTextProps) {
const t = useTheme() const t = useTheme()
const {disabled} = useContextMenuItemContext() const {disabled, destructive} = useContextMenuItemContext()
return ( return (
<Text <Text
numberOfLines={2} numberOfLines={2}
@@ -883,6 +884,7 @@ export function ItemText({children, style}: ItemTextProps) {
a.font_semi_bold, a.font_semi_bold,
t.atoms.text_contrast_high, t.atoms.text_contrast_high,
style, style,
destructive && {color: t.palette.negative_500},
disabled && t.atoms.text_contrast_low, disabled && t.atoms.text_contrast_low,
]}> ]}>
{children} {children}
@@ -892,14 +894,16 @@ export function ItemText({children, style}: ItemTextProps) {
export function ItemIcon({icon: Comp}: ItemIconProps) { export function ItemIcon({icon: Comp}: ItemIconProps) {
const t = useTheme() const t = useTheme()
const {disabled} = useContextMenuItemContext() const {disabled, destructive} = useContextMenuItemContext()
return ( return (
<Comp <Comp
size="lg" size="lg"
fill={ fill={
disabled disabled
? t.atoms.text_contrast_low.color ? t.atoms.text_contrast_low.color
: t.atoms.text_contrast_medium.color : destructive
? t.palette.negative_500
: t.atoms.text_contrast_medium.color
} }
/> />
) )
+1
View File
@@ -70,6 +70,7 @@ export type MenuContextType = {
export type ItemContextType = { export type ItemContextType = {
disabled: boolean disabled: boolean
destructive: boolean
} }
export type TriggerProps = { export type TriggerProps = {
@@ -162,6 +162,7 @@ export let MessageContextMenu = ({
</> </>
)} )}
<ContextMenu.Item <ContextMenu.Item
destructive
testID="messageDropdownDeleteBtn" testID="messageDropdownDeleteBtn"
label={l`Delete message for me`} label={l`Delete message for me`}
onPress={() => deleteControl.open()}> onPress={() => deleteControl.open()}>
@@ -170,6 +171,7 @@ export let MessageContextMenu = ({
</ContextMenu.Item> </ContextMenu.Item>
{!isFromSelf && ( {!isFromSelf && (
<ContextMenu.Item <ContextMenu.Item
destructive
testID="messageDropdownReportBtn" testID="messageDropdownReportBtn"
label={l`Report message`} label={l`Report message`}
onPress={() => reportControl.open()}> onPress={() => reportControl.open()}>