esoftplay-event 0.0.2-s → 0.0.2-u

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.
@@ -0,0 +1,60 @@
1
+ // withHooks
2
+ import { EventButton_order_detail } from 'esoftplay/cache/event/button_order_detail/import';
3
+ import { EventMessage } from 'esoftplay/cache/event/message/import';
4
+ import { LibCurl_view } from 'esoftplay/cache/lib/curl_view/import';
5
+
6
+ import React from 'react';
7
+ import { View } from 'react-native';
8
+
9
+
10
+ export interface EventOrder_detail_addonsArgs {
11
+
12
+ }
13
+ export interface EventOrder_detail_addonsProps {
14
+ dataTicket: any,
15
+ onPress: (item: any) => void
16
+ }
17
+ export default function m(props: EventOrder_detail_addonsProps): any {
18
+ let result = props.dataTicket
19
+
20
+ return (
21
+ <View style={{ backgroundColor: '#fff', marginTop: 1, borderRadius: 7, paddingBottom: 10, overflow: 'hidden', marginHorizontal: 15, marginBottom: 0 }}>
22
+ <LibCurl_view
23
+ url={result?.url_addons}
24
+ onSuccess={(res, msg): any => {
25
+ return (
26
+ <View>
27
+ {
28
+ res?.length > 0 && res?.map((item: any, i: number) => {
29
+ const isMultiple = item?.list?.length > 1
30
+ const isDisabled = item?.hasOwnProperty('status') && item.status == 0
31
+ const icon = isMultiple ? 'chevron-down' : 'plus-circle-outline'
32
+
33
+ return (
34
+ <EventButton_order_detail
35
+ key={i}
36
+ disable={isDisabled}
37
+ status_message={item?.status_message}
38
+ color={result?.color}
39
+ onPress={() => { props.onPress(item) }}
40
+ icon={icon}
41
+ title={item.title}
42
+ info={item.info}
43
+ />
44
+ )
45
+ })
46
+ }
47
+ </View>
48
+ )
49
+ }}
50
+ onError={(err) => {
51
+ return (
52
+ <EventMessage
53
+ message={err?.message}
54
+ />
55
+ )
56
+ }}
57
+ />
58
+ </View>
59
+ )
60
+ }
@@ -0,0 +1,61 @@
1
+ // withHooks
2
+ import { EventMessage } from 'esoftplay/cache/event/message/import';
3
+ import { LibIcon } from 'esoftplay/cache/lib/icon/import';
4
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
5
+ import { LibUtils } from 'esoftplay/cache/lib/utils/import';
6
+
7
+ import React from 'react';
8
+ import { Text, TouchableOpacity, View } from 'react-native';
9
+
10
+
11
+ export interface EventOrder_detail_addons_bookedArgs {
12
+
13
+ }
14
+ export interface EventOrder_detail_addons_bookedProps {
15
+ addonsBooked: any
16
+ errorAddonsBooked: any
17
+ onPress: () => void
18
+ }
19
+ export default function m(props: EventOrder_detail_addons_bookedProps): any {
20
+ return (
21
+ <View style={{ padding: 10, paddingLeft: 15, paddingBottom: 0 }}>
22
+ {
23
+ props?.addonsBooked?.length > 0 && props?.addonsBooked?.map((x: any, i: number) => {
24
+ return (
25
+ <View key={i} style={{ flexDirection: 'row', marginBottom: 10 }}>
26
+ <LibIcon name='check-decagram' size={20} color={LibStyle.colorGreen} />
27
+ <View style={{ marginLeft: 10 }}>
28
+ <Text allowFontScaling={false} style={{ color: '#484848', fontSize: 14, fontWeight: 'bold', fontFamily: "Arial" }}>
29
+ {x.price_name}
30
+ {x?.list?.length == 1 ? " (" + Number(x?.list?.[0]?.qty) + " Tiket)" : ""}
31
+ </Text>
32
+ {
33
+ x?.list?.length > 0 && x?.list?.map((z: any, i: number) => {
34
+ if (z?.ondate != "0000-00-00") {
35
+ return (
36
+ <Text key={i} allowFontScaling={false}>{LibUtils.moment(z.ondate).localeFormat('DD MMM YYYY') + " (" + Number(z.qty) + " Tiket)"}</Text>
37
+ )
38
+ } else {
39
+ return null
40
+ }
41
+ })
42
+ }
43
+ </View>
44
+ </View>
45
+ )
46
+ })
47
+ }
48
+ {
49
+ props?.errorAddonsBooked &&
50
+ <EventMessage
51
+ message={props?.errorAddonsBooked?.message}
52
+ children={
53
+ <TouchableOpacity onPress={() => { props.onPress() }} style={{ marginTop: -10 }}>
54
+ <LibIcon name='refresh-circle' size={40} color={LibStyle.colorBrown} />
55
+ </TouchableOpacity>
56
+ }
57
+ />
58
+ }
59
+ </View>
60
+ )
61
+ }
@@ -0,0 +1,66 @@
1
+ // withHooks
2
+ import { EventMessage } from 'esoftplay/cache/event/message/import';
3
+ import { LibCurl_view } from 'esoftplay/cache/lib/curl_view/import';
4
+ import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
5
+ import { LibPicture } from 'esoftplay/cache/lib/picture/import';
6
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
7
+ import esp from 'esoftplay/esp';
8
+
9
+ import React from 'react';
10
+ import { Text, TouchableOpacity, View } from 'react-native';
11
+
12
+
13
+ export interface EventOrder_detail_couponArgs {
14
+
15
+ }
16
+ export interface EventOrder_detail_couponProps {
17
+ dataTicket: any
18
+ }
19
+ export default function m(props: EventOrder_detail_couponProps): any {
20
+ let result = props.dataTicket
21
+ return (
22
+ <View style={{ backgroundColor: '#fff', marginTop: 1, borderRadius: 7, overflow: 'hidden', marginHorizontal: 15, marginBottom: 0 }}>
23
+ <LibCurl_view
24
+ url={result?.url_coupon}
25
+ onSuccess={(res, msg): any => {
26
+ return (
27
+ <View>
28
+ <Text style={{ margin: 15, marginBottom: 0, fontWeight: 'bold', fontSize: 14, color: "#495057" }}>{res?.title}</Text>
29
+
30
+ {
31
+ res?.list?.map((item: any, i: number) => {
32
+ return (
33
+ <TouchableOpacity key={i} onPress={() => {
34
+ if (item?.show_qr != 0) {
35
+ esp.modProp("event/coupon").getCouponDetail(item?.url_detail_coupon)
36
+ }
37
+ }} style={[{ marginBottom: 10, margin: 15, borderRadius: 15, backgroundColor: '#fff' }, LibStyle.elevation(2)]}>
38
+ <LibPicture source={{ uri: item.image }} resizeMode="cover" style={{ height: (LibStyle.width - 60) * 0.43, width: LibStyle.width - 60, borderRadius: 5 }} />
39
+ </TouchableOpacity>
40
+ )
41
+ })
42
+ }
43
+ {
44
+ res?.pages > 1 &&
45
+ <TouchableOpacity onPress={() => {
46
+ LibNavigation.navigate("event/coupon")
47
+ }}>
48
+ <View style={{ marginTop: 10, alignContent: 'center', alignItems: 'center', justifyContent: 'center', backgroundColor: LibStyle.colorPrimary, height: 50 }}>
49
+ <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 16, fontWeight: "bold", textAlign: 'center', fontStyle: "normal", letterSpacing: 0, color: "#fff" }}>{esp.lang("event/order_detail", "see_all_coupon")}</Text>
50
+ </View>
51
+ </TouchableOpacity>
52
+ }
53
+ </View>
54
+ )
55
+ }}
56
+ onError={(err) => {
57
+ return (
58
+ <EventMessage
59
+ message={err?.message}
60
+ />
61
+ )
62
+ }}
63
+ />
64
+ </View>
65
+ )
66
+ }
@@ -0,0 +1,96 @@
1
+ // withHooks
2
+ import { EventMessage } from 'esoftplay/cache/event/message/import';
3
+ import { LibCurl_view } from 'esoftplay/cache/lib/curl_view/import';
4
+ import { LibIcon } from 'esoftplay/cache/lib/icon/import';
5
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
6
+ import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
7
+ import { LibUtils } from 'esoftplay/cache/lib/utils/import';
8
+ import esp from 'esoftplay/esp';
9
+
10
+ import React from 'react';
11
+ import { Linking, Text, TouchableOpacity, View } from 'react-native';
12
+
13
+
14
+ export interface EventOrder_detail_instructionArgs {
15
+
16
+ }
17
+ export interface EventOrder_detail_instructionProps {
18
+ dataTicket: any
19
+ }
20
+ export default function m(props: EventOrder_detail_instructionProps): any {
21
+ let urlsInstruction: any[] = []
22
+ let result = props?.dataTicket
23
+ return (
24
+ <View style={{ backgroundColor: '#fff', marginTop: 1, borderRadius: 7, overflow: 'hidden', marginHorizontal: 15, marginBottom: 0 }}>
25
+ <LibCurl_view
26
+ url={result?.url_instructions}
27
+ onSuccess={(res, msg): any => {
28
+ urlsInstruction = []
29
+ res?.map?.((item: any) => {
30
+ let matches = item.match(/(https?:\/\/[^\s]+)/g);
31
+ if (matches) {
32
+ urlsInstruction.push(...matches)
33
+ }
34
+ })
35
+ return (
36
+ <View style={{ margin: 15 }}>
37
+ {
38
+ res?.map((item: any, i: number) => {
39
+ const urls = item.match(/(https?:\/\/[^\s]+)/g)
40
+ const text = item.replace(urls?.[0], '~:::~')
41
+ const texts = text.split('~:::~')
42
+ return (
43
+ <TouchableOpacity key={i + 1} onPress={() => {
44
+ if (item.match(/(https?:\/\/[^\s]+)/g)) {
45
+ Linking.openURL(urls[0])
46
+ }
47
+ }}>
48
+ <Text allowFontScaling={false} style={{ flexWrap: 'wrap', marginBottom: 5, fontSize: 14, fontWeight: "normal", fontStyle: "normal", lineHeight: 18, color: "#4a4a4a", marginTop: 4 }}>
49
+ {texts?.[0]}
50
+ {urls && <Text allowFontScaling={false} style={{ flexWrap: 'wrap', marginBottom: 5, fontSize: 14, fontWeight: "normal", fontStyle: "normal", lineHeight: 18, color: LibStyle.colorBlue, marginTop: 4 }}>{urls[0]}</Text>}
51
+ {texts?.[1]}
52
+ </Text>
53
+ </TouchableOpacity>
54
+ )
55
+ })
56
+ }
57
+
58
+ {
59
+ urlsInstruction?.length > 0 && urlsInstruction?.map((item: any, i: number) => {
60
+ return (
61
+ <View key={i + 1} style={{ padding: 10, marginTop: 10, flexDirection: 'row-reverse' }}>
62
+ <TouchableOpacity onPress={() => {
63
+ LibUtils.share(item)
64
+ }} style={{ ...LibStyle.elevation(5), alignContent: 'center', alignItems: 'center', justifyContent: 'center', backgroundColor: LibStyle.colorPrimary, height: 40, width: 40, borderRadius: 20, marginHorizontal: 10 }}>
65
+ <LibIcon color="#fff" name="share" />
66
+ </TouchableOpacity>
67
+ <TouchableOpacity onPress={() => {
68
+ LibUtils.copyToClipboard(item)
69
+ LibToastProperty.show(esp.lang("event/order_detail", "copied"))
70
+ }} style={{ ...LibStyle.elevation(5), alignContent: 'center', alignItems: 'center', justifyContent: 'center', backgroundColor: LibStyle.colorPrimary, height: 40, width: 40, borderRadius: 20, marginHorizontal: 10 }}>
71
+ <LibIcon color="#fff" name="content-copy" />
72
+ </TouchableOpacity>
73
+ <TouchableOpacity onPress={() => {
74
+ Linking.openURL(item)
75
+ }} style={{ ...LibStyle.elevation(5), alignContent: 'center', alignItems: 'center', justifyContent: 'center', backgroundColor: LibStyle.colorPrimary, height: 40, width: 40, borderRadius: 20, marginHorizontal: 10 }}>
76
+ <LibIcon.MaterialIcons color="#fff" name="open-in-browser" />
77
+ </TouchableOpacity>
78
+ </View>
79
+ )
80
+ })
81
+ }
82
+
83
+ </View>
84
+ )
85
+ }}
86
+ onError={(err) => {
87
+ return (
88
+ <EventMessage
89
+ message={err?.message}
90
+ />
91
+ )
92
+ }}
93
+ />
94
+ </View>
95
+ )
96
+ }
@@ -48,7 +48,7 @@ export default function m(props: EventOrder_detail_paymentProps): any {
48
48
  <Text allowFontScaling={false} style={{ fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, textAlign: "left", color: "#4a4a4a" }}>{esp.lang("event/order_detail_payment", "virtual_number_account")}</Text>
49
49
  <View style={{ marginTop: 10, flexDirection: "row", alignItems: "center", }}>
50
50
  <View style={{ flex: 1, backgroundColor: '#f1f2f3', borderRadius: 5, marginRight: 10, padding: 5 }} >
51
- <Text allowFontScaling={false} adjustsFontSizeToFit numberOfLines={1} style={{ fontSize: 30, fontStyle: "normal", letterSpacing: 0, textAlign: "left", color: LibStyle.colorPrimaryDark }}>{va_no}</Text>
51
+ <Text allowFontScaling={false} adjustsFontSizeToFit numberOfLines={1} style={{ fontSize: 30, fontStyle: "normal", fontFamily: 'DecoNumbers', letterSpacing: 0, textAlign: "left", color: LibStyle.colorPrimaryDark }}>{va_no.toString()}</Text>
52
52
  </View>
53
53
  <TouchableOpacity onPress={() => {
54
54
  LibUtils.copyToClipboard(va_no)
@@ -0,0 +1,109 @@
1
+ // withHooks
2
+
3
+ import { EventButton } from 'esoftplay/cache/event/button/import';
4
+ import { EventHeader } from 'esoftplay/cache/event/header/import';
5
+ import { EventHtmltext } from 'esoftplay/cache/event/htmltext/import';
6
+ import { EventQr_bg } from 'esoftplay/cache/event/qr_bg/import';
7
+ import { LibIcon } from 'esoftplay/cache/lib/icon/import';
8
+ import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
9
+ import { LibPicture } from 'esoftplay/cache/lib/picture/import';
10
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
11
+ import { LibUtils } from 'esoftplay/cache/lib/utils/import';
12
+ import { UseCondition } from 'esoftplay/cache/use/condition/import';
13
+ import esp from 'esoftplay/esp';
14
+ import moment from 'esoftplay/moment';
15
+ import React from 'react';
16
+ import { Text, TouchableOpacity, View } from 'react-native';
17
+ import QRCode from 'react-native-qrcode-svg';
18
+
19
+
20
+ export interface EventOrder_detail_rescheduleArgs {
21
+
22
+ }
23
+ export interface EventOrder_detail_rescheduleProps {
24
+ dataTicket: any
25
+ onPressQr: () => void
26
+ }
27
+ export default function m(props: EventOrder_detail_rescheduleProps): any {
28
+ let result = props.dataTicket
29
+ const imgWidth = LibStyle.width - 35
30
+ const imgHeight = imgWidth / 1920 * 1080
31
+ moment().locale?.('id')
32
+
33
+ const dateRange = LibUtils.getDateRange(result?.start_date, result?.end_date, " - ")
34
+ let isInvitationDate = result?.ondate == "0000-00-00" && result?.kind_detail?.use_code == 1
35
+ let isOnlineWithoutDate = result?.ondate == "0000-00-00" && result?.kind_detail?.everyday_pass == 0
36
+
37
+ return (
38
+ <View style={{ flex: 1, backgroundColor: '#f6f6f6' }}>
39
+ <EventHeader title={esp.lang("event/order_detail", "order_detail")} />
40
+ <View style={[{ margin: 18, borderTopLeftRadius: 7, borderTopRightRadius: 7, backgroundColor: '#fff', paddingBottom: 10 }, LibStyle.elevation(3)]}>
41
+
42
+ <TouchableOpacity onPress={() => {
43
+ LibNavigation.navigate('lib/gallery', { image: result?.image })
44
+ }}>
45
+ <LibPicture source={{ uri: result?.image }} style={{ borderTopLeftRadius: 7, borderTopRightRadius: 7, height: imgHeight, width: imgWidth }} resizeMode="cover" />
46
+ </TouchableOpacity>
47
+ <View style={{ flexDirection: 'row', margin: 14, marginTop: 4, justifyContent: 'space-between' }}>
48
+ <View style={{ marginTop: 14 }}>
49
+ <EventHtmltext allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, color: "#484848" }}>{esp.lang("event/order_detail", "ticket")}{result?.price_name}</EventHtmltext>
50
+ <View style={{ flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
51
+ <LibIcon name="ticket-outline" size={20} />
52
+ <Text allowFontScaling={false} style={{ marginLeft: 6, fontFamily: "Arial", fontSize: 30, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#484848" }}>{result?.qty}</Text>
53
+ <Text allowFontScaling={false} style={{ marginLeft: 4, fontFamily: "Arial", fontSize: 16, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, color: "#484848" }}>{esp.lang("event/order_detail", "ticket")}</Text>
54
+ </View>
55
+ <UseCondition if={result?.show_ticket_status == 1 && result?.status == 1 || result?.status == 3 || result?.status == 6}>
56
+ <Text allowFontScaling={false} style={{ fontSize: 12, fontWeight: "normal", fontStyle: "normal", flexWrap: 'wrap', letterSpacing: 0, marginBottom: 12, color: "#484848" }}>
57
+ {
58
+ result?.qty_used == 0 ? esp.lang("event/order", "have_not_been_used")
59
+ :
60
+ result.kind_detail?.everyday_pass == 1 ?
61
+ "(" + result?.qty_used_today + " " + esp.lang("event/order_detail", "used_today") + ")"
62
+ :
63
+ "(" + result?.qty_used + " " + esp.lang("event/order_detail", "used") + ")"
64
+ }
65
+ </Text>
66
+ </UseCondition>
67
+ <View style={{ flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
68
+ <LibIcon name="calendar-blank-outline" size={20} />
69
+ <Text allowFontScaling={false} style={{ marginLeft: 6, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#484848" }}>{result?.ondate != "0000-00-00" ? moment(result?.ondate).localeFormat("DD MMMM YYYY") : ((isInvitationDate || isOnlineWithoutDate) ? esp.lang("event/order_item", "used_once") : dateRange)}</Text>
70
+ </View>
71
+ </View>
72
+ {
73
+ result?.status == "1" &&
74
+ <View style={{ marginTop: 14, justifyContent: 'center', alignContent: 'center', alignItems: 'center' }}>
75
+ {
76
+ result?.qr != "" &&
77
+ <TouchableOpacity onPress={() => {
78
+ result?.status == "1" && props.onPressQr()
79
+ }}>
80
+ <EventQr_bg>
81
+ <QRCode ecl="H" size={80} value={result?.qr} />
82
+ </EventQr_bg>
83
+ </TouchableOpacity>
84
+ }
85
+ </View>
86
+ }
87
+ </View>
88
+
89
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }} >
90
+ <View style={{ width: 19, height: 19, borderRadius: 9.5, backgroundColor: "#f6f6f6", marginLeft: -9.5 }} />
91
+ {/* <Text style={{ marginTop: 5, alignSelf: 'center', fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, textAlign: "center", color: "#f39c12" }} ></Text> */}
92
+ <View style={{ width: 19, height: 19, borderRadius: 9.5, backgroundColor: "#f6f6f6", marginRight: -9.5 }} />
93
+ </View>
94
+
95
+ <View style={{ margin: 14, flexDirection: 'row' }}>
96
+ <Text style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: LibStyle.colorRed }} >{result?.reschedule_notes}</Text>
97
+ </View>
98
+ {
99
+ result?.par_id > 0 ?
100
+ null
101
+ :
102
+ <EventButton onPress={() => {
103
+ LibNavigation.navigate('event/order_reschedule', { url: result?.url_reschedule })
104
+ }} label={result?.is_refundable == 1 ? esp.lang("event/order_detail", "refund_rescedule") : esp.lang("event/order_detail", "rescedule")} backgroundColor={LibStyle.colorGreen} style={{ marginLeft: 20, marginRight: 20, marginBottom: 10 }} />
105
+ }
106
+ </View>
107
+ </View>
108
+ )
109
+ }
@@ -119,7 +119,7 @@ export default function m(props: EventOrder_detail_returnProps): any {
119
119
 
120
120
  return (
121
121
  <View style={{ flex: 1 }}>
122
- <EventHeader title='Kembalikan Tiket' />
122
+ <EventHeader title={esp.lang("event/order_detail_return", "send_back_ticket")} />
123
123
  <ScrollView style={{ padding: 15 }}>
124
124
 
125
125
  <Text allowFontScaling={false} style={{ color: '#4a4a4a', fontFamily: "Arial", fontSize: 12, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0 }}>{"Tiket akan dikembalikan kepada"}</Text>
@@ -0,0 +1,174 @@
1
+ // withHooks
2
+ import { applyStyle } from 'esoftplay';
3
+ import { EventRating } from 'esoftplay/cache/event/rating/import';
4
+ import { EventReviewProperty } from 'esoftplay/cache/event/review/import';
5
+ import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
6
+ import { LibPicture } from 'esoftplay/cache/lib/picture/import';
7
+ import { LibUtils } from 'esoftplay/cache/lib/utils/import';
8
+ import { UserClass } from 'esoftplay/cache/user/class/import';
9
+ import esp from 'esoftplay/esp';
10
+
11
+ import React from 'react';
12
+ import { Pressable, Text, View } from 'react-native';
13
+
14
+
15
+ export interface EventOrder_detail_reviewArgs {
16
+
17
+ }
18
+ export interface EventOrder_detail_reviewProps {
19
+ dataReview: any
20
+ dataTicket: any
21
+ }
22
+ export default function m(props: EventOrder_detail_reviewProps): any {
23
+ const [user] = UserClass.state().useState()
24
+ const dataReview = props.dataReview
25
+ const result = props.dataTicket
26
+
27
+ let startEvent = result?.start_date + " " + result?.start_time
28
+ let dateNow = LibUtils.moment().localeFormat("YYYY-MM-DD HH:mm")
29
+
30
+ function getStringReview(data: any) {
31
+ const groupedData = data.reduce((acc: any[], obj: any) => {
32
+ const { survey_id, survey_question, survey_option, content } = obj;
33
+
34
+ if (!acc[survey_id]) {
35
+ acc[survey_id] = {
36
+ survey_id,
37
+ survey_question,
38
+ values: []
39
+ };
40
+ }
41
+
42
+ if (survey_option) {
43
+ acc[survey_id].values.push(survey_option);
44
+ }
45
+ if (content) {
46
+ acc[survey_id].values.push(content);
47
+ }
48
+
49
+ return acc;
50
+ }, {});
51
+
52
+ const finalResult = Object.values(groupedData).map((group: any) => {
53
+ const { survey_question, values } = group;
54
+ const valuesString = values.join(", ");
55
+ return `\nQ: ${survey_question}\nA: ${valuesString}`;
56
+ })
57
+ return finalResult
58
+ }
59
+
60
+
61
+ const ReviewCard = ({ user, dataReview }: any) => {
62
+ return (
63
+ <View style={{ margin: 15, marginBottom: 0, borderRadius: 7, backgroundColor: 'white', padding: 10 }}>
64
+ <View style={{ flexDirection: 'row', alignItems: 'flex-start', marginTop: 10 }}>
65
+ <LibPicture source={{ uri: user?.image }} style={{ height: 50, width: 50, borderRadius: 25 }} />
66
+ <View style={{ marginLeft: 10, flex: 1 }}>
67
+ <Text allowFontScaling={false} numberOfLines={1} ellipsizeMode='tail' style={{ fontSize: 16, fontWeight: 'bold' }}>{user?.name}</Text>
68
+ <Text allowFontScaling={false} style={{ fontSize: 12, color: '#c9c9c9' }}>{LibUtils.moment(dataReview?.review?.created).localeFormat("D MMM YYYY")}</Text>
69
+ <View style={{ marginTop: 5 }}>
70
+ <EventRating disabled onChangeRating={() => { }} defaultValue={dataReview?.review?.rating} size={18} containerStyle={{ padding: 0, justifyContent: 'flex-start' }} />
71
+ {
72
+ dataReview?.review?.content != "" &&
73
+ <Text allowFontScaling={false} style={{ marginTop: 10, fontSize: 12, color: '#000' }}>{dataReview?.review?.content.replace(/\\n/g, '\n')}</Text>
74
+ }
75
+ {
76
+ dataReview?.surveys?.length > 0 &&
77
+ getStringReview(dataReview?.surveys).map((sur) => (
78
+ <Text allowFontScaling={false} style={{ fontSize: 12, color: '#000' }}>{sur}</Text>
79
+ ))
80
+ }
81
+ </View>
82
+ </View>
83
+ </View>
84
+ {
85
+ dataReview?.status == 2 &&
86
+ <View style={applyStyle({ borderColor: '#FC9722', backgroundColor: '#FDF1DE', borderWidth: 1, borderStyle: 'dashed', borderRadius: 5, padding: 5, marginTop: 15, marginBottom: 0 })} >
87
+ <Text allowFontScaling={false} style={applyStyle({ fontFamily: "Arial", fontSize: 12, fontStyle: "normal", letterSpacing: 0, color: "#4a4a4a" })}>{esp.lang("event/order_detail", "thanks")}</Text>
88
+ </View>
89
+ }
90
+ </View>
91
+ )
92
+ }
93
+
94
+ const ReviewForm = ({ result, onRate }: any) => {
95
+ return (
96
+ <Pressable>
97
+ <EventRating
98
+ onChangeRating={onRate}
99
+ defaultValue={5}
100
+ size={50}
101
+ containerStyle={{ padding: 0, backgroundColor: 'transparent' }}
102
+ />
103
+ <Text style={{ alignSelf: 'center', marginTop: 15, fontSize: 18, fontWeight: 'bold', color: '#fff' }}>{esp.lang("event/order_detail", "leave_review")}</Text>
104
+ <Text style={{ alignSelf: 'center', marginTop: 7, fontSize: 14, color: '#fff' }}>{esp.lang("event/order_detail", "review_info")}</Text>
105
+ </Pressable>
106
+ )
107
+ }
108
+
109
+ const ReviewedResult = ({ user, dataReview }: any) => {
110
+ return (
111
+ <View style={{ margin: -10, backgroundColor: '#fff', padding: 10, borderRadius: 7 }}>
112
+ <View style={{ flexDirection: 'row', alignItems: 'center' }}>
113
+ <LibPicture source={{ uri: user?.image }} style={{ height: 50, width: 50, borderRadius: 25 }} />
114
+ <View style={{ marginLeft: 10 }}>
115
+ <Text numberOfLines={1} style={{ fontSize: 16, fontWeight: 'bold' }}>{user?.name}</Text>
116
+ <Text style={{ fontSize: 12, color: '#c9c9c9' }}>{LibUtils.moment(dataReview?.review?.created).localeFormat("D MMM YYYY")}</Text>
117
+ <EventRating
118
+ disabled
119
+ defaultValue={dataReview?.review?.rating}
120
+ onChangeRating={() => { }}
121
+ size={18}
122
+ containerStyle={{ padding: 0 }}
123
+ />
124
+ </View>
125
+ </View>
126
+ <Text numberOfLines={5} style={{ marginTop: 10, fontSize: 12 }}>{dataReview?.review?.content}</Text>
127
+ </View>
128
+ )
129
+ }
130
+
131
+ return (
132
+ <View>
133
+ {
134
+ dataReview?.status == 1 &&
135
+ <ReviewCard
136
+ user={user}
137
+ dataReview={dataReview}
138
+ />
139
+ }
140
+ {
141
+ dataReview?.status != 1 && dateNow > startEvent && (
142
+ <View style={{ margin: 15, borderRadius: 7, backgroundColor: '#000', padding: 10 }}>
143
+ {
144
+ dataReview?.review == null ?
145
+ <ReviewForm
146
+ result={result}
147
+ onRate={(rate: any) => {
148
+ let type = EventReviewProperty.calculateProb(result?.config?.review)
149
+ let args = {
150
+ url_form: "event_order_detail_review_form?id=" + result?.id + "&type=" + type?.type,
151
+ type: type?.type,
152
+ booking_id: result?.id,
153
+ rate: rate
154
+ }
155
+
156
+ if (result?.review_status != 1) {
157
+ LibNavigation.navigate('event/review_add', args)
158
+ }
159
+
160
+ }}
161
+ />
162
+ :
163
+ <ReviewedResult
164
+ user={user}
165
+ dataReview={dataReview}
166
+ />
167
+ }
168
+ </View>
169
+ )
170
+ }
171
+
172
+ </View>
173
+ )
174
+ }
@@ -136,6 +136,7 @@ export default function m(props: EventOrder_detail_shareProps): any {
136
136
  }
137
137
 
138
138
  let checkNotUsed = dataTicket?.length > 0 && dataTicket?.filter((x: any) => x?.checked == 0)
139
+ let valid = dataTicket?.some((item: any) => item.checked == 1);
139
140
 
140
141
  return (
141
142
  <LibKeyboard_avoid style={{ flex: 1, backgroundColor: '#fff' }}>
@@ -284,13 +285,15 @@ export default function m(props: EventOrder_detail_shareProps): any {
284
285
  <EventButton
285
286
  label={esp.lang("event/order_detail_share", "share_ticket")}
286
287
  onPress={() => {
287
- LibNavigation.navigateForResult("bigbang/payment_pin", undefined, 1132).then((p) => {
288
- if (p) {
289
- shareTicket(p)
290
- }
291
- })
288
+ if (valid) {
289
+ LibNavigation.navigateForResult("bigbang/payment_pin", undefined, 1132).then((p) => {
290
+ if (p) {
291
+ shareTicket(p)
292
+ }
293
+ })
294
+ }
292
295
  }}
293
- backgroundColor={LibStyle.colorPrimary}
296
+ backgroundColor={valid ? LibStyle.colorPrimary : LibStyle.colorBgGrey}
294
297
  style={{ borderRadius: 5, marginTop: 10 }}
295
298
  />
296
299
  </View>