esoftplay-event 0.0.2-x → 0.0.2-y

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.
@@ -1,8 +1,8 @@
1
1
  // withHooks
2
- import { ComponentMessage } from 'esoftplay/cache/component/message/import';
3
2
  import { EventButton } from 'esoftplay/cache/event/button/import';
4
3
  import { EventHeader } from 'esoftplay/cache/event/header/import';
5
4
  import { EventInput_rectangle } from 'esoftplay/cache/event/input_rectangle/import';
5
+ import { EventMessage } from 'esoftplay/cache/event/message/import';
6
6
  import { LibCollaps } from 'esoftplay/cache/lib/collaps/import';
7
7
  import { LibCurl } from 'esoftplay/cache/lib/curl/import';
8
8
  import { LibDatepicker } from 'esoftplay/cache/lib/datepicker/import';
@@ -453,7 +453,7 @@ export default function m(props: EventAdditional_newProps): any {
453
453
  {
454
454
  form?.error &&
455
455
  <>
456
- <ComponentMessage message={form?.message || "Gagal memuat data"}
456
+ <EventMessage message={form?.message || "Gagal memuat data"}
457
457
  children={
458
458
  <EventButton label='Coba lagi' onPress={() => {
459
459
  setReload(reload + 1)()
@@ -0,0 +1,67 @@
1
+ // withHooks
2
+
3
+ import { EventCountdown_timestamp } from 'esoftplay/cache/event/countdown_timestamp/import';
4
+ import { LibIcon } from 'esoftplay/cache/lib/icon/import';
5
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
6
+ import esp from 'esoftplay/esp';
7
+ import useSafeState from 'esoftplay/state';
8
+ import React from 'react';
9
+ import { Pressable, Text, View } from 'react-native';
10
+
11
+
12
+ export interface EventDialog_customArgs {
13
+
14
+ }
15
+ export interface EventDialog_customProps {
16
+ icon: any,
17
+ msg: string,
18
+ color: any
19
+ showCountdown?: boolean
20
+ onPressCancel: () => void,
21
+ onPressOK: () => void
22
+ }
23
+
24
+ export default function m(props: EventDialog_customProps): any {
25
+ const expTimestamp = Date.now() + 1000 * 60
26
+ const [timer] = useSafeState<number>(expTimestamp)
27
+ const [show, setShow] = useSafeState<boolean>(props?.showCountdown || false)
28
+
29
+ return (
30
+ <View style={{}}>
31
+ <View style={{ marginTop: 16, marginHorizontal: 10 }} >
32
+ <View style={{ alignItems: 'center', justifyContent: 'center' }} >
33
+ {props.icon && <View style={{ marginBottom: 30 }} ><LibIcon name={props.icon} size={70} color={props.color} /></View>}
34
+ {props.msg && <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 14, fontWeight: "normal", fontStyle: "normal", lineHeight: 19, letterSpacing: 0, textAlign: "center", color: "#4a4a4a" }}>{props.msg || ''}</Text>}
35
+ </View>
36
+ </View>
37
+ <View style={{ flexDirection: 'row', marginTop: 30, paddingHorizontal: 10 }} >
38
+ <Pressable onPress={props.onPressCancel} style={{ flex: 1, height: 40, alignItems: 'center', justifyContent: 'center' }} >
39
+ <Text allowFontScaling={false} style={{ fontWeight: 'bold', fontSize: 15 }}>{esp.lang("event/randomseat", "back")}</Text>
40
+ {/* <LibTextstyle textStyle="body" text={esp.lang("event/randomseat", "back")} /> */}
41
+ </Pressable>
42
+ <Pressable onPress={() => {
43
+ if (!show) {
44
+ props?.onPressOK?.()
45
+ setShow(x => !x)
46
+ }
47
+ }} style={{ flex: 1, height: 40, backgroundColor: LibStyle.colorRed, opacity: show ? 0.8 : 1, borderRadius: 25, alignItems: 'center', justifyContent: 'center', flexDirection: "row" }} >
48
+ <Text allowFontScaling={false} style={{ fontWeight: 'bold', fontSize: 15, color: '#fff' }}>{esp.lang("component/dialog_custom", "try_again")}</Text>
49
+
50
+ {
51
+ show &&
52
+ <>
53
+ <Text style={{ fontWeight: 'bold', fontSize: 15, color: '#fff' }}>{" ("}</Text>
54
+ <EventCountdown_timestamp
55
+ onExpired={() => {
56
+ setShow(x => !x)
57
+ }}
58
+ expiredTimestamp={timer}
59
+ style={{ color: "#fff", fontWeight: 'bold' }} />
60
+ <Text style={{ fontWeight: 'bold', fontSize: 15, color: '#fff' }}>{")"}</Text>
61
+ </>
62
+ }
63
+ </Pressable>
64
+ </View>
65
+ </View>
66
+ )
67
+ }
@@ -1,6 +1,6 @@
1
1
  // withHooks
2
2
 
3
- import { ComponentDialog_custom } from 'esoftplay/cache/component/dialog_custom/import';
3
+ import { EventDialog_custom } from 'esoftplay/cache/event/dialog_custom/import';
4
4
  import { EventDistribution_lock } from 'esoftplay/cache/event/distribution_lock/import';
5
5
  import { EventHeader } from 'esoftplay/cache/event/header/import';
6
6
  import { EventPayment_subscribeProperty } from 'esoftplay/cache/event/payment_subscribe/import';
@@ -120,7 +120,7 @@ export default function m(props: EventLoading_pageProps): any {
120
120
  // )
121
121
  } else if (error?.status_code == "PY0254") {
122
122
  LibDialog.custom(
123
- <ComponentDialog_custom
123
+ <EventDialog_custom
124
124
  showCountdown
125
125
  icon={"close-circle"}
126
126
  color={LibStyle.colorRed}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esoftplay-event",
3
- "version": "0.0.2-x",
3
+ "version": "0.0.2-y",
4
4
  "description": "event module on esoftplay framework",
5
5
  "main": "index.js",
6
6
  "scripts": {