react-native-flyy 1.4.23 → 1.4.25
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/android/.project +2 -2
- package/android/.settings/org.eclipse.buildship.core.prefs +4 -1
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/reactnativeflyy/FlyyModule.kt +72 -73
- package/android/src/main/java/com/reactnativeflyy/FlyyRouteActivity.java +4 -0
- package/ios/Montserrat-Bold.ttf +0 -0
- package/ios/ReactNativeFlyy.m +220 -117
- package/lib/commonjs/assets/images/check.png +0 -0
- package/lib/commonjs/assets/images/medal.png +0 -0
- package/lib/commonjs/assets/images/radio.png +0 -0
- package/lib/commonjs/assets/images/reward_flyy.png +0 -0
- package/lib/commonjs/assets/images/xmark.png +0 -0
- package/lib/commonjs/flyy_checkin_view.js +382 -0
- package/lib/commonjs/flyy_checkin_view.js.map +1 -0
- package/lib/commonjs/index.js +248 -3
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/assets/images/check.png +0 -0
- package/lib/module/assets/images/medal.png +0 -0
- package/lib/module/assets/images/radio.png +0 -0
- package/lib/module/assets/images/reward_flyy.png +0 -0
- package/lib/module/assets/images/xmark.png +0 -0
- package/lib/module/flyy_checkin_view.js +365 -0
- package/lib/module/flyy_checkin_view.js.map +1 -0
- package/lib/module/index.js +233 -3
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/flyy_checkin_view.d.ts +19 -0
- package/lib/typescript/index.d.ts +22 -0
- package/package.json +4 -1
- package/react-native-flyy.podspec +1 -1
- package/src/assets/images/check.png +0 -0
- package/src/assets/images/medal.png +0 -0
- package/src/assets/images/radio.png +0 -0
- package/src/assets/images/reward_flyy.png +0 -0
- package/src/assets/images/xmark.png +0 -0
- package/src/flyy_checkin_view.tsx +214 -0
- package/src/index.tsx +219 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _reactNative = require("react-native");
|
|
11
|
+
|
|
12
|
+
var _reactNativeFlyy = _interopRequireDefault(require("react-native-flyy"));
|
|
13
|
+
|
|
14
|
+
var _reactNativeSimpleToast = _interopRequireDefault(require("react-native-simple-toast"));
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
+
|
|
20
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
+
|
|
22
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
23
|
+
|
|
24
|
+
class FlyyCheckinComponent extends _react.Component {
|
|
25
|
+
constructor(...args) {
|
|
26
|
+
super(...args);
|
|
27
|
+
|
|
28
|
+
_defineProperty(this, "state", {
|
|
29
|
+
mileStoneData: [],
|
|
30
|
+
checkinOffer: [],
|
|
31
|
+
listItems: [],
|
|
32
|
+
persons: [1, 2, 3, 4, 5],
|
|
33
|
+
partnerId: "",
|
|
34
|
+
userId: "",
|
|
35
|
+
appData: "",
|
|
36
|
+
environment: 0
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
async componentDidMount() {
|
|
41
|
+
try {
|
|
42
|
+
const data = await _reactNativeFlyy.default.getUserData();
|
|
43
|
+
const appData = await _reactNativeFlyy.default.getAppData();
|
|
44
|
+
this.setState({
|
|
45
|
+
partnerId: data["partner_id"],
|
|
46
|
+
userId: data["user_id"],
|
|
47
|
+
environment: data["environment"],
|
|
48
|
+
appData: appData
|
|
49
|
+
});
|
|
50
|
+
} catch (e) {
|
|
51
|
+
console.error(e);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
await this.fetchData();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async fetchData() {
|
|
58
|
+
this.setState({
|
|
59
|
+
listItems: []
|
|
60
|
+
});
|
|
61
|
+
const resp = await fetch(`https://${this.state.environment == 0 ? "ghc-stage" : "ghc"}.theflyy.com/api/v7/flyy_app_info`, {
|
|
62
|
+
headers: {
|
|
63
|
+
"X-Key": this.state.partnerId,
|
|
64
|
+
"Content-Type": "application/json",
|
|
65
|
+
"X-App-Data": this.state.appData
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
const data = await resp.json();
|
|
69
|
+
|
|
70
|
+
for (var key in data.info.offers) {
|
|
71
|
+
if (data.info.offers[key].offer_type_code === "checkin") {
|
|
72
|
+
this.setState({
|
|
73
|
+
checkinOffer: data.info.offers[key]
|
|
74
|
+
});
|
|
75
|
+
this.setState({
|
|
76
|
+
mileStoneData: data.info.offers[key].milestones
|
|
77
|
+
});
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
var tempData = [];
|
|
83
|
+
var isRewardDay = false;
|
|
84
|
+
var isCheckedIn = false;
|
|
85
|
+
|
|
86
|
+
for (let i = 0; i < this.state.checkinOffer.total_streak; i++) {
|
|
87
|
+
for (let j = 0; j < this.state.mileStoneData.length; j++) {
|
|
88
|
+
if (i + 1 === parseInt(this.state.mileStoneData[j].value)) {
|
|
89
|
+
isRewardDay = true;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (i + 1 <= this.state.checkinOffer.streak) {
|
|
94
|
+
isCheckedIn = true;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
tempData.push({
|
|
98
|
+
"isRewardDay": isRewardDay,
|
|
99
|
+
"isCheckedIn": isCheckedIn
|
|
100
|
+
});
|
|
101
|
+
isRewardDay = false;
|
|
102
|
+
isCheckedIn = false;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
this.setState({
|
|
106
|
+
listItems: tempData
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
async checkInApi() {
|
|
111
|
+
var url = `https://${this.state.environment == 0 ? "ghc-stage" : "ghc"}.theflyy.com/api/v1/checkin?offer_id=` + this.state.checkinOffer.id.toString();
|
|
112
|
+
const resp = await fetch(url, {
|
|
113
|
+
headers: {
|
|
114
|
+
"X-Key": this.state.partnerId,
|
|
115
|
+
"Content-Type": "application/json",
|
|
116
|
+
"X-App-Data": this.state.appData
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
const data = await resp.json();
|
|
120
|
+
|
|
121
|
+
if (data.success) {
|
|
122
|
+
this.fetchData();
|
|
123
|
+
} else {
|
|
124
|
+
this.notifyMessage(data.message);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
notifyMessage(msg) {
|
|
129
|
+
if (_reactNative.Platform.OS === 'android') {
|
|
130
|
+
_reactNative.ToastAndroid.show(msg, _reactNative.ToastAndroid.SHORT);
|
|
131
|
+
} else {
|
|
132
|
+
_reactNativeSimpleToast.default.showWithGravity(msg, _reactNativeSimpleToast.default.SHORT, _reactNativeSimpleToast.default.BOTTOM);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
render() {
|
|
137
|
+
var _this$props$style$che3, _this$props$style3, _this$props$style$fon, _this$props$style4, _this$state$checkinOf, _this$props$style$che4, _this$props$style5, _this$props$style$fon2, _this$props$style6, _this$props$style$che5, _this$props$style7;
|
|
138
|
+
|
|
139
|
+
const Divider = ({
|
|
140
|
+
color = "black",
|
|
141
|
+
index
|
|
142
|
+
}) => {
|
|
143
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
144
|
+
style: {
|
|
145
|
+
flexDirection: 'row'
|
|
146
|
+
}
|
|
147
|
+
}, _react.default.Children.toArray(this.state.persons.map(() => {
|
|
148
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
149
|
+
style: {
|
|
150
|
+
flexDirection: 'row'
|
|
151
|
+
}
|
|
152
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
153
|
+
style: {
|
|
154
|
+
height: 1,
|
|
155
|
+
width: 2,
|
|
156
|
+
backgroundColor: color,
|
|
157
|
+
borderRadius: 2
|
|
158
|
+
}
|
|
159
|
+
}), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
160
|
+
style: {
|
|
161
|
+
width: 1,
|
|
162
|
+
backgroundColor: "white",
|
|
163
|
+
borderRadius: 2
|
|
164
|
+
}
|
|
165
|
+
}));
|
|
166
|
+
})));
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
const getItemCount = () => this.state.listItems.length;
|
|
170
|
+
|
|
171
|
+
const getItem = (data, index) => ({
|
|
172
|
+
id: Math.random().toString(12).substring(0),
|
|
173
|
+
isRewardDay: data[index].isRewardDay,
|
|
174
|
+
isCheckedIn: data[index].isCheckedIn,
|
|
175
|
+
index: index
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
const Item = ({
|
|
179
|
+
title,
|
|
180
|
+
index
|
|
181
|
+
}) => {
|
|
182
|
+
var _this$props$style$che, _this$props$style, _this$props$style$che2, _this$props$style2;
|
|
183
|
+
|
|
184
|
+
const day = index + 1;
|
|
185
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
186
|
+
style: {
|
|
187
|
+
justifyContent: "center",
|
|
188
|
+
alignItems: 'center',
|
|
189
|
+
alignContent: 'center'
|
|
190
|
+
}
|
|
191
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
192
|
+
style: {
|
|
193
|
+
flexDirection: 'row',
|
|
194
|
+
height: 35,
|
|
195
|
+
justifyContent: 'center',
|
|
196
|
+
alignItems: 'center'
|
|
197
|
+
}
|
|
198
|
+
}, title.isCheckedIn ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
199
|
+
style: {
|
|
200
|
+
height: 1,
|
|
201
|
+
width: 15,
|
|
202
|
+
alignSelf: "center",
|
|
203
|
+
backgroundColor: index == 0 ? "white" : "black"
|
|
204
|
+
}
|
|
205
|
+
}) : /*#__PURE__*/_react.default.createElement(Divider, {
|
|
206
|
+
color: index == 0 ? "white" : "black",
|
|
207
|
+
index: index
|
|
208
|
+
}), title.isRewardDay ? title.isCheckedIn ? /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
|
|
209
|
+
source: require('./assets/images/reward_flyy.png'),
|
|
210
|
+
style: {
|
|
211
|
+
height: 20,
|
|
212
|
+
width: 15
|
|
213
|
+
}
|
|
214
|
+
}) : /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
|
|
215
|
+
source: {
|
|
216
|
+
uri: this.state.checkinOffer["currency_icon_url"]
|
|
217
|
+
},
|
|
218
|
+
style: {
|
|
219
|
+
height: 20,
|
|
220
|
+
width: 20
|
|
221
|
+
}
|
|
222
|
+
}) : title.isCheckedIn ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
223
|
+
style: {
|
|
224
|
+
height: 17,
|
|
225
|
+
width: 17,
|
|
226
|
+
backgroundColor: "black",
|
|
227
|
+
borderRadius: 15,
|
|
228
|
+
justifyContent: 'center',
|
|
229
|
+
alignItems: 'center'
|
|
230
|
+
}
|
|
231
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
232
|
+
style: {
|
|
233
|
+
color: "white",
|
|
234
|
+
fontSize: 10
|
|
235
|
+
}
|
|
236
|
+
}, "\u2713")) : /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
|
|
237
|
+
source: require('./assets/images/radio.png'),
|
|
238
|
+
style: {
|
|
239
|
+
height: 20,
|
|
240
|
+
width: 20
|
|
241
|
+
}
|
|
242
|
+
}), index != this.state.listItems.length - 1 ? this.state.listItems[index + 1].isCheckedIn ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
243
|
+
style: {
|
|
244
|
+
height: 1,
|
|
245
|
+
width: 15,
|
|
246
|
+
alignSelf: "center",
|
|
247
|
+
backgroundColor: index == this.state.listItems.length - 1 ? "white" : "black"
|
|
248
|
+
}
|
|
249
|
+
}) : /*#__PURE__*/_react.default.createElement(Divider, {
|
|
250
|
+
color: index == this.state.listItems.length - 1 ? "white" : "black",
|
|
251
|
+
index: index
|
|
252
|
+
}) : /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
253
|
+
style: {
|
|
254
|
+
width: 15
|
|
255
|
+
}
|
|
256
|
+
})), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
257
|
+
style: {
|
|
258
|
+
textAlign: 'center',
|
|
259
|
+
color: title.isRewardDay ? (_this$props$style$che = (_this$props$style = this.props.style) === null || _this$props$style === void 0 ? void 0 : _this$props$style.checkInEarnColor) !== null && _this$props$style$che !== void 0 ? _this$props$style$che : "black" : (_this$props$style$che2 = (_this$props$style2 = this.props.style) === null || _this$props$style2 === void 0 ? void 0 : _this$props$style2.checkInDaysColor) !== null && _this$props$style$che2 !== void 0 ? _this$props$style$che2 : "black"
|
|
260
|
+
}
|
|
261
|
+
}, title.isRewardDay ? title.isCheckedIn ? "Won" : "Earn" : title.isCheckedIn ? "Day " + day : "Day " + day));
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
265
|
+
style: styles.main,
|
|
266
|
+
onPress: () => {
|
|
267
|
+
_reactNativeFlyy.default.openFlyyCheckinPage();
|
|
268
|
+
}
|
|
269
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
270
|
+
style: {
|
|
271
|
+
height: 10
|
|
272
|
+
}
|
|
273
|
+
}), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
274
|
+
style: {
|
|
275
|
+
fontSize: 20,
|
|
276
|
+
color: (_this$props$style$che3 = (_this$props$style3 = this.props.style) === null || _this$props$style3 === void 0 ? void 0 : _this$props$style3.checkInTitleColor) !== null && _this$props$style$che3 !== void 0 ? _this$props$style$che3 : "black",
|
|
277
|
+
fontFamily: (_this$props$style$fon = (_this$props$style4 = this.props.style) === null || _this$props$style4 === void 0 ? void 0 : _this$props$style4.fontFamily) !== null && _this$props$style$fon !== void 0 ? _this$props$style$fon : "Montserrat-Regular"
|
|
278
|
+
}
|
|
279
|
+
}, (_this$state$checkinOf = this.state.checkinOffer["offer_type_title"]) !== null && _this$state$checkinOf !== void 0 ? _this$state$checkinOf : "N/A"), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
280
|
+
style: {
|
|
281
|
+
height: 10
|
|
282
|
+
}
|
|
283
|
+
}), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
284
|
+
style: {
|
|
285
|
+
flexDirection: 'row',
|
|
286
|
+
width: 250,
|
|
287
|
+
justifyContent: 'center'
|
|
288
|
+
}
|
|
289
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
290
|
+
numberOfLines: 1,
|
|
291
|
+
style: {
|
|
292
|
+
fontSize: 18,
|
|
293
|
+
color: (_this$props$style$che4 = (_this$props$style5 = this.props.style) === null || _this$props$style5 === void 0 ? void 0 : _this$props$style5.checkInDescriptionColor) !== null && _this$props$style$che4 !== void 0 ? _this$props$style$che4 : "grey",
|
|
294
|
+
fontFamily: (_this$props$style$fon2 = (_this$props$style6 = this.props.style) === null || _this$props$style6 === void 0 ? void 0 : _this$props$style6.fontFamily) !== null && _this$props$style$fon2 !== void 0 ? _this$props$style$fon2 : "Montserrat-Regular",
|
|
295
|
+
textAlign: "center"
|
|
296
|
+
}
|
|
297
|
+
}, this.state.checkinOffer["description"] != null ? this.state.checkinOffer["description"].replace(/(<([^>]+)>)/ig, '') : "N/A")), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
298
|
+
style: {
|
|
299
|
+
height: 10
|
|
300
|
+
}
|
|
301
|
+
}), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
302
|
+
style: styles.listContainer
|
|
303
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, null, /*#__PURE__*/_react.default.createElement(_reactNative.VirtualizedList, {
|
|
304
|
+
data: this.state.listItems,
|
|
305
|
+
style: {
|
|
306
|
+
alignSelf: "center"
|
|
307
|
+
},
|
|
308
|
+
initialNumToRender: 4,
|
|
309
|
+
horizontal: true,
|
|
310
|
+
renderItem: ({
|
|
311
|
+
item,
|
|
312
|
+
index
|
|
313
|
+
}) => /*#__PURE__*/_react.default.createElement(Item, {
|
|
314
|
+
title: item,
|
|
315
|
+
index: index
|
|
316
|
+
}),
|
|
317
|
+
getItemCount: getItemCount,
|
|
318
|
+
getItem: getItem
|
|
319
|
+
}))), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
320
|
+
style: {
|
|
321
|
+
height: 10
|
|
322
|
+
}
|
|
323
|
+
}), /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
324
|
+
style: styles.button,
|
|
325
|
+
onPress: async () => {
|
|
326
|
+
const eventId = this.state.checkinOffer["event_id"];
|
|
327
|
+
const url = this.state.checkinOffer["deeplink"];
|
|
328
|
+
|
|
329
|
+
if (eventId != null) {
|
|
330
|
+
if (url != "") {
|
|
331
|
+
const supported = await _reactNative.Linking.canOpenURL(url);
|
|
332
|
+
|
|
333
|
+
if (supported) {
|
|
334
|
+
await _reactNative.Linking.openURL(url);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
} else {
|
|
338
|
+
this.checkInApi();
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
342
|
+
style: {
|
|
343
|
+
fontSize: 20,
|
|
344
|
+
color: (_this$props$style$che5 = (_this$props$style7 = this.props.style) === null || _this$props$style7 === void 0 ? void 0 : _this$props$style7.checkInBtnTextColor) !== null && _this$props$style$che5 !== void 0 ? _this$props$style$che5 : "white",
|
|
345
|
+
paddingLeft: 10,
|
|
346
|
+
paddingRight: 10,
|
|
347
|
+
fontFamily: "Montserrat-Regular"
|
|
348
|
+
}
|
|
349
|
+
}, this.state.checkinOffer["checked_in"] ? "Checked In" : this.state.checkinOffer["button_text"] != "" ? this.state.checkinOffer["button_text"] : "Check In")));
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
const styles = _reactNative.StyleSheet.create({
|
|
355
|
+
main: {
|
|
356
|
+
backgroundColor: "white",
|
|
357
|
+
elevation: 5,
|
|
358
|
+
height: 210,
|
|
359
|
+
width: "90%",
|
|
360
|
+
alignItems: "center",
|
|
361
|
+
borderRadius: 10
|
|
362
|
+
},
|
|
363
|
+
listContainer: {
|
|
364
|
+
height: 60,
|
|
365
|
+
flexDirection: "row",
|
|
366
|
+
justifyContent: "center",
|
|
367
|
+
width: "100%",
|
|
368
|
+
alignItems: 'center',
|
|
369
|
+
alignContent: 'center',
|
|
370
|
+
backgroundColor: "white"
|
|
371
|
+
},
|
|
372
|
+
button: {
|
|
373
|
+
backgroundColor: "#f57242",
|
|
374
|
+
height: 35,
|
|
375
|
+
borderRadius: 5,
|
|
376
|
+
justifyContent: "center"
|
|
377
|
+
}
|
|
378
|
+
});
|
|
379
|
+
|
|
380
|
+
var _default = FlyyCheckinComponent;
|
|
381
|
+
exports.default = _default;
|
|
382
|
+
//# sourceMappingURL=flyy_checkin_view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["flyy_checkin_view.tsx"],"names":["FlyyCheckinComponent","Component","mileStoneData","checkinOffer","listItems","persons","partnerId","userId","appData","environment","componentDidMount","data","Flyy","getUserData","getAppData","setState","e","console","error","fetchData","resp","fetch","state","headers","json","key","info","offers","offer_type_code","milestones","tempData","isRewardDay","isCheckedIn","i","total_streak","j","length","parseInt","value","streak","push","checkInApi","url","id","toString","success","notifyMessage","message","msg","Platform","OS","ToastAndroid","show","SHORT","Toast","showWithGravity","BOTTOM","render","Divider","color","index","flexDirection","React","Children","toArray","map","height","width","backgroundColor","borderRadius","getItemCount","getItem","Math","random","substring","Item","title","day","justifyContent","alignItems","alignContent","alignSelf","require","uri","fontSize","textAlign","props","style","checkInEarnColor","checkInDaysColor","styles","main","openFlyyCheckinPage","checkInTitleColor","fontFamily","checkInDescriptionColor","replace","listContainer","item","button","eventId","supported","Linking","canOpenURL","openURL","checkInBtnTextColor","paddingLeft","paddingRight","StyleSheet","create","elevation"],"mappings":";;;;;;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,oBAAN,SAAmCC,gBAAnC,CAA6C;AAAA;AAAA;;AAAA,mCAEjC;AACJC,MAAAA,aAAa,EAAE,EADX;AAEJC,MAAAA,YAAY,EAAE,EAFV;AAGJC,MAAAA,SAAS,EAAE,EAHP;AAIJC,MAAAA,OAAO,EAAE,CAAC,CAAD,EAAG,CAAH,EAAK,CAAL,EAAO,CAAP,EAAS,CAAT,CAJL;AAKJC,MAAAA,SAAS,EAAE,EALP;AAMJC,MAAAA,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,MAAM,EAAE,EAAV;AAAaL,IAAAA,aAAa,EAAE,KAA5B;AAAkCiB,IAAAA,cAAc,EAAE,QAAlD;AAA2DX,IAAAA,KAAK,EAAC,MAAjE;AAAwEY,IAAAA,UAAU,EAAC,QAAnF;AAA4FC,IAAAA,YAAY,EAAC,QAAzG;AAAkHZ,IAAAA,eAAe,EAAE;AAAnI,GATc;AAU7B+B,EAAAA,MAAM,EAAE;AAAE/B,IAAAA,eAAe,EAAE,SAAnB;AAA8BF,IAAAA,MAAM,EAAE,EAAtC;AAA0CG,IAAAA,YAAY,EAAE,CAAxD;AAA2DS,IAAAA,cAAc,EAAE;AAA3E;AAVqB,CAAlB,CAAf;;eAae9E,oB","sourcesContent":["// @ts-nocheck\nimport React, { Component } from \"react\";\nimport { View, Text, TouchableOpacity,StyleSheet,Image, VirtualizedList, Platform, ToastAndroid, Alert, Linking } from \"react-native\";\nimport Flyy from 'react-native-flyy';\nimport Toast from 'react-native-simple-toast';\n\nclass FlyyCheckinComponent extends Component {\n\n state = {\n mileStoneData: [],\n checkinOffer: [],\n listItems: [],\n persons: [1,2,3,4,5],\n partnerId: \"\",\n userId: \"\",\n appData: \"\",\n environment: 0\n };\n\n async componentDidMount(){\n try {\n const data = await Flyy.getUserData();\n const appData = await Flyy.getAppData();\n this.setState({ \n partnerId : data[\"partner_id\"],\n userId : data[\"user_id\"],\n environment : data[\"environment\"],\n appData: appData\n })\n } catch (e) {\n console.error(e);\n }\n\n await this.fetchData();\n }\n\n\n async fetchData(){\n this.setState({ listItems : []})\n const resp = await fetch(`https://${this.state.environment == 0 ? \"ghc-stage\" : \"ghc\"}.theflyy.com/api/v7/flyy_app_info`, {\n headers: {\n \"X-Key\": this.state.partnerId,\n \"Content-Type\": \"application/json\",\n \"X-App-Data\": this.state.appData\n }\n });\n const data = await resp.json();\n for (var key in data.info.offers) {\n if (data.info.offers[key].offer_type_code === \"checkin\") {\n this.setState({ checkinOffer : data.info.offers[key] })\n this.setState({ mileStoneData : data.info.offers[key].milestones })\n break;\n }\n }\n var tempData = [];\n var isRewardDay = false;\n var isCheckedIn = false;\n for (let i = 0; i < this.state.checkinOffer.total_streak; i++) {\n for (let j = 0; j < this.state.mileStoneData.length; j++) {\n if (i + 1 === parseInt(this.state.mileStoneData[j].value)) {\n isRewardDay = true;\n }\n }\n if (i+1 <= this.state.checkinOffer.streak) {\n isCheckedIn = true;\n }\n tempData.push({ \"isRewardDay\": isRewardDay, \"isCheckedIn\": isCheckedIn })\n isRewardDay = false;\n isCheckedIn = false;\n }\n this.setState({ listItems : tempData })\n }\n\n\n async checkInApi() {\n var url = `https://${this.state.environment == 0 ? \"ghc-stage\" : \"ghc\"}.theflyy.com/api/v1/checkin?offer_id=` + this.state.checkinOffer.id.toString();\n const resp = await fetch(url, {\n headers: {\n \"X-Key\": this.state.partnerId,\n \"Content-Type\": \"application/json\",\n \"X-App-Data\": this.state.appData\n }\n });\n const data = await resp.json();\n if (data.success) {\n this.fetchData()\n } else {\n this.notifyMessage(data.message)\n }\n }\n\n notifyMessage(msg:string) {\n if (Platform.OS === 'android') {\n ToastAndroid.show(msg, ToastAndroid.SHORT)\n } else {\n Toast.showWithGravity(msg, Toast.SHORT, Toast.BOTTOM);\n }\n }\n\n render() {\n const Divider = ({color = \"black\",index}:{color:any,index:any}) => {\n return (\n <View style={{ flexDirection: 'row'}}>\n {React.Children.toArray(\n this.state.persons.map(() => {\n return (\n <View style={{ flexDirection: 'row' }}>\n <View style={{ height: 1, width: 2, backgroundColor: color, borderRadius: 2 }} />\n <View style={{ width: 1, backgroundColor: \"white\", borderRadius: 2 }} />\n </View>\n );\n })\n )}\n </View>\n )\n }\n const getItemCount = () => this.state.listItems.length;\n const getItem = (data:any, index:any) => ({\n id: Math.random().toString(12).substring(0),\n isRewardDay: data[index].isRewardDay,\n isCheckedIn: data[index].isCheckedIn,\n index: index\n });\n const Item = ({ title, index }: {title:any,index:any}) => {\n const day = index + 1;\n return (\n <View style = {{justifyContent: \"center\",alignItems:'center',alignContent:'center'}}>\n <View style = {{flexDirection : 'row',height: 35,justifyContent:'center',alignItems:'center'}}>\n {title.isCheckedIn? <View style={{ height: 1, width: 15, alignSelf: \"center\" , backgroundColor: index == 0 ? \"white\" : \"black\"}} />:<Divider color={index == 0 ? \"white\" : \"black\"} index={index}/>}\n {title.isRewardDay ?\n title.isCheckedIn ? <Image source={require('./assets/images/reward_flyy.png')} style={{ height: 20, width: 15 }} /> : <Image source={{ uri: this.state.checkinOffer[\"currency_icon_url\"] }} style={{ height: 20, width: 20 }} />\n : title.isCheckedIn ?\n <View style = {{height:17,width:17,backgroundColor:\"black\",borderRadius:15,justifyContent:'center',alignItems:'center'}}><Text style={{color:\"white\",fontSize:10}}>✓</Text></View>\n : <Image source={require('./assets/images/radio.png')} style={{ height: 20, width: 20 }} />}\n {index != this.state.listItems.length-1 ? this.state.listItems[index+1].isCheckedIn ? <View style={{ height: 1, width: 15, alignSelf: \"center\" , backgroundColor: index == this.state.listItems.length-1 ? \"white\" : \"black\"}} />:<Divider color={index == this.state.listItems.length - 1 ? \"white\" : \"black\"} index={index}/>: <View style = {{width:15}}/>}\n </View>\n <Text style = {{textAlign: 'center',color: title.isRewardDay ? this.props.style?.checkInEarnColor ?? \"black\" : this.props.style?.checkInDaysColor ?? \"black\"}}>{title.isRewardDay ?\n title.isCheckedIn ? \"Won\" : \"Earn\"\n : title.isCheckedIn ? \"Day \"+day : \"Day \"+day}</Text>\n </View>\n )\n }\n return (\n <TouchableOpacity style={styles.main} onPress = {()=>{\n Flyy.openFlyyCheckinPage();\n }}>\n <View style={{ height: 10 }} />\n <Text style={{ fontSize: 20, color: this.props.style?.checkInTitleColor ?? \"black\", fontFamily: this.props.style?.fontFamily ?? \"Montserrat-Regular\" }}>\n {this.state.checkinOffer[\"offer_type_title\"] ?? \"N/A\"}\n </Text>\n <View style={{ height: 10 }} />\n <View style = {{flexDirection: 'row',width:250,justifyContent: 'center'}}>\n <Text numberOfLines={1} style={{ fontSize: 18, color: this.props.style?.checkInDescriptionColor ?? \"grey\", fontFamily: this.props.style?.fontFamily ?? \"Montserrat-Regular\",textAlign: \"center\"}}>\n {this.state.checkinOffer[\"description\"] != null ? this.state.checkinOffer[\"description\"].replace(/(<([^>]+)>)/ig, '') : \"N/A\"}\n </Text>\n </View>\n <View style={{ height: 10 }} />\n <View style={styles.listContainer}>\n <View>\n <VirtualizedList\n data={this.state.listItems}\n style = {{alignSelf: \"center\"}}\n initialNumToRender={4}\n horizontal={true}\n renderItem={({ item, index }) => <Item title={item} index={index} />}\n getItemCount={getItemCount}\n getItem={getItem}\n />\n </View>\n </View>\n <View style={{ height: 10 }} />\n <TouchableOpacity\n style={styles.button}\n onPress={async () => {\n const eventId = this.state.checkinOffer[\"event_id\"];\n const url = this.state.checkinOffer[\"deeplink\"];\n if(eventId != null){\n if (url != \"\") {\n const supported = await Linking.canOpenURL(url);\n if (supported) {\n await Linking.openURL(url);\n }\n }\n }else{\n this.checkInApi();\n }\n }}>\n <Text style={{\n fontSize: 20,\n color: this.props.style?.checkInBtnTextColor ?? \"white\",\n paddingLeft: 10, \n paddingRight: 10,\n fontFamily: \"Montserrat-Regular\"\n }}>{this.state.checkinOffer[\"checked_in\"] ? \"Checked In\" : this.state.checkinOffer[\"button_text\"] != \"\" ? this.state.checkinOffer[\"button_text\"] : \"Check In\"}</Text>\n </TouchableOpacity>\n </TouchableOpacity>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n main: {\n backgroundColor: \"white\",\n elevation: 5,\n height: 210,\n width: \"90%\",\n alignItems: \"center\",\n borderRadius: 10\n },\n listContainer: { height: 60,flexDirection: \"row\",justifyContent: \"center\",width:\"100%\",alignItems:'center',alignContent:'center',backgroundColor: \"white\"},\n button: { backgroundColor: \"#f57242\", height: 35, borderRadius: 5, justifyContent: \"center\" },\n});\n\nexport default FlyyCheckinComponent;"]}
|