Unmount Test Dialog
Will unmount in about 5 seconds
diff --git a/src/view/shell/Composer.ios.tsx b/src/view/shell/Composer.ios.tsx
index 18410bf397..02efad8786 100644
--- a/src/view/shell/Composer.ios.tsx
+++ b/src/view/shell/Composer.ios.tsx
@@ -1,19 +1,28 @@
-import React, {useLayoutEffect} from 'react'
+import React from 'react'
import {Modal, View} from 'react-native'
-import {StatusBar} from 'expo-status-bar'
-import * as SystemUI from 'expo-system-ui'
+import {useDialogStateControlContext} from '#/state/dialogs'
import {useComposerState} from '#/state/shell/composer'
import {atoms as a, useTheme} from '#/alf'
-import {getBackgroundColor, useThemeName} from '#/alf/util/useColorModeTheme'
import {ComposePost, useComposerCancelRef} from '../com/composer/Composer'
export function Composer({}: {winHeight: number}) {
+ const {setFullyExpandedCount} = useDialogStateControlContext()
const t = useTheme()
const state = useComposerState()
const ref = useComposerCancelRef()
const open = !!state
+ const prevOpen = React.useRef(open)
+
+ React.useEffect(() => {
+ if (open && !prevOpen.current) {
+ setFullyExpandedCount(c => c + 1)
+ } else if (!open && prevOpen.current) {
+ setFullyExpandedCount(c => c - 1)
+ }
+ prevOpen.current = open
+ }, [open, setFullyExpandedCount])
return (
ref.current?.onPressCancel()}>
-
-
-
+
)
}
-
-function Providers({
- children,
- open,
-}: {
- children: React.ReactNode
- open: boolean
-}) {
- // on iOS, it's a native formSheet. We use FullWindowOverlay to make
- // the dialogs appear over it
- return (
- <>
- {children}
-
- >
- )
-}
-
-// Generally, the backdrop of the app is the theme color, but when this is open
-// we want it to be black due to the modal being a form sheet.
-function IOSModalBackground({active}: {active: boolean}) {
- const theme = useThemeName()
-
- useLayoutEffect(() => {
- SystemUI.setBackgroundColorAsync('black')
-
- return () => {
- SystemUI.setBackgroundColorAsync(getBackgroundColor(theme))
- }
- }, [theme])
-
- // Set the status bar to light - however, only if the modal is active
- // If we rely on this component being mounted to set this,
- // there'll be a delay before it switches back to default.
- return active ? : null
-}
diff --git a/src/view/shell/Drawer.tsx b/src/view/shell/Drawer.tsx
index ca2cbb3e08..4212b28af9 100644
--- a/src/view/shell/Drawer.tsx
+++ b/src/view/shell/Drawer.tsx
@@ -590,7 +590,9 @@ function MenuItem({
? styles.menuItemCountTens
: undefined,
]}>
-
+
{count}