react-native-flyy 1.4.28 → 1.4.30

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,9 +1,8 @@
1
1
  // @ts-nocheck
2
2
  import React, { useEffect, useState } from 'react';
3
- import { Image, NativeModules, Text, TouchableOpacity, View, Dimensions, ToastAndroid, Linking } from 'react-native';
4
- import Draggable from 'react-native-draggable';
3
+ import { Image, NativeModules, Text, TouchableOpacity, View, Dimensions, FlatList } from 'react-native'; // import Draggable from 'react-native-draggable';
4
+
5
5
  import FlyyCheckinComponent from './flyy_checkin_view';
6
- import AsyncStorage from '@react-native-async-storage/async-storage';
7
6
  const {
8
7
  Flyy
9
8
  } = NativeModules;
@@ -23,225 +22,331 @@ export const FlyyCheckinView = props => {
23
22
  };
24
23
  const windowHeight = Dimensions.get('window').height;
25
24
  const windowWidth = Dimensions.get('window').width; // ****** Flyy Floating Widget ******
25
+ // export const FlyyFloatingWidget = ({
26
+ // props = {
27
+ // backgroundColor: "#654EA3",
28
+ // buttonHeight: 55,
29
+ // buttonWidth: 55,
30
+ // buttonCornerRadius: 40,
31
+ // buttonIcon: require('./assets/images/rewardwidget.png'),
32
+ // onPress: () => { },
33
+ // x: windowWidth - 75,
34
+ // y: windowHeight - 100,
35
+ // minX: 5,
36
+ // minY: 5,
37
+ // maxX: windowWidth - 5,
38
+ // maxY: windowHeight - 5,
39
+ // show: true,
40
+ // stick: false,
41
+ // startDate: 0,
42
+ // endDate: 0
43
+ // } }) => {
44
+ // const [showWidget,setShowWidget] = useState(false);
45
+ // const [userData,setUserData] = useState({});
46
+ // const [iconUrl,setIconUrl] = useState(require('./assets/images/rewardwidget.png'));
47
+ // const [backgroundColor,setBackgroundColor] = useState("#654EA3");
48
+ // const [buttonSize,setButtonSize] = useState(55);
49
+ // const [buttonXPosition,setButtonXPosition] = useState(windowWidth - 75);
50
+ // const [buttonYPosition,setButtonYPosition] = useState(windowHeight - 100);
51
+ // const [deeplink,setDeeplink] = useState(null);
52
+ // const flyyConfigDate = "flyy_config_date";
53
+ // const flyyConfigUserId = "user_id";
54
+ // var oldState = null;
55
+ // var currentState = null;
56
+ // var data = null;
57
+ // useEffect(()=>{
58
+ // fetchData();
59
+ // },[]);
60
+ // const fetchData = async() => {
61
+ // const sdkInfo = await Flyy.getUserData();
62
+ // const appData = await Flyy.getAppData();
63
+ // const resp = await fetch(`https://${sdkInfo["environment"] == 0 ? "ghc-stage" : "ghc"}.theflyy.com/api/v8/flyy_app_info`, {
64
+ // headers: {
65
+ // "X-Key": sdkInfo["partner_id"],
66
+ // "Content-Type": "application/json",
67
+ // "X-App-Data": appData
68
+ // }
69
+ // });
70
+ // data = await resp.json();
71
+ // if(!data.success){
72
+ // if (Platform.OS === 'android') {
73
+ // ToastAndroid.show(data.message, ToastAndroid.SHORT);
74
+ // } else {
75
+ // // Toast.showWithGravity(data.message, Toast.SHORT, Toast.BOTTOM);
76
+ // }
77
+ // return;
78
+ // }
79
+ // const widgetConfig = data.info.floating_widget_configuration;
80
+ // if (widgetConfig.icon_url != null && widgetConfig.icon_url != '') {
81
+ // setIconUrl({ uri: widgetConfig.icon_url })
82
+ // } else {
83
+ // setIconUrl(props.buttonIcon)
84
+ // }
85
+ // if (widgetConfig.color != null && widgetConfig.color != '') {
86
+ // setBackgroundColor(widgetConfig.color)
87
+ // } else {
88
+ // setBackgroundColor(props.backgroundColor)
89
+ // }
90
+ // if (widgetConfig.size != null && widgetConfig.color != 0) {
91
+ // setButtonSize(parseInt(data.info.floating_widget_configuration.size))
92
+ // } else {
93
+ // setButtonSize(props.buttonHeight)
94
+ // }
95
+ // //FloatingButton Position
96
+ // if (widgetConfig.position == "bottom_left") {
97
+ // setButtonXPosition(10)
98
+ // } else if (widgetConfig.position == "bottom_right") {
99
+ // setButtonXPosition(windowWidth - 75)
100
+ // } else if (widgetConfig.position == "upper_left") {
101
+ // setButtonXPosition(10)
102
+ // if (Platform.OS === 'android'){
103
+ // setButtonYPosition(10)
104
+ // }else{
105
+ // setButtonYPosition(50)
106
+ // }
107
+ // } else if (widgetConfig.position == "upper_right") {
108
+ // setButtonXPosition(windowWidth - 75)
109
+ // if (Platform.OS === 'android'){
110
+ // setButtonYPosition(10)
111
+ // }else{
112
+ // setButtonYPosition(50)
113
+ // }
114
+ // }
115
+ // //Set DeepLink
116
+ // if (widgetConfig.deeplink != null && widgetConfig.deeplink != "") {
117
+ // setDeeplink(widgetConfig.deeplink)
118
+ // }
119
+ // //Set Visibility of FloatingButton
120
+ // var currentDate = new Date();
121
+ // const getDate = await AsyncStorage.getItem(flyyConfigDate);
122
+ // const userId = await AsyncStorage.getItem(flyyConfigUserId);
123
+ // var date = new Date(parseInt(getDate));
124
+ // const diffTime = Math.abs(getDate - currentDate);
125
+ // const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24))-1;
126
+ // if(diffDays != 0 || userId == null || userId != sdkInfo[flyyConfigUserId]){
127
+ // var data = await Flyy.getAppOccurence(1);
128
+ // await AsyncStorage.setItem(
129
+ // flyyConfigUserId,
130
+ // sdkInfo[flyyConfigUserId]
131
+ // );
132
+ // }
133
+ // const occurrenceCount = await Flyy.getAppOccurence(0);
134
+ // if (widgetConfig.show_to_user && occurrenceCount <= parseInt(widgetConfig.num_times)) {
135
+ // // var numberOfDaysToAdd = widgetConfig.num_days+1;
136
+ // // var result = currentDate.setDate(currentDate.getDate() + numberOfDaysToAdd);
137
+ // if(getDate === null || userId == null || userId != sdkInfo[flyyConfigUserId]){
138
+ // await AsyncStorage.setItem(
139
+ // flyyConfigDate,
140
+ // JSON.stringify(currentDate.getTime())
141
+ // );
142
+ // }
143
+ // const getDate2 = await AsyncStorage.getItem(flyyConfigDate);
144
+ // var date = new Date(parseInt(getDate2));
145
+ // const diffTime = Math.abs(getDate2 - currentDate);
146
+ // const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24))-1;
147
+ // //Show widget on same day
148
+ // if(diffDays === 0 || diffDays === -1){
149
+ // setShowWidget(true)
150
+ // }else{
151
+ // //reset occurrence on next day
152
+ // await Flyy.getAppOccurence(1);
153
+ // if(diffDays >= parseInt(widgetConfig.num_days)+1){
154
+ // await AsyncStorage.setItem(
155
+ // flyyConfigDate,
156
+ // JSON.stringify(currentDate.getTime())
157
+ // );
158
+ // setShowWidget(true)
159
+ // }
160
+ // }
161
+ // }else{
162
+ // setShowWidget(false);
163
+ // const getDate2 = await AsyncStorage.getItem(flyyConfigDate);
164
+ // var date = new Date(parseInt(getDate2));
165
+ // const diffTime = Math.abs(getDate2 - currentDate);
166
+ // const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
167
+ // if(diffDays != 1){
168
+ // var data = await Flyy.getAppOccurence(1);
169
+ // }
170
+ // }
171
+ // }
172
+ // // if(props.show){
173
+ // // if(props.startDate != null && props.startDate != 0){
174
+ // // var now = new Date().getTime();
175
+ // // if(now >= props.startDate && now <= props.endDate){
176
+ // // props.show = true
177
+ // // }else{
178
+ // // props.show = false
179
+ // // }
180
+ // // }
181
+ // // }
182
+ // // AppState.addEventListener('change', state =>{
183
+ // // console.log('AppState updated to', AppState.currentState)
184
+ // // oldState = currentState;
185
+ // // currentState = state;
186
+ // // if(oldState == null){
187
+ // // console.log('App is newly start :::')
188
+ // // }})
189
+ // return (
190
+ // // @ts-ignore
191
+ // props.show && showWidget? <Draggable x={buttonXPosition}
192
+ // y={buttonYPosition}
193
+ // minX={props.minX ?? 5}
194
+ // minY={props.minY ?? 5}
195
+ // maxX={props.maxX ?? windowWidth - 5}
196
+ // maxY={props.maxY ?? windowHeight - 5}
197
+ // renderSize={56}
198
+ // // shouldReverse = {true}
199
+ // onDragRelease={props.stick ? () => {
200
+ // } : null} isCircle>
201
+ // <TouchableOpacity
202
+ // onPress={deeplink != null ? async()=>{
203
+ // if (Platform.OS === 'android' || !deeplink.startsWith("flyy://")) {
204
+ // const supported = await Linking.canOpenURL(deeplink);
205
+ // await Linking.openURL(deeplink);
206
+ // } else {
207
+ // navigateTo(deeplink);
208
+ // }
209
+ // }:props.onPress}
210
+ // style={{
211
+ // height: buttonSize,
212
+ // width: buttonSize,
213
+ // backgroundColor: backgroundColor,
214
+ // borderRadius: buttonSize/2,
215
+ // justifyContent: 'center',
216
+ // alignItems: 'center',
217
+ // }}>
218
+ // <Image source={iconUrl} style={{ height: buttonSize*55/100, width: buttonSize*55/100 }} />
219
+ // <TouchableOpacity
220
+ // onPress={()=>{
221
+ // props.show = false;
222
+ // setShowWidget(false);
223
+ // }}
224
+ // style = {{height: 20, width: 20, backgroundColor: "transparent",position:'absolute',left:buttonSize-11, bottom: buttonSize*72/100}}>
225
+ // <Image source={require('./assets/images/xmark.png')} style={{ height: 18, width: 18, tintColor: "black"}} />
226
+ // </TouchableOpacity>
227
+ // </TouchableOpacity>
228
+ // </Draggable> : <View/>
229
+ // );
230
+ // }
26
231
 
27
- export const FlyyFloatingWidget = ({
28
- props = {
29
- backgroundColor: "#654EA3",
30
- buttonHeight: 55,
31
- buttonWidth: 55,
32
- buttonCornerRadius: 40,
33
- buttonIcon: require('./assets/images/rewardwidget.png'),
34
- onPress: () => {},
35
- x: windowWidth - 75,
36
- y: windowHeight - 100,
37
- minX: 5,
38
- minY: 5,
39
- maxX: windowWidth - 5,
40
- maxY: windowHeight - 5,
41
- show: true,
42
- stick: false,
43
- startDate: 0,
44
- endDate: 0
45
- }
46
- }) => {
47
- var _props$minX, _props$minY, _props$maxX, _props$maxY;
48
-
49
- const [showWidget, setShowWidget] = useState(false);
50
- const [userData, setUserData] = useState({});
51
- const [iconUrl, setIconUrl] = useState(require('./assets/images/rewardwidget.png'));
52
- const [backgroundColor, setBackgroundColor] = useState("#654EA3");
53
- const [buttonSize, setButtonSize] = useState(55);
54
- const [buttonXPosition, setButtonXPosition] = useState(windowWidth - 75);
55
- const [buttonYPosition, setButtonYPosition] = useState(windowHeight - 100);
56
- const [deeplink, setDeeplink] = useState(null);
57
- const flyyConfigDate = "flyy_config_date";
58
- const flyyConfigUserId = "user_id";
59
- var oldState = null;
60
- var currentState = null;
61
- var data = null;
62
- useEffect(() => {
63
- fetchData();
64
- }, []);
232
+ const navigateTo = deeplink => {
233
+ let components = deeplink.split("/");
234
+ let screenCode = components[components.length - 1];
65
235
 
66
- const fetchData = async () => {
67
- const sdkInfo = await Flyy.getUserData();
68
- const appData = await Flyy.getAppData();
69
- const resp = await fetch(`https://${sdkInfo["environment"] == 0 ? "ghc-stage" : "ghc"}.theflyy.com/api/v8/flyy_app_info`, {
70
- headers: {
71
- "X-Key": sdkInfo["partner_id"],
72
- "Content-Type": "application/json",
73
- "X-App-Data": appData
236
+ switch (screenCode) {
237
+ case "flyy_offers":
238
+ {
239
+ Flyy.openOffersScreen();
74
240
  }
75
- });
76
- data = await resp.json();
241
+ break;
77
242
 
78
- if (!data.success) {
79
- ToastAndroid.show(data.message, ToastAndroid.SHORT);
80
- return;
81
- }
243
+ case "challenge_details":
244
+ {
245
+ Flyy.openFlyyChallengeDetailPage(0);
246
+ }
247
+ break;
82
248
 
83
- const widgetConfig = data.info.floating_widget_configuration;
249
+ case "flyy_quiz_list":
250
+ {
251
+ Flyy.openFlyyQuizListPage();
252
+ }
253
+ break;
84
254
 
85
- if (widgetConfig.icon_url != null && widgetConfig.icon_url != '') {
86
- setIconUrl({
87
- uri: widgetConfig.icon_url
88
- });
89
- } else {
90
- setIconUrl(props.buttonIcon);
91
- }
255
+ case "stamp_campaign_new":
256
+ {
257
+ Flyy.openFlyyStampsPage();
258
+ }
259
+ break;
92
260
 
93
- if (widgetConfig.color != null && widgetConfig.color != '') {
94
- setBackgroundColor(widgetConfig.color);
95
- } else {
96
- setBackgroundColor(props.backgroundColor);
97
- }
261
+ case "campaign_home":
262
+ {
263
+ Flyy.openFlyyStampsPage();
264
+ }
265
+ break;
98
266
 
99
- if (widgetConfig.size != null && widgetConfig.color != 0) {
100
- setButtonSize(parseInt(data.info.floating_widget_configuration.size));
101
- } else {
102
- setButtonSize(props.buttonHeight);
103
- } //FloatingButton Position
104
-
105
-
106
- if (widgetConfig.position == "bottom_left") {
107
- setButtonXPosition(10);
108
- } else if (widgetConfig.position == "bottom_right") {
109
- setButtonXPosition(windowWidth - 75);
110
- } else if (widgetConfig.position == "upper_left") {
111
- setButtonXPosition(10);
112
- setButtonYPosition(10);
113
- } else if (widgetConfig.position == "upper_right") {
114
- setButtonXPosition(windowWidth - 75);
115
- setButtonYPosition(10);
116
- } //Set DeepLink
117
-
118
-
119
- if (widgetConfig.deeplink != null && widgetConfig.deeplink != "") {
120
- setDeeplink(widgetConfig.deeplink);
121
- } //Set Visibility of FloatingButton
122
-
123
-
124
- var currentDate = new Date();
125
- const getDate = await AsyncStorage.getItem(flyyConfigDate);
126
- const userId = await AsyncStorage.getItem(flyyConfigUserId);
127
- var date = new Date(parseInt(getDate));
128
- const diffTime = Math.abs(getDate - currentDate);
129
- const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24)) - 1;
130
-
131
- if (diffDays != 0 || userId == null || userId != sdkInfo[flyyConfigUserId]) {
132
- var data = await Flyy.getAppOccurence(1);
133
- await AsyncStorage.setItem(flyyConfigUserId, sdkInfo[flyyConfigUserId]);
134
- }
267
+ case "bonanza_details":
268
+ {
269
+ Flyy.openFlyyBonanzaPage();
270
+ }
271
+ break;
135
272
 
136
- const occurrenceCount = await Flyy.getAppOccurence(0);
273
+ case "invite_earn":
274
+ {
275
+ Flyy.openFlyyInviteAndEarnPage(0);
276
+ }
277
+ break;
137
278
 
138
- if (widgetConfig.show_to_user && occurrenceCount <= parseInt(widgetConfig.num_times)) {
139
- // var numberOfDaysToAdd = widgetConfig.num_days+1;
140
- // var result = currentDate.setDate(currentDate.getDate() + numberOfDaysToAdd);
141
- if (getDate === null || userId == null || userId != sdkInfo[flyyConfigUserId]) {
142
- await AsyncStorage.setItem(flyyConfigDate, JSON.stringify(currentDate.getTime()));
279
+ case "invite_details":
280
+ {
281
+ Flyy.openFlyyInviteDetailsPage(0);
143
282
  }
283
+ break;
144
284
 
145
- const getDate2 = await AsyncStorage.getItem(flyyConfigDate);
146
- var date = new Date(parseInt(getDate2));
147
- const diffTime = Math.abs(getDate2 - currentDate);
148
- const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24)) - 1; //Show widget on same day
285
+ case "custom_invite_details":
286
+ {
287
+ Flyy.openFlyyCustomInviteAndEarnPage(0, FlyyFlutterPlugin.themeColor);
288
+ }
289
+ break;
149
290
 
150
- if (diffDays === 0 || diffDays === -1) {
151
- setShowWidget(true);
152
- } else {
153
- //reset occurrence on next day
154
- await Flyy.getAppOccurence(1);
291
+ case "raffle_details":
292
+ {
293
+ Flyy.openFlyyRafflePage(0);
294
+ }
295
+ break;
155
296
 
156
- if (diffDays >= parseInt(widgetConfig.num_days) + 1) {
157
- await AsyncStorage.setItem(flyyConfigDate, JSON.stringify(currentDate.getTime()));
158
- setShowWidget(true);
159
- }
297
+ case "quiz_history":
298
+ {
299
+ Flyy.openFlyyQuizHistoryPage();
160
300
  }
161
- } else {
162
- setShowWidget(false);
163
- const getDate2 = await AsyncStorage.getItem(flyyConfigDate);
164
- var date = new Date(parseInt(getDate2));
165
- const diffTime = Math.abs(getDate2 - currentDate);
166
- const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
167
-
168
- if (diffDays != 1) {
169
- var data = await Flyy.getAppOccurence(1);
301
+ break;
302
+
303
+ case "flyy_rewards":
304
+ {
305
+ Flyy.openRewardsScreen();
170
306
  }
171
- }
172
- }; // if(props.show){
173
- // if(props.startDate != null && props.startDate != 0){
174
- // var now = new Date().getTime();
175
- // if(now >= props.startDate && now <= props.endDate){
176
- // props.show = true
177
- // }else{
178
- // props.show = false
179
- // }
180
- // }
181
- // }
182
- // AppState.addEventListener('change', state =>{
183
- // console.log('AppState updated to', AppState.currentState)
184
- // oldState = currentState;
185
- // currentState = state;
186
- // if(oldState == null){
187
- // console.log('App is newly start :::')
188
- // }})
189
-
190
-
191
- return (// @ts-ignore
192
- props.show && showWidget ? /*#__PURE__*/React.createElement(Draggable, {
193
- x: buttonXPosition,
194
- y: buttonYPosition,
195
- minX: (_props$minX = props.minX) !== null && _props$minX !== void 0 ? _props$minX : 5,
196
- minY: (_props$minY = props.minY) !== null && _props$minY !== void 0 ? _props$minY : 5,
197
- maxX: (_props$maxX = props.maxX) !== null && _props$maxX !== void 0 ? _props$maxX : windowWidth - 5,
198
- maxY: (_props$maxY = props.maxY) !== null && _props$maxY !== void 0 ? _props$maxY : windowHeight - 5,
199
- renderSize: 56 // shouldReverse = {true}
200
- ,
201
- onDragRelease: props.stick ? () => {} : null,
202
- isCircle: true
203
- }, /*#__PURE__*/React.createElement(TouchableOpacity, {
204
- onPress: deeplink != null ? async () => {
205
- const supported = await Linking.canOpenURL(deeplink);
206
- await Linking.openURL(deeplink);
207
- } : props.onPress,
208
- style: {
209
- height: buttonSize,
210
- width: buttonSize,
211
- backgroundColor: backgroundColor,
212
- borderRadius: buttonSize / 2,
213
- justifyContent: 'center',
214
- alignItems: 'center'
307
+ break;
308
+
309
+ case "flyy_referrals":
310
+ {
311
+ Flyy.openReferralHistory();
215
312
  }
216
- }, /*#__PURE__*/React.createElement(Image, {
217
- source: iconUrl,
218
- style: {
219
- height: buttonSize * 55 / 100,
220
- width: buttonSize * 55 / 100
313
+ break;
314
+
315
+ case "flyy_gift_cards":
316
+ {
317
+ Flyy.openGiftCardScreen();
221
318
  }
222
- }), /*#__PURE__*/React.createElement(TouchableOpacity, {
223
- onPress: () => {
224
- props.show = false;
225
- setShowWidget(false);
226
- },
227
- style: {
228
- height: 20,
229
- width: 20,
230
- backgroundColor: "transparent",
231
- position: 'absolute',
232
- left: buttonSize - 11,
233
- bottom: buttonSize * 72 / 100
319
+ break;
320
+
321
+ case "flyy_wallet":
322
+ {
323
+ Flyy.openWalletScreen();
234
324
  }
235
- }, /*#__PURE__*/React.createElement(Image, {
236
- source: require('./assets/images/xmark.png'),
237
- style: {
238
- height: 18,
239
- width: 18,
240
- tintColor: "black"
325
+ break;
326
+
327
+ case "game_list":
328
+ {
329
+ Flyy.openFlyyGamesPage();
330
+ }
331
+ break;
332
+
333
+ case "flyy_bonanza":
334
+ {
335
+ Flyy.openFlyyBonanzaPage();
241
336
  }
242
- })))) : /*#__PURE__*/React.createElement(View, null)
243
- );
337
+ break;
338
+
339
+ case "flyy_quiz_detail":
340
+ {
341
+ Flyy.openFlyyQuizPage(0);
342
+ }
343
+ break;
344
+
345
+ default: // Toast.showWithGravity("ACTION NOT FOUND", Toast.SHORT, Toast.BOTTOM);
346
+
347
+ }
244
348
  };
349
+
245
350
  export const FlyyWidget = ({
246
351
  widgetStyle = {
247
352
  rewardsButtonIcon: require('./assets/images/rewardwidget.png'),
@@ -376,5 +481,239 @@ const FlyyCardView = ({
376
481
  height: 10
377
482
  }
378
483
  }));
484
+ }; // ****** Flyy Stories Widget ******
485
+
486
+
487
+ export const FlyyStories = ({
488
+ widgetStyle = {
489
+ titleColor: 'black',
490
+ iconButtonBgColor: '#654EA3',
491
+ fontSize: 16.0,
492
+ iconCornerRadius: 55,
493
+ iconSize: 60,
494
+ iconBgSize: 100
495
+ }
496
+ }) => {
497
+ const [data, setData] = useState(null);
498
+ useEffect(() => {
499
+ fetchStoriesData();
500
+ }, []);
501
+
502
+ const fetchStoriesData = async () => {
503
+ const sdkInfo = await Flyy.getUserData();
504
+ const appData = await Flyy.getAppData();
505
+ const resp = await fetch(`https://${sdkInfo["environment"] == 0 ? "ghc-stage" : "ghc"}.theflyy.com/api/storyboard`, {
506
+ headers: {
507
+ "X-Key": sdkInfo["partner_id"],
508
+ "Content-Type": "application/json",
509
+ "X-App-Data": appData
510
+ }
511
+ });
512
+ const responseData = await resp.json();
513
+ setData(responseData.storyboard_items);
514
+ };
515
+
516
+ const navigateTo = screenCode => {
517
+ switch (screenCode) {
518
+ case "offers":
519
+ {
520
+ Flyy.openOffersScreen();
521
+ }
522
+ break;
523
+
524
+ case "spin_wheel":
525
+ {
526
+ Flyy.openFlyySpinTheWheelPage(0);
527
+ }
528
+ break;
529
+
530
+ case "challenge":
531
+ {
532
+ Flyy.openFlyyChallengeDetailPage(0);
533
+ }
534
+ break;
535
+
536
+ case "quiz_list":
537
+ {
538
+ Flyy.openFlyyQuizListPage();
539
+ }
540
+ break;
541
+
542
+ case "stamp_campaign":
543
+ {
544
+ Flyy.openFlyyStampsPage();
545
+ }
546
+ break;
547
+
548
+ case "campaign_home":
549
+ {
550
+ Flyy.openFlyyStampsPage();
551
+ }
552
+ break;
553
+
554
+ case "bonanza_details":
555
+ {
556
+ Flyy.openFlyyBonanzaPage();
557
+ }
558
+ break;
559
+
560
+ case "invite_earn":
561
+ {
562
+ Flyy.openFlyyInviteAndEarnPage(0);
563
+ }
564
+ break;
565
+
566
+ case "invite_details":
567
+ {
568
+ Flyy.openFlyyInviteDetailsPage(0);
569
+ }
570
+ break;
571
+
572
+ case "custom_invite_details":
573
+ {
574
+ Flyy.openFlyyCustomInviteAndEarnPage(0, FlyyFlutterPlugin.themeColor);
575
+ }
576
+ break;
577
+
578
+ case "raffle":
579
+ {
580
+ Flyy.openFlyyRafflePage(0);
581
+ }
582
+ break;
583
+
584
+ case "quiz_history":
585
+ {
586
+ Flyy.openFlyyQuizHistoryPage();
587
+ }
588
+ break;
589
+
590
+ case "flyy_rewards":
591
+ {
592
+ Flyy.openRewardsScreen();
593
+ }
594
+ break;
595
+
596
+ case "referrals":
597
+ {
598
+ Flyy.openReferralHistory();
599
+ }
600
+ break;
601
+
602
+ case "flyy_gift_cards":
603
+ {
604
+ Flyy.openGiftCardScreen();
605
+ }
606
+ break;
607
+
608
+ case "wallet":
609
+ {
610
+ Flyy.openWalletScreen();
611
+ }
612
+ break;
613
+
614
+ case "game_list":
615
+ {
616
+ Flyy.openFlyyGamesPage();
617
+ }
618
+ break;
619
+
620
+ case "bonanza":
621
+ {
622
+ Flyy.openFlyyBonanzaPage();
623
+ }
624
+ break;
625
+
626
+ case "quiz_detail":
627
+ {
628
+ Flyy.openFlyyQuizPage(0);
629
+ }
630
+ break;
631
+
632
+ default: // Toast.showWithGravity("ACTION NOT FOUND", Toast.SHORT, Toast.BOTTOM);
633
+
634
+ }
635
+ };
636
+
637
+ const StoriesItem = ({
638
+ data
639
+ }) => {
640
+ var _widgetStyle$iconButt, _widgetStyle$iconBgSi, _widgetStyle$iconBgSi2, _widgetStyle$iconCorn, _widgetStyle$titleCol, _widgetStyle$fontSize;
641
+
642
+ return /*#__PURE__*/React.createElement(View, {
643
+ style: {
644
+ alignItems: 'center'
645
+ }
646
+ }, /*#__PURE__*/React.createElement(View, {
647
+ style: {
648
+ height: 10
649
+ }
650
+ }), /*#__PURE__*/React.createElement(TouchableOpacity, {
651
+ onPress: () => {
652
+ navigateTo(data.screen_code);
653
+ },
654
+ style: {
655
+ backgroundColor: (_widgetStyle$iconButt = widgetStyle.iconButtonBgColor) !== null && _widgetStyle$iconButt !== void 0 ? _widgetStyle$iconButt : '#654EA3',
656
+ height: (_widgetStyle$iconBgSi = widgetStyle.iconBgSize) !== null && _widgetStyle$iconBgSi !== void 0 ? _widgetStyle$iconBgSi : 60,
657
+ width: (_widgetStyle$iconBgSi2 = widgetStyle.iconBgSize) !== null && _widgetStyle$iconBgSi2 !== void 0 ? _widgetStyle$iconBgSi2 : 60,
658
+ borderRadius: (_widgetStyle$iconCorn = widgetStyle.iconCornerRadius) !== null && _widgetStyle$iconCorn !== void 0 ? _widgetStyle$iconCorn : 55,
659
+ alignSelf: 'center',
660
+ justifyContent: 'center',
661
+ alignItems: 'center',
662
+ marginHorizontal: 10
663
+ }
664
+ }, /*#__PURE__*/React.createElement(Image, {
665
+ source: {
666
+ uri: data.icon_url
667
+ },
668
+ style: {
669
+ height: 60,
670
+ width: 60
671
+ }
672
+ })), /*#__PURE__*/React.createElement(View, {
673
+ style: {
674
+ height: 10
675
+ }
676
+ }), /*#__PURE__*/React.createElement(View, {
677
+ style: {
678
+ width: 120
679
+ }
680
+ }, /*#__PURE__*/React.createElement(Text, {
681
+ style: {
682
+ alignSelf: 'center',
683
+ flexShrink: 1,
684
+ color: (_widgetStyle$titleCol = widgetStyle.titleColor) !== null && _widgetStyle$titleCol !== void 0 ? _widgetStyle$titleCol : 'black',
685
+ fontSize: (_widgetStyle$fontSize = widgetStyle.fontSize) !== null && _widgetStyle$fontSize !== void 0 ? _widgetStyle$fontSize : 14,
686
+ fontFamily: 'Montserrat-Bold',
687
+ textAlign: 'center',
688
+ paddingLeft: 5,
689
+ paddingRight: 5
690
+ },
691
+ numberOfLines: 2
692
+ }, data.title)), /*#__PURE__*/React.createElement(View, {
693
+ style: {
694
+ height: 10
695
+ }
696
+ }));
697
+ };
698
+
699
+ return /*#__PURE__*/React.createElement(View, {
700
+ style: {
701
+ flexDirection: "row",
702
+ justifyContent: "center",
703
+ width: "100%",
704
+ alignItems: 'center',
705
+ alignContent: 'center',
706
+ backgroundColor: "white"
707
+ }
708
+ }, /*#__PURE__*/React.createElement(FlatList, {
709
+ horizontal: true,
710
+ data: data,
711
+ renderItem: ({
712
+ item
713
+ }) => /*#__PURE__*/React.createElement(StoriesItem, {
714
+ data: item
715
+ }),
716
+ keyExtractor: item => item.id
717
+ }));
379
718
  };
380
719
  //# sourceMappingURL=index.js.map