diff --git a/eslint-suppressions.json b/eslint-suppressions.json index 3e3fd54262..87306cec64 100644 --- a/eslint-suppressions.json +++ b/eslint-suppressions.json @@ -74,11 +74,6 @@ "count": 1 } }, - "src/components/Menu/index.web.tsx": { - "@typescript-eslint/no-explicit-any": { - "count": 1 - } - }, "src/components/Menu/types.ts": { "@typescript-eslint/no-explicit-any": { "count": 1 diff --git a/src/components/Menu/index.tsx b/src/components/Menu/index.tsx index 65d279e196..30cfce3593 100644 --- a/src/components/Menu/index.tsx +++ b/src/components/Menu/index.tsx @@ -120,7 +120,14 @@ export function Outer({ ) } -export function Item({children, label, style, onPress, ...rest}: ItemProps) { +export function Item({ + children, + label, + style, + onPress, + destructive = false, + ...rest +}: ItemProps) { const t = useTheme() const context = useMenuContext() const {state: focused, onIn: onFocus, onOut: onBlur} = useInteractionState() @@ -137,7 +144,7 @@ export function Item({children, label, style, onPress, ...rest}: ItemProps) { accessibilityLabel={label} onFocus={onFocus} onBlur={onBlur} - onPress={async e => { + onPress={e => { if (IS_ANDROID) { /** * Below fix for iOS doesn't work for Android, this does. @@ -176,7 +183,8 @@ export function Item({children, label, style, onPress, ...rest}: ItemProps) { style, (focused || pressed) && !rest.disabled && [t.atoms.bg_contrast_50], ]}> - + {children} @@ -185,7 +193,7 @@ export function Item({children, label, style, onPress, ...rest}: ItemProps) { export function ItemText({children, style}: ItemTextProps) { const t = useTheme() - const {disabled} = useMenuItemContext() + const {disabled, destructive} = useMenuItemContext() return ( {children} @@ -205,7 +214,7 @@ export function ItemText({children, style}: ItemTextProps) { export function ItemIcon({icon: Comp, fill}: ItemIconProps) { const t = useTheme() - const {disabled} = useMenuItemContext() + const {disabled, destructive} = useMenuItemContext() return ( ) diff --git a/src/components/Menu/index.web.tsx b/src/components/Menu/index.web.tsx index ecb74a19e2..80b3915d77 100644 --- a/src/components/Menu/index.web.tsx +++ b/src/components/Menu/index.web.tsx @@ -107,7 +107,7 @@ const RadixTriggerPassThrough = forwardRef( props: { children: ( props: RadixPassThroughTriggerProps & { - ref: React.Ref + ref: React.Ref }, ) => React.ReactNode }, @@ -225,7 +225,14 @@ export function Outer({ ) } -export function Item({children, label, onPress, style, ...rest}: ItemProps) { +export function Item({ + children, + label, + onPress, + style, + destructive = false, + ...rest +}: ItemProps) { const t = useTheme() const {control} = useMenuContext() const { @@ -278,7 +285,8 @@ export function Item({children, label, onPress, style, ...rest}: ItemProps) { onMouseEnter, onMouseLeave, })}> - + {children} @@ -288,7 +296,7 @@ export function Item({children, label, onPress, style, ...rest}: ItemProps) { export function ItemText({children, style}: ItemTextProps) { const t = useTheme() - const {disabled} = useMenuItemContext() + const {disabled, destructive} = useMenuItemContext() return ( {children} @@ -305,7 +314,7 @@ export function ItemText({children, style}: ItemTextProps) { export function ItemIcon({icon: Comp, position = 'left', fill}: ItemIconProps) { const t = useTheme() - const {disabled} = useMenuItemContext() + const {disabled, destructive} = useMenuItemContext() return ( diff --git a/src/components/Menu/types.ts b/src/components/Menu/types.ts index 8f597f375f..c0f7e50a42 100644 --- a/src/components/Menu/types.ts +++ b/src/components/Menu/types.ts @@ -15,6 +15,7 @@ export type ContextType = { export type ItemContextType = { disabled: boolean + destructive: boolean } export type RadixPassThroughTriggerProps = { @@ -99,6 +100,7 @@ export type ItemProps = React.PropsWithChildren< ViewStyleProp & { label: string onPress: (e: GestureResponderEvent) => void + destructive?: boolean } > diff --git a/src/screens/Messages/ConversationSettings/MemberMenu.tsx b/src/screens/Messages/ConversationSettings/MemberMenu.tsx index 127a474239..4d82d5169d 100644 --- a/src/screens/Messages/ConversationSettings/MemberMenu.tsx +++ b/src/screens/Messages/ConversationSettings/MemberMenu.tsx @@ -18,6 +18,7 @@ import {DotGrid3x1_Stroke2_Corner0_Rounded as EllipsisIcon} from '#/components/i import {Message_Stroke2_Corner0_Rounded as MessageIcon} from '#/components/icons/Message' import { Person_Stroke2_Corner2_Rounded as PersonIcon, + PersonCheck_Stroke2_Corner0_Rounded as PersonCheck, PersonX_Stroke2_Corner0_Rounded as PersonXIcon, } from '#/components/icons/Person' import * as Menu from '#/components/Menu' @@ -180,29 +181,30 @@ export function MemberMenu({ + + + + Message + + { navigation.navigate('Profile', {name: profile.did}) }}> + Go to profile - - - - - Message - - {canBlockMember ? ( + - Block + {profile.viewer?.blocking ? l`Unblock` : l`Block`} - ) : null} {canRemoveMember ? ( removeMembers({members: [profile.did]})}> + Remove from chat - ) : null} {canUninviteMember ? ( {}}> + Uninvite - ) : null} diff --git a/src/screens/Messages/ConversationSettings/index.tsx b/src/screens/Messages/ConversationSettings/index.tsx index 29df1f5ba0..795a90c9da 100644 --- a/src/screens/Messages/ConversationSettings/index.tsx +++ b/src/screens/Messages/ConversationSettings/index.tsx @@ -595,7 +595,7 @@ function SettingsButton({ a.font_medium, a.text_center, a.pt_xs, - t.atoms.text_contrast_medium, + t.atoms.text, ]}> {text}