esoftplay 0.0.192 → 0.0.194

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/bin/build.js CHANGED
@@ -288,6 +288,7 @@ yarn-error.log
288
288
  const AppJS = `import { LibNotification } from 'esoftplay/cache/lib/notification/import';
289
289
  import { UserIndex } from 'esoftplay/cache/user/index/import';
290
290
  import * as Notifications from 'expo-notifications';
291
+ import { SafeAreaProvider } from 'react-native-safe-area-context';
291
292
  import { enableFreeze, enableScreens } from 'react-native-screens';
292
293
 
293
294
  enableFreeze()
@@ -296,7 +297,13 @@ enableScreens()
296
297
  Notifications.addNotificationResponseReceivedListener(x => LibNotification.onAction(x));
297
298
  Notifications.addNotificationReceivedListener(x => LibNotification.onAction(x));
298
299
 
299
- export default UserIndex`;
300
+ export default function App() {
301
+ return (
302
+ <SafeAreaProvider>
303
+ <UserIndex />
304
+ </SafeAreaProvider>
305
+ )
306
+ }`;
300
307
  let expoLib = [
301
308
  '@expo/vector-icons',
302
309
  '@react-native-async-storage/async-storage',
@@ -2,7 +2,7 @@
2
2
  import { LibComponent } from 'esoftplay/cache/lib/component/import';
3
3
  import { LibFocus } from 'esoftplay/cache/lib/focus/import';
4
4
  import React from 'react';
5
- import { Platform, ScrollView, StyleSheet, Text, TouchableOpacity, TouchableWithoutFeedback, View, ViewStyle } from 'react-native';
5
+ import { Platform, ScrollView, StyleSheet, Text, TouchableOpacity, View, ViewStyle } from 'react-native';
6
6
 
7
7
  export interface LibCarrouselProps {
8
8
  children: any,
@@ -158,11 +158,9 @@ export default class m extends LibComponent<LibCarrouselProps, LibCarrouselState
158
158
  pages.push(<View><Text>You are supposed to add children inside Carousel</Text></View>);
159
159
  }
160
160
  return pages.map((page, i) => (
161
- <TouchableWithoutFeedback style={[{ ...size }, pageStyle]} key={`page${i}`}>
162
- <>
163
- {page}
164
- </>
165
- </TouchableWithoutFeedback>
161
+ <TouchableOpacity activeOpacity={1} style={[{ ...size }, pageStyle]} key={`page${i}`}>
162
+ {page}
163
+ </TouchableOpacity>
166
164
  ));
167
165
  }
168
166
 
@@ -206,7 +204,7 @@ export default class m extends LibComponent<LibCarrouselProps, LibCarrouselState
206
204
  _onLayout(event: any): void {
207
205
  const { height, width } = event.nativeEvent.layout;
208
206
  this.setState({ size: { width, height } });
209
-
207
+
210
208
  const timer = setTimeout(() => {
211
209
  this._placeCritical(this.state.currentPage)
212
210
  clearTimeout(timer)
@@ -343,13 +341,13 @@ export default class m extends LibComponent<LibCarrouselProps, LibCarrouselState
343
341
  const bullets: any[] = [];
344
342
  for (let i = 0; i < pageLength; i += 1) {
345
343
  bullets.push(
346
- <TouchableWithoutFeedback onPress={() => this.animateToPage(i)} key={`bullet${i}`}>
344
+ <TouchableOpacity activeOpacity={1} onPress={() => this.animateToPage(i)} key={`bullet${i}`}>
347
345
  <View
348
346
  style={i === this.state.currentPage ?
349
347
  [styles.chosenBullet, this.props.chosenBulletStyle] :
350
348
  [styles.bullet, this.props.bulletStyle]}
351
349
  />
352
- </TouchableWithoutFeedback>);
350
+ </TouchableOpacity>);
353
351
  }
354
352
  return (
355
353
  <View style={[styles.bullets, this.props.bulletsContainerStyle]} pointerEvents="box-none">
@@ -1,9 +1,11 @@
1
+ //[moved] add effect lib/notification
1
2
  // withHooks
2
3
  // noPage
3
4
  import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
4
5
  import { LibImage } from 'esoftplay/cache/lib/image/import';
5
6
  import { LibLocale } from 'esoftplay/cache/lib/locale/import';
6
7
  import { LibNet_status } from 'esoftplay/cache/lib/net_status/import';
8
+ import { LibNotification } from 'esoftplay/cache/lib/notification/import';
7
9
  import { LibProgress } from 'esoftplay/cache/lib/progress/import';
8
10
  import { LibStyle } from 'esoftplay/cache/lib/style/import';
9
11
  import { LibToast } from 'esoftplay/cache/lib/toast/import';
@@ -22,10 +24,11 @@ import moment from 'esoftplay/moment';
22
24
  import useSafeState from 'esoftplay/state';
23
25
  import { useFonts } from 'expo-font';
24
26
  import * as SplashScreen from 'expo-splash-screen';
25
- import { useLayoutEffect } from 'react';
26
- import { Dimensions, Platform, SafeAreaView, StatusBar, View } from 'react-native';
27
+ import { useEffect, useLayoutEffect } from 'react';
28
+ import { Platform, SafeAreaView, View } from 'react-native';
27
29
  import { GestureHandlerRootView } from 'react-native-gesture-handler';
28
30
  import { KeyboardProvider } from "react-native-keyboard-controller";
31
+ import { useSafeAreaInsets } from 'react-native-safe-area-context';
29
32
 
30
33
 
31
34
  import {
@@ -59,8 +62,12 @@ function getFontConfig() {
59
62
 
60
63
  SplashScreen.preventAutoHideAsync();
61
64
 
65
+ // (async () => {
66
+ // await NavigationBar.setPositionAsync('relative');
67
+ // await NavigationBar.setBackgroundColorAsync('#ffffff');
68
+ // await NavigationBar.setButtonStyleAsync("light")
69
+ // })()
62
70
  /** Klik [disini](https://github.com/dev-esoftplay/mobile-docs/blob/main/modules/user/index.md) untuk melihat dokumentasi*/
63
-
64
71
  export default function m(props: UserIndexProps): any {
65
72
  moment().locale(LibLocale.state().get())
66
73
  const [loading, setLoading] = useSafeState(true)
@@ -68,6 +75,9 @@ export default function m(props: UserIndexProps): any {
68
75
  //esoftplay-user-class-hook
69
76
  UseDeeplink()
70
77
 
78
+
79
+ useEffect(LibNotification.effect, []) // add this
80
+
71
81
  useLayoutEffect(() => {
72
82
  ErrorReport.getError()
73
83
  LibUpdaterProperty.check()
@@ -75,10 +85,8 @@ export default function m(props: UserIndexProps): any {
75
85
  }, [])
76
86
 
77
87
 
78
- const screenHeight = Dimensions.get('screen').height;
79
- const windowHeight = Dimensions.get('window').height;
80
- const statusBarHeight = StatusBar.currentHeight ?? 0;
81
- const navigationBarHeight = screenHeight - windowHeight - statusBarHeight;
88
+ const insets = useSafeAreaInsets();
89
+ const navigationBarHeight = insets.bottom;
82
90
 
83
91
  useLayoutEffect(() => {
84
92
  if (fontLoaded) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esoftplay",
3
- "version": "0.0.192",
3
+ "version": "0.0.194",
4
4
  "description": "embedding data from esoftplay framework (web based) into mobile app",
5
5
  "main": "cache/index.js",
6
6
  "types": "../../index.d.ts",