66 */
77
88import React from 'react' ;
9- import { ScrollView , StatusBar , Text , useColorScheme , View } from 'react-native' ;
9+ import { SafeAreaView , ScrollView , StatusBar , useColorScheme } from 'react-native' ;
1010
11- import { useQuery } from '@powersync/react' ;
12- import { Colors } from 'react-native/Libraries/NewAppScreen' ;
13- import { rootSuite } from './mocha/MochaRNAdapter' ;
14- import { WithPowerSync } from './powersync/PowerSyncProvider' ;
15- import { registerBaseTests } from './tests/queries.test' ;
16- import { SuitWidget } from './widgets/SuitWidget' ;
17-
18- function PowerSyncIndicator ( ) {
19- const {
20- data : [ versionResult ] ,
21- isLoading,
22- } = useQuery < { version : string } > (
23- /* sql */ `SELECT powersync_rs_version() as version;` ,
24- ) ;
25- return (
26- < Text >
27- PowerSync version: { isLoading ? 'Loading' : versionResult ?. version }
28- </ Text >
29- ) ;
30- }
11+ import { Colors } from 'react-native/Libraries/NewAppScreen' ;
12+ import { rootSuite } from './mocha/MochaRNAdapter' ;
13+ import { registerBaseTests } from './tests/queries.test' ;
14+ import { SuitWidget } from './widgets/SuitWidget' ;
3115
3216function App ( ) : React . JSX . Element {
3317 const isDarkMode = useColorScheme ( ) === 'dark' ;
@@ -49,20 +33,18 @@ function App(): React.JSX.Element {
4933 const safePadding = '5%' ;
5034
5135 return (
52- < WithPowerSync >
53- < View style = { backgroundStyle } >
54- < StatusBar
55- barStyle = { isDarkMode ? 'light-content' : 'dark-content' }
56- backgroundColor = { backgroundStyle . backgroundColor }
57- />
58- < ScrollView style = { backgroundStyle } >
59- < PowerSyncIndicator />
60- { rootSuite . suites . map ( suite => (
61- < SuitWidget key = { suite . title } suit = { suite } />
62- ) ) }
63- </ ScrollView >
64- </ View >
65- </ WithPowerSync >
36+ < SafeAreaView style = { backgroundStyle } >
37+ < StatusBar
38+ barStyle = { isDarkMode ? 'light-content' : 'dark-content' }
39+ backgroundColor = { backgroundStyle . backgroundColor }
40+ />
41+ < ScrollView style = { backgroundStyle } >
42+ { /* <PowerSyncIndicator /> */ }
43+ { rootSuite . suites . map ( suite => (
44+ < SuitWidget key = { suite . title } suit = { suite } />
45+ ) ) }
46+ </ ScrollView >
47+ </ SafeAreaView >
6648 ) ;
6749}
6850
0 commit comments