crash testbed
This commit is contained in:
+63
-7
@@ -3,6 +3,7 @@ import '#/logger/bitdrift/setup'
|
||||
import '#/view/icons'
|
||||
|
||||
import React, {useEffect, useState} from 'react'
|
||||
import {View} from 'react-native'
|
||||
import {GestureHandlerRootView} from 'react-native-gesture-handler'
|
||||
import {
|
||||
initialWindowMetrics,
|
||||
@@ -60,20 +61,21 @@ import {Provider as ProgressGuideProvider} from '#/state/shell/progress-guide'
|
||||
import {Provider as SelectedFeedProvider} from '#/state/shell/selected-feed'
|
||||
import {Provider as StarterPackProvider} from '#/state/shell/starter-pack'
|
||||
import {Provider as HiddenRepliesProvider} from '#/state/threadgate-hidden-replies'
|
||||
import {TestCtrls} from '#/view/com/testing/TestCtrls'
|
||||
import * as Toast from '#/view/com/util/Toast'
|
||||
import {Shell} from '#/view/shell'
|
||||
import {ThemeProvider as Alf} from '#/alf'
|
||||
import {atoms as a, ThemeProvider as Alf} from '#/alf'
|
||||
import {useColorModeTheme} from '#/alf/util/useColorModeTheme'
|
||||
import {Button, ButtonText} from '#/components/Button'
|
||||
import {Provider as ContextMenuProvider} from '#/components/ContextMenu'
|
||||
import {NuxDialogs} from '#/components/dialogs/nuxs'
|
||||
import * as Dialog from '#/components/Dialog'
|
||||
import {useStarterPackEntry} from '#/components/hooks/useStarterPackEntry'
|
||||
import {Provider as IntentDialogProvider} from '#/components/intents/IntentDialogs'
|
||||
import {Provider as PolicyUpdateOverlayProvider} from '#/components/PolicyUpdateOverlay'
|
||||
import {Outlet as PortalOutlet} from '#/components/Portal'
|
||||
import {Provider as PortalProvider} from '#/components/Portal'
|
||||
import {Provider as VideoVolumeProvider} from '#/components/Post/Embed/VideoEmbed/VideoVolumeContext'
|
||||
import {ToastOutlet} from '#/components/Toast'
|
||||
import {Splash} from '#/Splash'
|
||||
import {BottomSheetOutlet} from '../modules/bottom-sheet'
|
||||
import {BottomSheetProvider} from '../modules/bottom-sheet'
|
||||
import {BackgroundNotificationPreferencesProvider} from '../modules/expo-background-notification-handler/src/BackgroundNotificationHandlerProvider'
|
||||
|
||||
@@ -164,10 +166,10 @@ function InnerApp() {
|
||||
style={s.h100pct}>
|
||||
<GlobalGestureEventsProvider>
|
||||
<IntentDialogProvider>
|
||||
<TestCtrls />
|
||||
<Shell />
|
||||
<NuxDialogs />
|
||||
<Testbed />
|
||||
<ToastOutlet />
|
||||
<PortalOutlet />
|
||||
<BottomSheetOutlet />
|
||||
</IntentDialogProvider>
|
||||
</GlobalGestureEventsProvider>
|
||||
</GestureHandlerRootView>
|
||||
@@ -252,3 +254,57 @@ function App() {
|
||||
}
|
||||
|
||||
export default Sentry.wrap(App)
|
||||
|
||||
function Testbed() {
|
||||
const control = Dialog.useDialogControl()
|
||||
return (
|
||||
<View
|
||||
style={[{height: '100%'}, a.align_center, a.justify_center, {gap: 16}]}>
|
||||
<Button
|
||||
label="show dialog"
|
||||
onPress={() => {
|
||||
control.open()
|
||||
}}
|
||||
size="large"
|
||||
color="primary">
|
||||
<ButtonText>Show dialog</ButtonText>
|
||||
</Button>
|
||||
<Dialog.Outer control={control}>
|
||||
<Dialog.Handle />
|
||||
<Dialog.ScrollableInner
|
||||
label=""
|
||||
style={{height: 300}}
|
||||
contentContainerStyle={{gap: 12}}>
|
||||
<Button
|
||||
label="show dialog"
|
||||
onPress={() => Toast.show('Hello')}
|
||||
size="large"
|
||||
color="secondary">
|
||||
<ButtonText>Show dialog</ButtonText>
|
||||
</Button>
|
||||
<Button
|
||||
label="close dialog"
|
||||
onPress={() => {
|
||||
Toast.show('closing')
|
||||
control.close()
|
||||
}}
|
||||
size="large"
|
||||
color="primary">
|
||||
<ButtonText>Close - toast before</ButtonText>
|
||||
</Button>
|
||||
<Button
|
||||
label="close dialog"
|
||||
onPress={() => {
|
||||
control.close(() => {
|
||||
Toast.show('closed')
|
||||
})
|
||||
}}
|
||||
size="large"
|
||||
color="primary">
|
||||
<ButtonText>Close - toast after</ButtonText>
|
||||
</Button>
|
||||
</Dialog.ScrollableInner>
|
||||
</Dialog.Outer>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user