agora-appbuilder-core 4.0.0-spl.19 → 4.0.0-spl.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agora-appbuilder-core",
3
- "version": "4.0.0-spl.19",
3
+ "version": "4.0.0-spl.20",
4
4
  "description": "React Native template for RTE app builder",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -21,6 +21,7 @@ import {
21
21
  StatusBar,
22
22
  Platform,
23
23
  View,
24
+ ViewProps,
24
25
  } from 'react-native';
25
26
  import ColorConfigure from './components/ColorConfigure';
26
27
  import {isValidReactComponent} from './utils/common';
@@ -39,6 +40,21 @@ interface AppWrapperProps {
39
40
  children: React.ReactNode;
40
41
  }
41
42
 
43
+ const ConditionalSafeAreaView = ({children, ...props}: ViewProps) => {
44
+ if (!isSDK) {
45
+ return (
46
+ <SafeAreaView
47
+ // @ts-ignore textAlign not supported by TS definitions but is applied to web regardless
48
+ style={[{flex: 1}, Platform.select({web: {textAlign: 'left'}})]}
49
+ {...props}>
50
+ {children}
51
+ </SafeAreaView>
52
+ );
53
+ } else {
54
+ return <>{children}</>;
55
+ }
56
+ };
57
+
42
58
  const ImageBackgroundComp = (props: {
43
59
  bg?: string;
44
60
  color?: string;
@@ -80,9 +96,7 @@ const AppWrapper = (props: AppWrapperProps) => {
80
96
  return (
81
97
  <AppRoot>
82
98
  <ImageBackgroundComp bg={$config.BG} color={$config.BACKGROUND_COLOR}>
83
- <SafeAreaView
84
- // @ts-ignore textAlign not supported by TS definitions but is applied to web regardless
85
- style={[{flex: 1}, Platform.select({web: {textAlign: 'left'}})]}>
99
+ <ConditionalSafeAreaView>
86
100
  <StatusBar hidden={true} />
87
101
  <ToastProvider>
88
102
  <ToastContext.Consumer>
@@ -116,7 +130,7 @@ const AppWrapper = (props: AppWrapperProps) => {
116
130
  </GraphQLProvider>
117
131
  </StorageProvider>
118
132
  </ToastProvider>
119
- </SafeAreaView>
133
+ </ConditionalSafeAreaView>
120
134
  </ImageBackgroundComp>
121
135
  </AppRoot>
122
136
  );