From c4785ef96e13d02b217dce4e777269c0e895507d Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Fri, 21 Mar 2025 18:29:14 +0200 Subject: New `ContextMenu` menu type for DM messages (#8014) * get context menu somewhat working ish * take screenshot rather than double rendering * get animations somewhat working * get transform animation working * rm log * upwards safe area * get working on android * get android working once and for all * fix positioning on both platforms * use dark blur on ios always, fix dark mode * allow closing with hardware back press * try and fix type error * add note about ts-ignore * round post * add image capture error handling * extract magic numbers * set explicit embed width, rm top margin * Message embed width tweaks * Format * fix position of embeds * same as above for web --------- Co-authored-by: Eric Bailey --- src/components/Menu/context.tsx | 11 +++-------- src/components/Menu/index.tsx | 2 +- src/components/Menu/index.web.tsx | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) (limited to 'src/components/Menu') diff --git a/src/components/Menu/context.tsx b/src/components/Menu/context.tsx index 908ad352e..d810a03de 100644 --- a/src/components/Menu/context.tsx +++ b/src/components/Menu/context.tsx @@ -2,14 +2,9 @@ import React from 'react' import type {ContextType, ItemContextType} from '#/components/Menu/types' -export const Context = React.createContext({ - // @ts-ignore - control: null, -}) - -export const ItemContext = React.createContext({ - disabled: false, -}) +export const Context = React.createContext(null) + +export const ItemContext = React.createContext(null) export function useMenuContext() { const context = React.useContext(Context) diff --git a/src/components/Menu/index.tsx b/src/components/Menu/index.tsx index 06b9e7e55..a84317771 100644 --- a/src/components/Menu/index.tsx +++ b/src/components/Menu/index.tsx @@ -34,7 +34,7 @@ export function Root({ children, control, }: React.PropsWithChildren<{ - control?: Dialog.DialogOuterProps['control'] + control?: Dialog.DialogControlProps }>) { const defaultControl = Dialog.useDialogControl() const context = React.useMemo( diff --git a/src/components/Menu/index.web.tsx b/src/components/Menu/index.web.tsx index 7bf4dde18..07339ef08 100644 --- a/src/components/Menu/index.web.tsx +++ b/src/components/Menu/index.web.tsx @@ -50,7 +50,7 @@ export function Root({ children, control, }: React.PropsWithChildren<{ - control?: Dialog.DialogOuterProps['control'] + control?: Dialog.DialogControlProps }>) { const {_} = useLingui() const defaultControl = useMenuControl() -- cgit 1.4.1