esoftplay-event 0.0.0-y → 0.0.1-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.
- package/event/detail.tsx +44 -3
- package/event/test.tsx +142 -142
- package/event/ticket_list.tsx +5 -2
- package/event/ticket_list2.tsx +3 -1
- package/id.json +1 -1
- package/package.json +1 -1
package/event/detail.tsx
CHANGED
|
@@ -24,6 +24,41 @@ import React, { useEffect } from 'react';
|
|
|
24
24
|
import { Linking, Pressable, Text, TouchableOpacity, View } from 'react-native';
|
|
25
25
|
import MapView, { Marker } from 'react-native-maps';
|
|
26
26
|
|
|
27
|
+
function timezoneCorrection(input: string | Date, timezone: string): string {
|
|
28
|
+
const tzMap: Record<string, string> = {
|
|
29
|
+
'GMT+7': 'Asia/Jakarta',
|
|
30
|
+
'GMT+8': 'Asia/Singapore',
|
|
31
|
+
'GMT+9': 'Asia/Tokyo'
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const tzString = tzMap[timezone] || 'Asia/Jakarta';
|
|
35
|
+
|
|
36
|
+
let date: Date;
|
|
37
|
+
if (typeof input === 'string') {
|
|
38
|
+
const iso = input.replace(' ', 'T') + '+07:00';
|
|
39
|
+
date = new Date(iso);
|
|
40
|
+
} else {
|
|
41
|
+
date = input;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const options: Intl.DateTimeFormatOptions = {
|
|
45
|
+
timeZone: tzString,
|
|
46
|
+
year: 'numeric',
|
|
47
|
+
month: '2-digit',
|
|
48
|
+
day: '2-digit',
|
|
49
|
+
hour: '2-digit',
|
|
50
|
+
minute: '2-digit',
|
|
51
|
+
second: '2-digit',
|
|
52
|
+
hour12: false,
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const formatted = date.toLocaleString('en-GB', options)
|
|
56
|
+
const [datePart, timePart] = formatted.split(', ')
|
|
57
|
+
const [day, month, year] = datePart.split('/')
|
|
58
|
+
|
|
59
|
+
return `${year}-${month}-${day} ${timePart}`
|
|
60
|
+
}
|
|
61
|
+
|
|
27
62
|
export interface EventDetailProps {
|
|
28
63
|
|
|
29
64
|
}
|
|
@@ -256,7 +291,11 @@ export default function m(props: EventDetailProps): any {
|
|
|
256
291
|
<View style={{ height: 35, borderRadius: 17, backgroundColor: LibStyle.colorLightGrey, justifyContent: 'center', alignItems: 'center', paddingHorizontal: 9 }} >
|
|
257
292
|
<Text allowFontScaling={false} style={{ fontFamily: "ArialBold", fontSize: 12, textAlign: "center", textAlignVertical: 'center', color: 'black', marginHorizontal: 10 }} >
|
|
258
293
|
{
|
|
259
|
-
esp.lang("event/detail", "text_book_on",
|
|
294
|
+
esp.lang("event/detail", "text_book_on",
|
|
295
|
+
!!result?.timezone ?
|
|
296
|
+
moment(timezoneCorrection(result.start_booking, result?.timezone)).format('DD MMMM YYYY H:mm:ss', true)
|
|
297
|
+
: moment(result.start_booking).serverFormat('DD MMMM YYYY H:mm:ss')
|
|
298
|
+
, result?.timezone_locale || "")
|
|
260
299
|
}
|
|
261
300
|
</Text>
|
|
262
301
|
</View>
|
|
@@ -294,7 +333,8 @@ export default function m(props: EventDetailProps): any {
|
|
|
294
333
|
is_subscribed: result?.config?.is_subscribed,
|
|
295
334
|
is_subscribed_default: result?.config?.is_subscribed_default,
|
|
296
335
|
is_subscribed_label: result?.config?.is_subscribed_label
|
|
297
|
-
}
|
|
336
|
+
},
|
|
337
|
+
show_fee_percentage: result?.config?.show_fee_percentage
|
|
298
338
|
})
|
|
299
339
|
})
|
|
300
340
|
} else {
|
|
@@ -310,7 +350,8 @@ export default function m(props: EventDetailProps): any {
|
|
|
310
350
|
is_subscribed: result?.config?.is_subscribed,
|
|
311
351
|
is_subscribed_default: result?.config?.is_subscribed_default,
|
|
312
352
|
is_subscribed_label: result?.config?.is_subscribed_label
|
|
313
|
-
}
|
|
353
|
+
},
|
|
354
|
+
show_fee_percentage: result?.config?.show_fee_percentage
|
|
314
355
|
})
|
|
315
356
|
}
|
|
316
357
|
|
package/event/test.tsx
CHANGED
|
@@ -1,155 +1,155 @@
|
|
|
1
|
-
// withHooks
|
|
2
|
-
import { Canvas, Group, RoundedRect, Text, useFont } from '@shopify/react-native-skia';
|
|
3
|
-
import { LibCurl } from 'esoftplay/cache/lib/curl/import';
|
|
4
|
-
import { LibIcon } from 'esoftplay/cache/lib/icon/import';
|
|
5
|
-
import useSafeState from 'esoftplay/state';
|
|
6
|
-
import React, { useCallback, useEffect, useState } from 'react';
|
|
7
|
-
import { Dimensions, Pressable, ScrollView, View } from 'react-native';
|
|
8
|
-
import { TapGestureHandler, TapGestureHandlerStateChangeEvent } from 'react-native-gesture-handler';
|
|
1
|
+
// // withHooks
|
|
2
|
+
// import { Canvas, Group, RoundedRect, Text, useFont } from '@shopify/react-native-skia';
|
|
3
|
+
// import { LibCurl } from 'esoftplay/cache/lib/curl/import';
|
|
4
|
+
// import { LibIcon } from 'esoftplay/cache/lib/icon/import';
|
|
5
|
+
// import useSafeState from 'esoftplay/state';
|
|
6
|
+
// import React, { useCallback, useEffect, useState } from 'react';
|
|
7
|
+
// import { Dimensions, Pressable, ScrollView, View } from 'react-native';
|
|
8
|
+
// import { TapGestureHandler, TapGestureHandlerStateChangeEvent } from 'react-native-gesture-handler';
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
export interface EventSeat_map_matrixArgs {
|
|
11
|
+
// export interface EventSeat_map_matrixArgs {
|
|
12
12
|
|
|
13
|
-
}
|
|
14
|
-
export interface EventSeat_map_matrixProps {
|
|
13
|
+
// }
|
|
14
|
+
// export interface EventSeat_map_matrixProps {
|
|
15
15
|
|
|
16
|
-
}
|
|
17
|
-
export default function m(props: any): any {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
// }
|
|
17
|
+
// export default function m(props: any): any {
|
|
18
|
+
// const deviceWidth = Dimensions.get('window').width;
|
|
19
|
+
// const [selectedIdx, setSelectedIdx] = useState<number | null>(null);
|
|
20
|
+
// const [scale, setScale] = useState(1);
|
|
21
|
+
// const [boundingBox, setBoundingBox] = useSafeState({ "x1": 1, "x2": 2, "y1": 1, "y2": 2 })
|
|
22
|
+
// const [data, setData] = useSafeState<[number, number, string, number][]>([])
|
|
23
|
+
// const initialBoxSize = 30;
|
|
24
|
+
// const contentWidth = (boundingBox.x2 - (boundingBox.x1 - 1.1)) * initialBoxSize
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
// // Scale boxSize so that contentWidth fits deviceWidth
|
|
27
|
+
// const scaleToFit = deviceWidth / contentWidth;
|
|
28
|
+
// const boxSize = initialBoxSize * scaleToFit;
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
// // Recalculate xs, ys, width, height with scaled boxSize
|
|
31
|
+
// const xsScaled = data.map(([x]) => isNaN(x) ? 0 : (boxSize) + (x * boxSize));
|
|
32
|
+
// const ysScaled = data.map(([_, y]) => isNaN(y) ? 0 : (boxSize) + (y * boxSize));
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
// const width = Math.max(deviceWidth, xsScaled.length && xsScaled.every(v => !isNaN(v)) ? Math.max(...xsScaled) + boxSize : boxSize * 2);
|
|
35
|
+
// const height = ysScaled.length && ysScaled.every(v => !isNaN(v)) ? Math.max(...ysScaled) + boxSize : boxSize * 2;
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
37
|
+
// const fontSize: any = {
|
|
38
|
+
// 1: useFont(require('../../assets/fonts/MonoSpace.ttf'), boxSize * 0.3),
|
|
39
|
+
// 2: useFont(require('../../assets/fonts/MonoSpace.ttf'), boxSize * 0.3),
|
|
40
|
+
// 3: useFont(require('../../assets/fonts/MonoSpace.ttf'), boxSize * 0.25),
|
|
41
|
+
// 4: useFont(require('../../assets/fonts/MonoSpace.ttf'), boxSize * 0.2),
|
|
42
|
+
// 5: useFont(require('../../assets/fonts/MonoSpace.ttf'), boxSize * 0.2),
|
|
43
|
+
// 6: useFont(require('../../assets/fonts/MonoSpace.ttf'), boxSize * 0.15),
|
|
44
|
+
// }
|
|
45
|
+
// const handleTap = useCallback((event: TapGestureHandlerStateChangeEvent) => {
|
|
46
|
+
// if (event.nativeEvent.state !== 5) return;
|
|
47
|
+
// // Adjust tap coordinates for scale
|
|
48
|
+
// const x = event.nativeEvent.x / scale;
|
|
49
|
+
// const y = event.nativeEvent.y / scale;
|
|
50
|
+
// for (let i = 0; i < data.length; i++) {
|
|
51
|
+
// const [sx, sy, seatName] = data[i];
|
|
52
|
+
// const xSize = (boxSize / 2) + (sx * boxSize);
|
|
53
|
+
// const ySize = (boxSize / 2) + (sy * boxSize);
|
|
54
|
+
// if (x >= xSize && x <= xSize + boxSize && y >= ySize && y <= ySize + boxSize) {
|
|
55
|
+
// setSelectedIdx(i);
|
|
56
|
+
// return;
|
|
57
|
+
// }
|
|
58
|
+
// }
|
|
59
|
+
// setSelectedIdx(null);
|
|
60
|
+
// }, [data, boxSize, scale]);
|
|
61
61
|
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
63
|
+
// useEffect(() => {
|
|
64
|
+
// new LibCurl("v3/event_seat", {
|
|
65
|
+
// event_id: 398,
|
|
66
|
+
// price_id: 1922,
|
|
67
|
+
// ondate: "0000-00-00"
|
|
68
|
+
// }, (res, msg) => {
|
|
69
|
+
// setBoundingBox(res.metadata.bounding_box)
|
|
70
|
+
// console.log(JSON.stringify(res, undefined, 2))
|
|
71
|
+
// setData(res.layout.split(';').map((item) => item.split(',')).map(([x, y, seatName, status]) => [Number(x), Number(y), seatName, Number(status)]))
|
|
72
|
+
// })
|
|
73
|
+
// }, [])
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
75
|
+
// return (
|
|
76
|
+
// <View key={scale} style={{ flex: 1 }} >
|
|
77
|
+
// <ScrollView horizontal style={{ flex: 1 }}>
|
|
78
|
+
// <ScrollView style={{ flex: 1 }}>
|
|
79
|
+
// <TapGestureHandler onHandlerStateChange={handleTap}>
|
|
80
|
+
// <View>
|
|
81
|
+
// <Canvas
|
|
82
|
+
// style={{
|
|
83
|
+
// width: width * scale,
|
|
84
|
+
// height: height * scale,
|
|
85
|
+
// padding: 10,
|
|
86
|
+
// backgroundColor: "#f1f2f3",
|
|
87
|
+
// }}>
|
|
88
|
+
// {
|
|
89
|
+
// data.map(([x, y, name, status], i) => {
|
|
90
|
+
// const color = selectedIdx == i ? "lime" : getColorByStatus(status)
|
|
91
|
+
// const xSize = (boxSize / 2) + (x * boxSize)
|
|
92
|
+
// const ySize = (boxSize / 2) + (y * boxSize)
|
|
93
|
+
// return (
|
|
94
|
+
// <Group key={i}>
|
|
95
|
+
// <RoundedRect
|
|
96
|
+
// x={xSize - 1}
|
|
97
|
+
// r={(boxSize + 2) * 0.34}
|
|
98
|
+
// y={ySize - 1}
|
|
99
|
+
// width={boxSize + 2}
|
|
100
|
+
// transform={[{ scale }]}
|
|
101
|
+
// height={boxSize + 2}
|
|
102
|
+
// color={"#999"} />
|
|
103
|
+
// <RoundedRect
|
|
104
|
+
// x={xSize}
|
|
105
|
+
// r={boxSize * 0.32}
|
|
106
|
+
// y={ySize}
|
|
107
|
+
// width={boxSize}
|
|
108
|
+
// transform={[{ scale }]}
|
|
109
|
+
// height={boxSize}
|
|
110
|
+
// color={color} />
|
|
111
|
+
// {name && fontSize[name.length] && (
|
|
112
|
+
// <Text
|
|
113
|
+
// x={(xSize) + boxSize * (5 - name.length) * 0.1}
|
|
114
|
+
// y={(ySize) + boxSize * 0.60}
|
|
115
|
+
// color="#020202"
|
|
116
|
+
// text={name}
|
|
117
|
+
// transform={[{ scale }]}
|
|
118
|
+
// font={fontSize[name.length]} />
|
|
119
|
+
// )}
|
|
120
|
+
// </Group>
|
|
121
|
+
// )
|
|
122
|
+
// })
|
|
123
|
+
// }
|
|
124
|
+
// </Canvas>
|
|
125
|
+
// </View>
|
|
126
|
+
// </TapGestureHandler>
|
|
127
|
+
// </ScrollView>
|
|
128
|
+
// </ScrollView>
|
|
129
|
+
// <View style={{ flexDirection: "row" }} >
|
|
130
|
+
// <Pressable onPress={() => setScale((x) => x - 0.3)} >
|
|
131
|
+
// <LibIcon.AntDesign name='minuscircleo' />
|
|
132
|
+
// </Pressable>
|
|
133
|
+
// <Pressable onPress={() => setScale((x) => x + 0.3)} >
|
|
134
|
+
// <LibIcon.AntDesign name='pluscircleo' />
|
|
135
|
+
// </Pressable>
|
|
136
|
+
// </View>
|
|
137
|
+
// </View>
|
|
138
|
+
// )
|
|
139
|
+
// }
|
|
140
140
|
|
|
141
141
|
|
|
142
|
-
function getColorByStatus(statuses: number) {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}
|
|
142
|
+
// function getColorByStatus(statuses: number) {
|
|
143
|
+
// const colors: any = {
|
|
144
|
+
// 8: 'purple',
|
|
145
|
+
// 0: "white",
|
|
146
|
+
// 1: "#9FA1A4",
|
|
147
|
+
// 2: "#6B71E6",
|
|
148
|
+
// 3: "#2EBBE8",
|
|
149
|
+
// 4: "#FFA601",
|
|
150
|
+
// 5: "#fff",
|
|
151
|
+
// 6: "#FF4866",
|
|
152
|
+
// 7: "#6C432C"
|
|
153
|
+
// }
|
|
154
|
+
// return colors[statuses]
|
|
155
|
+
// }
|
package/event/ticket_list.tsx
CHANGED
|
@@ -134,7 +134,7 @@ export default function m(props: EventTicket_listProps): any {
|
|
|
134
134
|
|
|
135
135
|
const [pendingData] = EventLoading_pageProperty.state().useState()
|
|
136
136
|
|
|
137
|
-
const { url, fee_platform, has_addition, has_addition_global, subscribed }: any = useRef(LibNavigation.getArgsAll(props)).current
|
|
137
|
+
const { url, fee_platform, has_addition, has_addition_global, subscribed, show_fee_percentage }: any = useRef(LibNavigation.getArgsAll(props)).current
|
|
138
138
|
|
|
139
139
|
const [deeplinkParams] = UseDeeplinkProperty.params.useState()
|
|
140
140
|
const [timer] = EventCountdownProperty.countdownTime.useState()
|
|
@@ -270,6 +270,7 @@ export default function m(props: EventTicket_listProps): any {
|
|
|
270
270
|
dataBookingEvent: { ...newDataPost, qty: getQty() },
|
|
271
271
|
subscribed: subscribed,
|
|
272
272
|
url_payment: urlPayment,
|
|
273
|
+
show_fee_percentage
|
|
273
274
|
})
|
|
274
275
|
})
|
|
275
276
|
} else {
|
|
@@ -280,6 +281,7 @@ export default function m(props: EventTicket_listProps): any {
|
|
|
280
281
|
dataBookingEvent: { ...newDataPost, qty: getQty() },
|
|
281
282
|
subscribed: subscribed,
|
|
282
283
|
url_payment: urlPayment,
|
|
284
|
+
show_fee_percentage
|
|
283
285
|
})
|
|
284
286
|
}
|
|
285
287
|
}
|
|
@@ -294,7 +296,8 @@ export default function m(props: EventTicket_listProps): any {
|
|
|
294
296
|
// tak arahke halaman seng anyar
|
|
295
297
|
LibNavigation.navigate('payment/event_invitation', {
|
|
296
298
|
dataBookingEvent: dataPost,
|
|
297
|
-
subscribed: subscribed
|
|
299
|
+
subscribed: subscribed,
|
|
300
|
+
show_fee_percentage
|
|
298
301
|
})
|
|
299
302
|
} else if (selectedTicket?.use_seat == 1) {
|
|
300
303
|
if (selectedTicket?.config && selectedTicket?.config?.seat_autopick == 1) {
|
package/event/ticket_list2.tsx
CHANGED
|
@@ -135,7 +135,7 @@ export default function m(props: EventTicket_list2Props): any {
|
|
|
135
135
|
|
|
136
136
|
const [pendingData] = EventLoading_pageProperty.state().useState()
|
|
137
137
|
|
|
138
|
-
const { has_addition, has_addition_global, url, fee_platform, subscribed }: any = useRef(LibNavigation.getArgsAll(props)).current
|
|
138
|
+
const { has_addition, has_addition_global, url, fee_platform, subscribed, show_fee_percentage }: any = useRef(LibNavigation.getArgsAll(props)).current
|
|
139
139
|
|
|
140
140
|
const [deeplinkParams] = UseDeeplinkProperty.params.useState()
|
|
141
141
|
const [timer] = EventCountdownProperty.countdownTime.useState()
|
|
@@ -173,6 +173,7 @@ export default function m(props: EventTicket_list2Props): any {
|
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
},
|
|
176
|
+
show_fee_percentage
|
|
176
177
|
}, item.list_id)
|
|
177
178
|
.then((value: any) => {
|
|
178
179
|
const merged = { ...item, ...value }
|
|
@@ -259,6 +260,7 @@ export default function m(props: EventTicket_list2Props): any {
|
|
|
259
260
|
dataTicket: getDataPostBooking(),
|
|
260
261
|
subscribed: subscribed,
|
|
261
262
|
url_payment: urlPayment,
|
|
263
|
+
show_fee_percentage
|
|
262
264
|
})
|
|
263
265
|
})
|
|
264
266
|
|
package/id.json
CHANGED
|
@@ -533,7 +533,7 @@
|
|
|
533
533
|
"start_from": "mulai dari %s",
|
|
534
534
|
"tb_announce": "To Be Announced",
|
|
535
535
|
"text_about_event": "Tentang Acara",
|
|
536
|
-
"text_book_on": "Booking On %s",
|
|
536
|
+
"text_book_on": "Booking On %s %s",
|
|
537
537
|
"text_booking_end": "Booking Tiket Telah Berakhir",
|
|
538
538
|
"text_buy_ticket": "Beli Tiket",
|
|
539
539
|
"text_event_cat": "Kategori Event",
|