Revert dialog updates

This commit is contained in:
Eric Bailey
2025-08-05 11:59:01 -05:00
parent c877626db6
commit 4dc45f40ad
4 changed files with 5 additions and 17 deletions
-1
View File
@@ -22,7 +22,6 @@ export const Context = createContext<DialogContextProps>({
disableDrag: false, disableDrag: false,
setDisableDrag: () => {}, setDisableDrag: () => {},
isWithinDialog: false, isWithinDialog: false,
preventDismiss: false,
}) })
export function useDialogContext() { export function useDialogContext() {
-2
View File
@@ -54,7 +54,6 @@ export function Outer({
control, control,
onClose, onClose,
nativeOptions, nativeOptions,
preventDismiss,
testID, testID,
}: React.PropsWithChildren<DialogOuterProps>) { }: React.PropsWithChildren<DialogOuterProps>) {
const themeName = useThemeName() const themeName = useThemeName()
@@ -166,7 +165,6 @@ export function Outer({
cornerRadius={20} cornerRadius={20}
backgroundColor={t.atoms.bg.backgroundColor} backgroundColor={t.atoms.bg.backgroundColor}
{...nativeOptions} {...nativeOptions}
preventDismiss={preventDismiss ?? nativeOptions?.preventDismiss}
onSnapPointChange={onSnapPointChange} onSnapPointChange={onSnapPointChange}
onStateChange={onStateChange} onStateChange={onStateChange}
disableDrag={disableDrag}> disableDrag={disableDrag}>
+4 -11
View File
@@ -40,7 +40,6 @@ export function Outer({
control, control,
onClose, onClose,
webOptions, webOptions,
preventDismiss,
}: React.PropsWithChildren<DialogOuterProps>) { }: React.PropsWithChildren<DialogOuterProps>) {
const {_} = useLingui() const {_} = useLingui()
const {gtMobile} = useBreakpoints() const {gtMobile} = useBreakpoints()
@@ -53,9 +52,7 @@ export function Outer({
}, [setIsOpen, setDialogIsOpen, control.id]) }, [setIsOpen, setDialogIsOpen, control.id])
const close = React.useCallback<DialogControlProps['close']>( const close = React.useCallback<DialogControlProps['close']>(
(cb, force) => { cb => {
if (preventDismiss && !force) return
setDialogIsOpen(control.id, false) setDialogIsOpen(control.id, false)
setIsOpen(false) setIsOpen(false)
@@ -75,7 +72,7 @@ export function Outer({
onClose?.() onClose?.()
}, },
[control.id, onClose, setDialogIsOpen, preventDismiss], [control.id, onClose, setDialogIsOpen],
) )
const handleBackgroundPress = React.useCallback(async () => { const handleBackgroundPress = React.useCallback(async () => {
@@ -99,9 +96,8 @@ export function Outer({
disableDrag: false, disableDrag: false,
setDisableDrag: () => {}, setDisableDrag: () => {},
isWithinDialog: true, isWithinDialog: true,
preventDismiss: preventDismiss ?? false,
}), }),
[close, preventDismiss], [close],
) )
return ( return (
@@ -243,10 +239,7 @@ export const InnerFlatList = React.forwardRef<
export function Close() { export function Close() {
const {_} = useLingui() const {_} = useLingui()
const {close, preventDismiss} = React.useContext(Context) const {close} = React.useContext(Context)
if (preventDismiss) return null
return ( return (
<View <View
style={[ style={[
+1 -3
View File
@@ -26,7 +26,7 @@ export type DialogControlRefProps = {
open: ( open: (
options?: DialogControlOpenOptions & Partial<GestureResponderEvent>, options?: DialogControlOpenOptions & Partial<GestureResponderEvent>,
) => void ) => void
close: (callback?: () => void, force?: boolean) => void close: (callback?: () => void) => void
} }
/** /**
@@ -46,7 +46,6 @@ export type DialogContextProps = {
setDisableDrag: React.Dispatch<React.SetStateAction<boolean>> setDisableDrag: React.Dispatch<React.SetStateAction<boolean>>
// in the event that the hook is used outside of a dialog // in the event that the hook is used outside of a dialog
isWithinDialog: boolean isWithinDialog: boolean
preventDismiss: boolean
} }
export type DialogControlOpenOptions = { export type DialogControlOpenOptions = {
@@ -63,7 +62,6 @@ export type DialogOuterProps = {
control: DialogControlProps control: DialogControlProps
onClose?: () => void onClose?: () => void
nativeOptions?: Omit<BottomSheetViewProps, 'children'> nativeOptions?: Omit<BottomSheetViewProps, 'children'>
preventDismiss?: boolean
webOptions?: { webOptions?: {
alignCenter?: boolean alignCenter?: boolean
} }