@@ -11,12 +11,11 @@ import * as User from '@userActions/User';
11
11
import CONFIG from '@src/CONFIG' ;
12
12
import ONYXKEYS from '@src/ONYXKEYS' ;
13
13
import type { Network as NetworkOnyx , User as UserOnyx } from '@src/types/onyx' ;
14
- import testCrash from "@libs/testCrash" ;
15
- import Button from './Button' ;
16
- import { withNetwork } from './OnyxProvider' ;
17
- import Switch from './Switch' ;
18
- import TestToolRow from './TestToolRow' ;
19
- import Text from './Text' ;
14
+ import Text from "@components/Text" ;
15
+ import TestToolRow from "@components/TestToolRow" ;
16
+ import Switch from "@components/Switch" ;
17
+ import Button from "@components/Button" ;
18
+ import { withNetwork } from "@components/OnyxProvider" ;
20
19
21
20
type TestToolMenuOnyxProps = {
22
21
/** User object in Onyx */
@@ -29,7 +28,7 @@ type TestToolMenuProps = TestToolMenuOnyxProps & {
29
28
} ;
30
29
const USER_DEFAULT : UserOnyx = { shouldUseStagingServer : undefined , isSubscribedToNewsletter : false , validated : false , isFromPublicDomain : false , isUsingExpensifyCard : false } ;
31
30
32
- function TestToolMenu ( { user = USER_DEFAULT , network} : TestToolMenuProps ) {
31
+ function BaseTestToolMenu ( { user = USER_DEFAULT , network, children } : React . PropsWithChildren < TestToolMenuProps > ) {
33
32
const shouldUseStagingServer = user ?. shouldUseStagingServer ?? ApiUtils . isUsingStagingApi ( ) ;
34
33
const styles = useThemeStyles ( ) ;
35
34
const { translate} = useLocalize ( ) ;
@@ -91,20 +90,12 @@ function TestToolMenu({user = USER_DEFAULT, network}: TestToolMenuProps) {
91
90
/>
92
91
</ TestToolRow >
93
92
94
- < TestToolRow title = "Native crash" >
95
- < Button
96
- small
97
- text = "Native crash"
98
- onPress = { ( ) => {
99
- testCrash ( ) ;
100
- } }
101
- />
102
- </ TestToolRow >
93
+ { children }
103
94
</ >
104
95
) ;
105
96
}
106
97
107
- TestToolMenu . displayName = 'TestToolMenu ' ;
98
+ BaseTestToolMenu . displayName = 'BaseTestToolMenu ' ;
108
99
109
100
export default compose (
110
101
withOnyx < TestToolMenuProps , TestToolMenuOnyxProps > ( {
@@ -113,4 +104,4 @@ export default compose(
113
104
} ,
114
105
} ) ,
115
106
withNetwork ( ) ,
116
- ) ( TestToolMenu ) ;
107
+ ) ( BaseTestToolMenu ) ;
0 commit comments