about summary refs log tree commit diff
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/Dialog/index.tsx22
-rw-r--r--src/components/Dialog/types.ts2
-rw-r--r--src/components/Menu/index.tsx6
-rw-r--r--src/components/Portal.tsx2
-rw-r--r--src/components/Prompt.tsx8
5 files changed, 13 insertions, 27 deletions
diff --git a/src/components/Dialog/index.tsx b/src/components/Dialog/index.tsx
index 6d859aeb0..a27271168 100644
--- a/src/components/Dialog/index.tsx
+++ b/src/components/Dialog/index.tsx
@@ -153,18 +153,18 @@ export function Outer({
   )
 
   return (
-    <Context.Provider value={context}>
-      <BottomSheet
-        ref={ref}
-        cornerRadius={20}
-        backgroundColor={t.atoms.bg.backgroundColor}
-        {...nativeOptions}
-        onSnapPointChange={onSnapPointChange}
-        onStateChange={onStateChange}
-        disableDrag={disableDrag}>
+    <BottomSheet
+      ref={ref}
+      cornerRadius={20}
+      backgroundColor={t.atoms.bg.backgroundColor}
+      {...nativeOptions}
+      onSnapPointChange={onSnapPointChange}
+      onStateChange={onStateChange}
+      disableDrag={disableDrag}>
+      <Context.Provider value={context}>
         <View testID={testID}>{children}</View>
-      </BottomSheet>
-    </Context.Provider>
+      </Context.Provider>
+    </BottomSheet>
   )
 }
 
diff --git a/src/components/Dialog/types.ts b/src/components/Dialog/types.ts
index caa787535..b1388a817 100644
--- a/src/components/Dialog/types.ts
+++ b/src/components/Dialog/types.ts
@@ -6,7 +6,6 @@ import type {
 } from 'react-native'
 
 import {ViewStyleProp} from '#/alf'
-import {PortalComponent} from '#/components/Portal'
 import {BottomSheetViewProps} from '../../../modules/bottom-sheet'
 import {BottomSheetSnapPoint} from '../../../modules/bottom-sheet/src/BottomSheet.types'
 
@@ -61,7 +60,6 @@ export type DialogOuterProps = {
   nativeOptions?: Omit<BottomSheetViewProps, 'children'>
   webOptions?: {}
   testID?: string
-  Portal?: PortalComponent
 }
 
 type DialogInnerPropsBase<T> = React.PropsWithChildren<ViewStyleProp> & T
diff --git a/src/components/Menu/index.tsx b/src/components/Menu/index.tsx
index 12cf1866e..4d35a63bd 100644
--- a/src/components/Menu/index.tsx
+++ b/src/components/Menu/index.tsx
@@ -18,7 +18,6 @@ import {
   ItemTextProps,
   TriggerProps,
 } from '#/components/Menu/types'
-import {PortalComponent} from '#/components/Portal'
 import {Text} from '#/components/Typography'
 
 export {
@@ -78,11 +77,9 @@ export function Trigger({children, label}: TriggerProps) {
 export function Outer({
   children,
   showCancel,
-  Portal,
 }: React.PropsWithChildren<{
   showCancel?: boolean
   style?: StyleProp<ViewStyle>
-  Portal?: PortalComponent
 }>) {
   const context = React.useContext(Context)
   const {_} = useLingui()
@@ -90,8 +87,7 @@ export function Outer({
   return (
     <Dialog.Outer
       control={context.control}
-      nativeOptions={{preventExpansion: true}}
-      Portal={Portal}>
+      nativeOptions={{preventExpansion: true}}>
       <Dialog.Handle />
       {/* Re-wrap with context since Dialogs are portal-ed to root */}
       <Context.Provider value={context}>
diff --git a/src/components/Portal.tsx b/src/components/Portal.tsx
index 7441df005..03b397b2b 100644
--- a/src/components/Portal.tsx
+++ b/src/components/Portal.tsx
@@ -12,8 +12,6 @@ type ComponentMap = {
   [id: string]: Component
 }
 
-export type PortalComponent = ({children}: {children?: React.ReactNode}) => null
-
 export function createPortalGroup() {
   const Context = React.createContext<ContextType>({
     outlet: null,
diff --git a/src/components/Prompt.tsx b/src/components/Prompt.tsx
index c47f0d64a..7b33c6e25 100644
--- a/src/components/Prompt.tsx
+++ b/src/components/Prompt.tsx
@@ -6,7 +6,6 @@ import {useLingui} from '@lingui/react'
 import {atoms as a, useBreakpoints, useTheme} from '#/alf'
 import {Button, ButtonColor, ButtonText} from '#/components/Button'
 import * as Dialog from '#/components/Dialog'
-import {PortalComponent} from '#/components/Portal'
 import {Text} from '#/components/Typography'
 import {BottomSheetViewProps} from '../../modules/bottom-sheet'
 
@@ -27,12 +26,10 @@ export function Outer({
   children,
   control,
   testID,
-  Portal,
   nativeOptions,
 }: React.PropsWithChildren<{
   control: Dialog.DialogControlProps
   testID?: string
-  Portal?: PortalComponent
   nativeOptions?: Omit<BottomSheetViewProps, 'children'>
 }>) {
   const {gtMobile} = useBreakpoints()
@@ -48,7 +45,6 @@ export function Outer({
     <Dialog.Outer
       control={control}
       testID={testID}
-      Portal={Portal}
       nativeOptions={{preventExpansion: true, ...nativeOptions}}>
       <Dialog.Handle />
       <Context.Provider value={context}>
@@ -190,7 +186,6 @@ export function Basic({
   onConfirm,
   confirmButtonColor,
   showCancel = true,
-  Portal,
 }: React.PropsWithChildren<{
   control: Dialog.DialogOuterProps['control']
   title: string
@@ -207,10 +202,9 @@ export function Basic({
   onConfirm: (e: GestureResponderEvent) => void
   confirmButtonColor?: ButtonColor
   showCancel?: boolean
-  Portal?: PortalComponent
 }>) {
   return (
-    <Outer control={control} testID="confirmModal" Portal={Portal}>
+    <Outer control={control} testID="confirmModal">
       <TitleText>{title}</TitleText>
       <DescriptionText>{description}</DescriptionText>
       <Actions>