esoftplay-event 0.0.0-a

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.
Files changed (121) hide show
  1. package/config.json +11 -0
  2. package/event/additional.tsx +188 -0
  3. package/event/additional_input.tsx +316 -0
  4. package/event/block_invitation.tsx +48 -0
  5. package/event/countdown.tsx +72 -0
  6. package/event/counter_cashier.tsx +180 -0
  7. package/event/counter_cashier_report.tsx +114 -0
  8. package/event/counter_cashier_sell.tsx +135 -0
  9. package/event/counter_eo.tsx +451 -0
  10. package/event/counter_history.tsx +74 -0
  11. package/event/counter_history_item.tsx +48 -0
  12. package/event/counter_info.tsx +96 -0
  13. package/event/counter_lm.tsx +273 -0
  14. package/event/counter_menu.tsx +85 -0
  15. package/event/counter_report.tsx +105 -0
  16. package/event/counter_report_breakdown.tsx +93 -0
  17. package/event/counter_report_detail.tsx +238 -0
  18. package/event/counter_report_detail_list.tsx +56 -0
  19. package/event/counter_request.tsx +136 -0
  20. package/event/counter_request_detail.tsx +211 -0
  21. package/event/counter_section.tsx +32 -0
  22. package/event/counter_send.tsx +277 -0
  23. package/event/counter_status.tsx +32 -0
  24. package/event/counter_type.tsx +23 -0
  25. package/event/counter_user_list.tsx +197 -0
  26. package/event/counter_user_list_item.tsx +143 -0
  27. package/event/coupon.tsx +124 -0
  28. package/event/coupon_claim.tsx +198 -0
  29. package/event/coupon_claim_detail.tsx +175 -0
  30. package/event/coupon_claim_history.tsx +279 -0
  31. package/event/coupon_claim_reimburse.tsx +111 -0
  32. package/event/coupon_claim_reimburse_history.tsx +72 -0
  33. package/event/coupon_claim_reimburse_history_detail.tsx +117 -0
  34. package/event/coupon_claim_staff.tsx +256 -0
  35. package/event/coupon_detail.tsx +98 -0
  36. package/event/coupon_event_list.tsx +77 -0
  37. package/event/coupon_generate.tsx +258 -0
  38. package/event/coupon_generate_event.tsx +79 -0
  39. package/event/coupon_generate_list.tsx +56 -0
  40. package/event/date_picker.tsx +152 -0
  41. package/event/detail.tsx +352 -0
  42. package/event/entrance.tsx +215 -0
  43. package/event/entrance_again.tsx +200 -0
  44. package/event/entrance_failed.tsx +190 -0
  45. package/event/entrance_idcard.tsx +203 -0
  46. package/event/entrance_list.tsx +264 -0
  47. package/event/entrance_list_item.tsx +88 -0
  48. package/event/entrance_log.tsx +130 -0
  49. package/event/entrance_success.tsx +155 -0
  50. package/event/entrance_warning.tsx +91 -0
  51. package/event/exchange_reward.tsx +31 -0
  52. package/event/exchange_reward_result.tsx +137 -0
  53. package/event/exchange_ticket.tsx +234 -0
  54. package/event/exchange_ticket_list.tsx +191 -0
  55. package/event/exchange_ticket_result.tsx +211 -0
  56. package/event/exit.tsx +91 -0
  57. package/event/exit_failed.tsx +135 -0
  58. package/event/exit_list.tsx +118 -0
  59. package/event/exit_log.tsx +131 -0
  60. package/event/exit_success.tsx +143 -0
  61. package/event/exit_temporary.tsx +226 -0
  62. package/event/hall_in.tsx +148 -0
  63. package/event/hall_in_failed.tsx +270 -0
  64. package/event/hall_in_list.tsx +222 -0
  65. package/event/hall_in_log.tsx +134 -0
  66. package/event/hall_in_success.tsx +132 -0
  67. package/event/hall_out.tsx +143 -0
  68. package/event/hall_out_failed.tsx +133 -0
  69. package/event/hall_out_list.tsx +215 -0
  70. package/event/hall_out_log.tsx +133 -0
  71. package/event/hall_out_success.tsx +130 -0
  72. package/event/list.tsx +219 -0
  73. package/event/list_filter.tsx +124 -0
  74. package/event/log.tsx +435 -0
  75. package/event/qc_idcard.tsx +209 -0
  76. package/event/qc_idcard_failed.tsx +78 -0
  77. package/event/qc_idcard_success.tsx +68 -0
  78. package/event/queue_out.tsx +186 -0
  79. package/event/queue_pricing.tsx +152 -0
  80. package/event/randomseat.tsx +33 -0
  81. package/event/review.tsx +117 -0
  82. package/event/review_add.tsx +342 -0
  83. package/event/review_detail.tsx +67 -0
  84. package/event/review_item.tsx +76 -0
  85. package/event/scan_item.tsx +66 -0
  86. package/event/schedule.tsx +135 -0
  87. package/event/seat.tsx +628 -0
  88. package/event/seat_autopick.tsx +120 -0
  89. package/event/seat_map.tsx +408 -0
  90. package/event/seat_map_matrix.tsx +94 -0
  91. package/event/seat_map_test.tsx +401 -0
  92. package/event/ticket_list.tsx +722 -0
  93. package/event/ticket_list2.tsx +680 -0
  94. package/event/timer.tsx +58 -0
  95. package/event/tms.tsx +103 -0
  96. package/event/tms_add.tsx +94 -0
  97. package/event/tms_add_result.tsx +175 -0
  98. package/event/tms_dashboard.tsx +89 -0
  99. package/event/tms_event_list.tsx +66 -0
  100. package/event/turnstile_event_gate.tsx +74 -0
  101. package/event/turnstile_event_item.tsx +41 -0
  102. package/event/turnstile_event_list.tsx +69 -0
  103. package/event/turnstile_event_ticket.tsx +95 -0
  104. package/event/turnstile_settings.tsx +327 -0
  105. package/event/turnstile_settings_otp.tsx +58 -0
  106. package/event/turnstile_settings_status.tsx +50 -0
  107. package/event/voucher.tsx +149 -0
  108. package/event/voucher_multi.tsx +181 -0
  109. package/fonts/Arial.ttf +0 -0
  110. package/fonts/ArialBold.ttf +0 -0
  111. package/fonts/DecoNumbers.ttf +0 -0
  112. package/fonts/MonoSpace.ttf +0 -0
  113. package/fonts/SFProText.ttf +0 -0
  114. package/fonts/digital.ttf +0 -0
  115. package/fonts/mono.ttf +0 -0
  116. package/id.json +1113 -0
  117. package/index.js +2 -0
  118. package/libs.json +1 -0
  119. package/mover.js +0 -0
  120. package/package.json +16 -0
  121. package/publisher.js +84 -0
@@ -0,0 +1,342 @@
1
+ // withHooks
2
+
3
+ import { ComponentButton } from 'esoftplay/cache/component/button/import';
4
+ import { ComponentHeader } from 'esoftplay/cache/component/header/import';
5
+ import { ComponentRating } from 'esoftplay/cache/component/rating/import';
6
+ import { LibCurl } from 'esoftplay/cache/lib/curl/import';
7
+ import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
8
+ import { LibInput } from 'esoftplay/cache/lib/input/import';
9
+ import { LibKeyboard_avoid } from 'esoftplay/cache/lib/keyboard_avoid/import';
10
+ import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
11
+ import { LibNet_status } from 'esoftplay/cache/lib/net_status/import';
12
+ import { LibObject } from 'esoftplay/cache/lib/object/import';
13
+ import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
14
+ import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
15
+ import { TicketDetailProperty } from 'esoftplay/cache/ticket/detail/import';
16
+ import esp from 'esoftplay/esp';
17
+ import useGlobalState, { useGlobalReturn } from 'esoftplay/global';
18
+ import useLazyState from 'esoftplay/lazy';
19
+ import moment from 'esoftplay/moment';
20
+ import useSafeState from 'esoftplay/state';
21
+ import React, { useEffect, useRef } from 'react';
22
+ import { Pressable, ScrollView, View } from 'react-native';
23
+
24
+
25
+ export interface EventReview_addArgs {
26
+
27
+ }
28
+ export interface EventReview_addProps {
29
+ type: number;
30
+ type_name: string;
31
+ title: string;
32
+ categories: ResultCategories[];
33
+ booking_id: string;
34
+ url_form: string
35
+ }
36
+
37
+ export interface Item {
38
+ booking_id: number;
39
+ url: string;
40
+ post: any;
41
+ status: number;
42
+ review: ItemReview;
43
+ surveys: any;
44
+ }
45
+
46
+
47
+ export interface ItemReview {
48
+ booking_id: number;
49
+ content: string;
50
+ rating: number;
51
+ created: string;
52
+ }
53
+
54
+
55
+ export interface ResultCategories {
56
+ title: string;
57
+ suggestions: string[];
58
+ }
59
+
60
+ const stateReviews = useGlobalState<any>(undefined, { persistKey: 'event/review_add', loadOnInit: true })
61
+
62
+ export function state(): useGlobalReturn<any> {
63
+ return stateReviews
64
+ }
65
+
66
+ // export function syncAll() {
67
+ // const status = LibNet_status.state().get()
68
+ // if (status?.isOnline == true && status?.isInternetReachable == true) {
69
+ // const listReviewsLocal = stateReviews.get()
70
+ // if (listReviewsLocal.length > 0) {
71
+ // let hasNext = false;
72
+ // if (listReviewsLocal.length >= 2) {
73
+ // hasNext = true;
74
+ // }
75
+ // const currentReview = listReviewsLocal[0]
76
+ // new LibCurl(currentReview.url, currentReview.post, (res, msg) => {
77
+ // let a = listReviewsLocal.filter((it: any) => {
78
+ // return it.booking_id != currentReview.booking_id
79
+ // })
80
+ // stateReviews.set(a)
81
+ // if (hasNext) {
82
+ // syncAll()
83
+ // }
84
+ // }, (err)=>{
85
+ // // let a = listReviewsLocal.filter((it: any) => {
86
+ // // return it.booking_id != currentReview.booking_id
87
+ // // })
88
+ // // stateReviews.set(a)
89
+ // if (hasNext) {
90
+ // syncAll()
91
+ // }
92
+ // })
93
+ // }
94
+ // }
95
+ // }
96
+
97
+
98
+ function buildOfflineReview(data: any, surveys: any[]) {
99
+ let out: any[] = []
100
+ Object.entries(data).forEach((item) => {
101
+ const key = item[0].replace('c', '')
102
+ const options: any = item[1]
103
+ let survey = surveys?.filter?.((x) => x.id == key) || []
104
+ if (survey?.length) {
105
+ const currSurvey = survey[0]
106
+ const curOptions = currSurvey.options
107
+ if (typeof options != 'string') {
108
+ options.forEach((opt: any) => {
109
+ out.push({
110
+ survey_id: key,
111
+ survey_question: currSurvey.question,
112
+ survey_option: curOptions.filter((x: any) => x.id == opt)[0].content,
113
+ content: null
114
+ })
115
+ })
116
+ } else {
117
+ out.push({
118
+ survey_id: key,
119
+ survey_question: currSurvey.question,
120
+ survey_option: "",
121
+ content: options
122
+ })
123
+ }
124
+ }
125
+
126
+ })
127
+ return out;
128
+ }
129
+
130
+
131
+ export default function m(props: EventReview_addProps): any {
132
+ const { url_form, booking_id, type, rate }: any = LibNavigation.getArgsAll(props)
133
+ const reviewText = useRef<LibInput>(null)
134
+ let inputReview = useRef('').current
135
+
136
+ const title_text = type == 1 ? esp.lang("event/review_add", "review_event") : type == 2 ? esp.lang("event/review_add", "review_eo") : esp.lang("event/review_add", "review_sponsor")
137
+
138
+ const [result, setResult, getResult] = useSafeState<any>()
139
+ const [rating, setRating] = useSafeState(rate || 0)
140
+ const [survey, setSurvey, getSurvey] = useLazyState<any>({})
141
+ const [status] = LibNet_status.state().useState()
142
+
143
+
144
+ // { survey_id, survey_question, survey_option, content }
145
+
146
+ useEffect(() => {
147
+ loadData()
148
+ // stateReviews.reset()
149
+ }, [])
150
+
151
+
152
+ function loadData() {
153
+ new LibCurl(url_form, null, (res, msg) => {
154
+ setResult(res)
155
+ }, (err) => {
156
+ LibDialog.warningConfirm(esp.lang("event/review_add", "oops"), err?.message, esp.lang("event/review_add", "confirm_ok"), () => {
157
+ LibNavigation.back()
158
+ }, "", () => { })
159
+ })
160
+ }
161
+
162
+ // function setReview(t: string) {
163
+ // if (inputReview.length < 1) {
164
+ // inputReview = t
165
+ // } else {
166
+ // inputReview = inputReview + ', ' + t
167
+ // }
168
+ // reviewText.current!.setText(inputReview)
169
+ // }
170
+
171
+ function sendReview() {
172
+ if (rating == 0) {
173
+ LibToastProperty.show(esp.lang("event/review_add", "rating"))
174
+ return
175
+ }
176
+
177
+ let url = "event_order_detail_review_submit?id=" + booking_id + "&type=" + type
178
+
179
+ const postSurvey = (data: any) => {
180
+ let out: any = {}
181
+ Object.entries(data).forEach((item) => {
182
+ if (!item[0].includes('c')) {
183
+ if (typeof item[1] == 'string')
184
+ out[item[0]] = [item[0], []]
185
+ else
186
+ out[item[0]] = [item[0], item[1]]
187
+ }
188
+ })
189
+ Object.entries(data).forEach(item => {
190
+ if (item[0].includes('c')) {
191
+ let cleanKey = item[0].replace('c', '')
192
+ let currentValue = out[cleanKey]
193
+ if (currentValue) {
194
+ out[cleanKey] = [...currentValue, item[1]]
195
+ } else {
196
+ out[cleanKey] = [cleanKey, [], item[1]]
197
+ }
198
+ }
199
+ })
200
+ return Object.values(out)
201
+ }
202
+
203
+ let post = {
204
+ rating: rating,
205
+ content: reviewText.current?.getText().replace(/\n/g, '\\n'),
206
+ survey: JSON.stringify(postSurvey(getSurvey())),
207
+ }
208
+ let listReviewsLocal = stateReviews.get()
209
+ let ctime = new Date()
210
+ let formattedTime = moment(ctime).serverFormat('YYYY-MM-DD HH:mm:ss')
211
+ let x: Item = {
212
+ booking_id: booking_id,
213
+ url: url,
214
+ post: post,
215
+ status: 1,
216
+ review: {
217
+ booking_id: booking_id,
218
+ content: reviewText.current?.getText?.().replace(/\n/g, '\\n') || '',
219
+ rating: rating,
220
+ created: formattedTime
221
+ },
222
+ surveys: buildOfflineReview(getSurvey(), getResult()?.surveys),
223
+ }
224
+
225
+ let checkSame = listReviewsLocal?.filter((z: any) => z?.booking_id == booking_id)
226
+ if (checkSame == undefined || checkSame?.length == 0) {
227
+ TicketDetailProperty.subscribe().trigger(x)
228
+ stateReviews.set(LibObject.push(listReviewsLocal, x)())
229
+ // syncAll()
230
+ if (status?.isOnline == true && status?.isInternetReachable == true) {
231
+ new LibCurl(url, post, (res, msg) => {
232
+ let a = listReviewsLocal.filter((it: any) => {
233
+ return it.booking_id != x.booking_id
234
+ })
235
+ stateReviews.set(a)
236
+ })
237
+ }
238
+
239
+ LibNavigation.back()
240
+ LibDialog.info(esp.lang("event/review_add", "info"), esp.lang("event/review_add", "review_sended"))
241
+ } else {
242
+ if (esp.isDebug("toast"))
243
+ LibToastProperty.show(JSON.stringify(checkSame))
244
+ }
245
+ }
246
+
247
+ function renderCat(item: any, i: number) {
248
+ return (
249
+ <View style={{ marginTop: 14, borderLeftColor: '#e1e1e1', borderLeftWidth: 2, paddingLeft: 12 }} key={i} >
250
+ <LibTextstyle textStyle='callout' text={item.question} />
251
+ {/* single */ item.is_option == 1 &&
252
+ <ScrollView horizontal style={{ marginTop: 8 }} >
253
+ {
254
+ item?.options?.length > 0 && item?.options?.map((it: any, ii: number) => {
255
+ let values = survey[item.id]
256
+ return (
257
+ <>
258
+ <Pressable
259
+ key={ii}
260
+ onPress={() => { setSurvey(LibObject.set(getSurvey(), [it.id])(item.id))() }}
261
+ style={{ padding: 3, paddingHorizontal: 15, marginRight: 4, borderWidth: 1, borderRadius: 29, borderColor: "#202020", opacity: !values?.includes?.(it.id) ? 0.3 : 1, justifyContent: 'center' }} >
262
+ <LibTextstyle textStyle='body' text={it.content} style={{ color: "#202020" }} />
263
+ </Pressable>
264
+ </>
265
+ )
266
+ })
267
+ }
268
+ </ScrollView>
269
+ }
270
+ {/* multi */ item.is_option == 2 &&
271
+ <ScrollView horizontal style={{ marginTop: 8 }} >
272
+ {
273
+ item?.options?.length > 0 && item?.options?.map((it: any, ii: number) => {
274
+ let values = survey[item.id]
275
+ return (
276
+ <>
277
+ <Pressable
278
+ key={ii}
279
+ onPress={() => {
280
+ setSurvey(LibObject.update(getSurvey(), (ov) => {
281
+ if (!Array.isArray(ov)) ov = []
282
+ const out = ov.includes(it.id) ? ov.filter((id: any) => it.id != id) : [...ov, it.id]
283
+ return out
284
+ })(item.id))()
285
+ }}
286
+ style={{ padding: 3, paddingHorizontal: 15, marginRight: 4, borderWidth: 1, borderRadius: 3, borderColor: "#202020", opacity: !values?.includes?.(it.id) ? 0.3 : 1, justifyContent: 'center' }} >
287
+ <LibTextstyle textStyle='body' text={it.content} style={{ color: "#202020" }} />
288
+ </Pressable>
289
+ </>
290
+ )
291
+ })
292
+ }
293
+ </ScrollView>
294
+ }
295
+ {
296
+ item?.is_content == 1 &&
297
+ <View style={{ marginHorizontal: -16 }}>
298
+ <LibInput
299
+ label={item.is_option == 0 ? esp.lang("event/review_add", "answer") : esp.lang("event/review_add", "other")}
300
+ value={survey[item.id + 'c'] || ''}
301
+ onChangeText={(text) => setSurvey(LibObject.set(getSurvey(), text)(item.id + 'c'))()} />
302
+ </View>
303
+ }
304
+ </View>
305
+ )
306
+ }
307
+
308
+ return (
309
+ <LibKeyboard_avoid style={{ flex: 1 }} >
310
+ <ComponentHeader title={esp.lang("event/review_add", "header_title")} notif />
311
+ <ScrollView style={{ margin: 16 }} >
312
+ <LibTextstyle text={result ? result?.title : title_text} textStyle='m_h6' style={{ marginBottom: 20, textAlign: 'center' }} />
313
+ {/* <LibTextstyle textStyle='m_overline' text='Rating' style={{ marginTop: 24, borderRadius: 1, marginBottom: 5 }} /> */}
314
+ <ComponentRating defaultValue={rating} onChangeRating={(rate) => { setRating(rate) }} />
315
+ {
316
+ result?.surveys?.length > 0 &&
317
+ <>
318
+ <LibTextstyle textStyle='m_overline' text={esp.lang("event/review_add", "survey")} style={{ marginTop: 36, borderRadius: 1, marginBottom: 5 }} />
319
+ </>
320
+ }
321
+ {result?.surveys?.length > 0 && result?.surveys?.map(renderCat)}
322
+
323
+ <LibTextstyle textStyle='m_overline' text={esp.lang("event/review_add", "review")} style={{ marginTop: 36, borderRadius: 1, marginBottom: 5 }} />
324
+ <LibInput
325
+ ref={reviewText}
326
+ defaultValue={inputReview}
327
+ base
328
+ multiline={true}
329
+ style={{ height: 100, borderColor: 'gray', borderWidth: 1, borderRadius: 8, padding: 10, textAlignVertical: 'top' }}
330
+ onChangeText={(t) => { inputReview = t }}
331
+ />
332
+ </ScrollView>
333
+ <ComponentButton label={esp.lang("event/review_add", "send_review")} onPress={() => {
334
+ LibDialog.confirm(esp.lang("event/review_add", "review_title"), esp.lang("event/review_add", "review_ok"), esp.lang("event/review_add", "review_send"), () => {
335
+ sendReview()
336
+ }, esp.lang("event/review_add", "review_cancel"), () => {
337
+
338
+ })
339
+ }} style={{ margin: 16 }} />
340
+ </LibKeyboard_avoid>
341
+ )
342
+ }
@@ -0,0 +1,67 @@
1
+ // withHooks
2
+
3
+
4
+ import { ComponentHeader } from 'esoftplay/cache/component/header/import';
5
+ import { ComponentRating } from 'esoftplay/cache/component/rating/import';
6
+ import { LibCurl } from 'esoftplay/cache/lib/curl/import';
7
+ import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
8
+ import { LibLoading } from 'esoftplay/cache/lib/loading/import';
9
+ import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
10
+ import { LibPicture } from 'esoftplay/cache/lib/picture/import';
11
+ import { LibUtils } from 'esoftplay/cache/lib/utils/import';
12
+ import esp from 'esoftplay/esp';
13
+ import useSafeState from 'esoftplay/state';
14
+ import React, { useEffect } from 'react';
15
+ import { ScrollView, Text, View } from 'react-native';
16
+
17
+
18
+ export interface EventReview_detailArgs {
19
+
20
+ }
21
+ export interface EventReview_detailProps {
22
+
23
+ }
24
+ export default function m(props: EventReview_detailProps): any {
25
+ const { url }: any = LibNavigation.getArgsAll(props)
26
+
27
+ const [result, setResult] = useSafeState<any>()
28
+
29
+ useEffect(() => {
30
+ loadData()
31
+ }, [])
32
+
33
+ function loadData() {
34
+ new LibCurl(url, null, (res, msg) => {
35
+ setResult(res)
36
+ }, (err) => {
37
+ LibDialog.warning(esp.lang("event/review_detail", "oops"), err.message)
38
+ LibNavigation.back()
39
+ })
40
+ }
41
+
42
+ if (!result) {
43
+ return <LibLoading />
44
+ }
45
+
46
+ return (
47
+ <View style={{ flex: 1 }}>
48
+ <ComponentHeader title={esp.lang("event/review_detail", "header_title")} />
49
+ <ScrollView>
50
+ <View style={{ margin: 10, padding: 10, borderWidth: 1, borderColor: '#c9c9c9', borderRadius: 10, flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
51
+ <LibPicture source={{ uri: result?.event?.image }} style={{ height: 50, width: 50, borderRadius: 10 }} />
52
+ <View style={{ marginLeft: 10, flex: 1 }}>
53
+ <Text allowFontScaling={false} style={{ fontSize: 14, fontWeight: 'bold' }} numberOfLines={2} ellipsizeMode='tail'>{result?.event?.name}</Text>
54
+ </View>
55
+ </View>
56
+ <View style={{ marginLeft: 10, marginTop: 5, flexDirection: 'row', marginVertical: 3, alignContent: 'center', alignItems: 'center' }}>
57
+ <ComponentRating disabled onChangeRating={() => { }} defaultValue={result?.review?.rating} size={16} containerStyle={{ padding: 0 }} />
58
+ <View style={{ marginHorizontal: 5, height: 3, width: 3, borderRadius: 1.5, backgroundColor: "#b8a898" }} />
59
+ <Text allowFontScaling={false} style={{ marginLeft: 7, fontSize: 12, color: '#c9c9c9' }}>{LibUtils.moment(result?.review?.created).localeFormat("D MMM YYYY")}</Text>
60
+ </View>
61
+
62
+ <Text allowFontScaling={false} style={{ marginLeft: 10, fontSize: 12, color: result?.content != "" ? '#000' : '#c9c9c9' }}>{result?.review?.content != "" ? result?.review?.content : "Tidak ada ulasan"}</Text>
63
+
64
+ </ScrollView>
65
+ </View>
66
+ )
67
+ }
@@ -0,0 +1,76 @@
1
+ // withHooks
2
+
3
+ import { ComponentRating } from 'esoftplay/cache/component/rating/import';
4
+ import { ComponentRating_mini } from 'esoftplay/cache/component/rating_mini/import';
5
+ import { LibGradient } from 'esoftplay/cache/lib/gradient/import';
6
+ import { LibPicture } from 'esoftplay/cache/lib/picture/import';
7
+ import { LibUtils } from 'esoftplay/cache/lib/utils/import';
8
+ import React from 'react';
9
+ import { Pressable, Text, View } from 'react-native';
10
+
11
+
12
+ export interface EventReview_itemArgs {
13
+
14
+ }
15
+ export interface EventReview_itemProps {
16
+ id: string;
17
+ booking_code: string;
18
+ event_id: string;
19
+ event_name: string;
20
+ price_id: string;
21
+ price_name: string;
22
+ ondate: string;
23
+ qty: string;
24
+ qty_shared: string;
25
+ total: string;
26
+ currency: string;
27
+ status: string;
28
+ review_status: any;
29
+ created: string;
30
+ image: string;
31
+ url: string;
32
+ review: any;
33
+
34
+ onPress: () => void
35
+ }
36
+
37
+
38
+ export default function m(props: EventReview_itemProps): any {
39
+
40
+ return (
41
+ <View>
42
+ {
43
+ props.review == null ?
44
+ <Pressable onPress={() => {
45
+ props.onPress()
46
+ }} style={{ backgroundColor: '#fff', marginBottom: 10 }}>
47
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', overflow: 'hidden' }} >
48
+ <LibPicture style={{ height: 70, width: 16 / 9 * 50 }} source={{ uri: props.image }} />
49
+ <LibGradient colors={['#fff', "rgba(255,255,255,0)"]} direction='right-to-left' style={{ height: 70, width: 16 / 9 * 50, borderRadius: 0, position: 'absolute' }} >
50
+
51
+ </LibGradient>
52
+ <View style={{ flex: 1, paddingVertical: 16, marginLeft: -10 / 9 * 20 + 16 }} >
53
+ <Text allowFontScaling={false} style={{ fontSize: 12, color: '#c9c9c9' }} numberOfLines={1} ellipsizeMode='tail'>{props.booking_code}</Text>
54
+ <Text allowFontScaling={false} style={{ fontSize: 14, fontWeight: 'bold' }} numberOfLines={1} ellipsizeMode='tail'>{props.event_name}</Text>
55
+ <ComponentRating_mini rating='0,0,0,0,5' starStyle={{ color: "#c9c9c9" }} starSize={25} />
56
+ </View>
57
+ </View>
58
+ </Pressable>
59
+ :
60
+ <Pressable onPress={() => {
61
+ props.onPress()
62
+ }} style={{ padding: 15, marginBottom: 10, backgroundColor: '#fff' }}>
63
+ <Text allowFontScaling={false} style={{ fontSize: 14, fontWeight: 'bold' }} numberOfLines={2} ellipsizeMode='tail'>{props.event_name}</Text>
64
+
65
+ <View style={{ flexDirection: 'row', marginVertical: 3, alignContent: 'center', alignItems: 'center' }}>
66
+ <ComponentRating disabled onChangeRating={() => { }} defaultValue={props?.review?.rating} size={16} containerStyle={{ padding: 0 }} />
67
+ <View style={{ marginHorizontal: 5, height: 3, width: 3, borderRadius: 1.5, backgroundColor: "#b8a898" }} />
68
+ <Text allowFontScaling={false} style={{ marginLeft: 7, fontSize: 12, color: '#c9c9c9' }}>{LibUtils.moment(props.review?.created).localeFormat("D MMM YYYY")}</Text>
69
+ </View>
70
+
71
+ <Text allowFontScaling={false} style={{ marginTop: 10, fontSize: 12, color: props.review?.content != "" ? '#000' : '#c9c9c9' }}>{props.review?.content != "" ? props?.review?.content : "Tidak ada ulasan"}</Text>
72
+ </Pressable>
73
+ }
74
+ </View>
75
+ )
76
+ }
@@ -0,0 +1,66 @@
1
+ // withHooks
2
+
3
+ import { applyStyle } from 'esoftplay';
4
+ import { ComponentButton } from 'esoftplay/cache/component/button/import';
5
+ import { LibIcon } from 'esoftplay/cache/lib/icon/import';
6
+ import { LibPicture } from 'esoftplay/cache/lib/picture/import';
7
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
8
+ import { LibUtils } from 'esoftplay/cache/lib/utils/import';
9
+ import esp from 'esoftplay/esp';
10
+ import React from 'react';
11
+ import { Text, View } from 'react-native';
12
+
13
+
14
+ export interface EventScan_itemArgs {
15
+
16
+ }
17
+ export interface EventScan_itemProps {
18
+ event_image: string,
19
+ event_name: string,
20
+ event_ondate: string,
21
+ item: any,
22
+ style?: any,
23
+
24
+ onPress: () => void,
25
+ label: string,
26
+ colorBackground?: any,
27
+ colorFont: any
28
+ colorText?: any
29
+ }
30
+ export default function m(props: EventScan_itemProps): any {
31
+ return (
32
+ <View style={[{ padding: 10, overflow: 'hidden', flex: 1, flexDirection: 'row', backgroundColor: '#fff', borderBottomColor: LibStyle.colorGrey, borderBottomWidth: 1.5 }, props.style]}>
33
+ <LibPicture style={applyStyle({ borderRadius: 5, width: LibStyle.width / 4.5, height: LibStyle.width / 4.5, backgroundColor: LibStyle.colorBgGrey })} source={{ uri: props?.event_image }} />
34
+ <View style={{ marginLeft: 10, justifyContent: 'space-between', flex: 1 }}>
35
+ <View style={{ flex: 1 }}>
36
+ <Text allowFontScaling={false} ellipsizeMode={'tail'} numberOfLines={2} style={applyStyle({ color: props?.colorText ? props?.colorText : "#000", marginBottom: 4, fontSize: 16, fontWeight: 'bold' })}>{props?.event_name}</Text>
37
+ <View style={applyStyle({ flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center' })}>
38
+ <Text allowFontScaling={false} style={applyStyle({ color: props?.colorText ? props?.colorText : "#000", fontSize: 14 })}>{props.item.price_name}</Text>
39
+ {
40
+ props.item.hasOwnProperty('seat_name') &&
41
+ <View style={applyStyle({ height: 35, width: 35, backgroundColor: "#fff", borderWidth: 1, borderColor: LibStyle.colorPrimary, borderRadius: 4, justifyContent: 'center', alignContent: 'center', alignItems: 'center' })}>
42
+ <LibIcon name="seat" color={LibStyle.colorPrimary} size={15} />
43
+ <Text allowFontScaling={false} style={applyStyle({ fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: LibStyle.colorPrimary })}>{props.item.seat_name}</Text>
44
+ </View>
45
+ }
46
+ </View>
47
+ </View>
48
+
49
+ <View style={{}}>
50
+ {
51
+ props?.item?.hall_scanned && props?.item?.hall_scanned != "0000-00-00 00:00:00" &&
52
+ <Text allowFontScaling={false} ellipsizeMode={'tail'} numberOfLines={2} style={applyStyle({ color: "#c9c9c9", marginBottom: 4, fontSize: 14, letterSpacing: 1.5 })}>{esp.lang("event/scan_item", "scan_on") + LibUtils.moment(props?.item?.hall_scanned).serverFormat("DD MMMM YYYY H:m:s")}</Text>
53
+ }
54
+ {
55
+ !Array.isArray(props?.item?.scanned_detail) && props?.item?.scanned_detail?.scanned != "" && props?.item?.scanned_detail?.scanned != "0000-00-00 00:00:00" &&
56
+ <Text allowFontScaling={false} ellipsizeMode={'tail'} numberOfLines={2} style={applyStyle({ color: LibStyle.colorRed, marginBottom: 4, fontSize: 14, letterSpacing: 1.5 })}>{esp.lang("event/scan_item", "scan_on") + LibUtils.moment(props?.item?.hall_scanned).serverFormat("DD MMMM YYYY H:m:s")}</Text>
57
+ }
58
+ {
59
+ props.item?.status == 1 &&
60
+ <ComponentButton style={applyStyle({ marginTop: 10, alignSelf: 'flex-end', width: LibStyle.width / 3, backgroundColor: props.colorBackground })} label={props.label} fontColor={props.colorFont} onPress={props.onPress} />
61
+ }
62
+ </View>
63
+ </View>
64
+ </View>
65
+ )
66
+ }