@tyrads.com/tyrads-sdk 2.0.1 → 3.1.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. package/android/build.gradle +1 -1
  2. package/android/gradle.properties +1 -1
  3. package/android/src/main/java/com/tyradssdk/TyradsSdkModule.kt +27 -6
  4. package/ios/Tyrads/AcmoConfig.swift +3 -3
  5. package/ios/Tyrads/InitModel.swift +5 -2
  6. package/ios/Tyrads/Tyrads.swift +117 -186
  7. package/ios/Tyrads/WebViewController.swift +171 -0
  8. package/ios/Tyrads/helpers/aes_encryptor.swift +81 -0
  9. package/ios/Tyrads/helpers/device_details.swift +58 -0
  10. package/ios/TyradsSdk.mm +10 -2
  11. package/ios/TyradsSdk.swift +44 -29
  12. package/lib/commonjs/acmo/core/helpers/launcher.js +20 -0
  13. package/lib/commonjs/acmo/core/helpers/launcher.js.map +1 -0
  14. package/lib/commonjs/acmo/modules/dashboard/components/active_offers_button.js +76 -0
  15. package/lib/commonjs/acmo/modules/dashboard/components/active_offers_button.js.map +1 -0
  16. package/lib/commonjs/acmo/modules/dashboard/components/custom_card.js +7 -10
  17. package/lib/commonjs/acmo/modules/dashboard/components/custom_card.js.map +1 -1
  18. package/lib/commonjs/acmo/modules/dashboard/components/custom_scroller.js +141 -0
  19. package/lib/commonjs/acmo/modules/dashboard/components/custom_scroller.js.map +1 -0
  20. package/lib/commonjs/acmo/{core/marquee.js → modules/dashboard/components/custom_shimmer.js} +46 -34
  21. package/lib/commonjs/acmo/modules/dashboard/components/custom_shimmer.js.map +1 -0
  22. package/lib/commonjs/acmo/modules/dashboard/components/offer_card.js +264 -0
  23. package/lib/commonjs/acmo/modules/dashboard/components/offer_card.js.map +1 -0
  24. package/lib/commonjs/acmo/modules/dashboard/components/offer_list_item.js +197 -0
  25. package/lib/commonjs/acmo/modules/dashboard/components/offer_list_item.js.map +1 -0
  26. package/lib/commonjs/acmo/modules/dashboard/components/premium_empty_widget.js +83 -0
  27. package/lib/commonjs/acmo/modules/dashboard/components/premium_empty_widget.js.map +1 -0
  28. package/lib/commonjs/acmo/modules/dashboard/components/premium_header.js +12 -10
  29. package/lib/commonjs/acmo/modules/dashboard/components/premium_header.js.map +1 -1
  30. package/lib/commonjs/acmo/modules/dashboard/components/premium_loading.js +118 -0
  31. package/lib/commonjs/acmo/modules/dashboard/components/premium_loading.js.map +1 -0
  32. package/lib/commonjs/acmo/modules/dashboard/repository.js +108 -32
  33. package/lib/commonjs/acmo/modules/dashboard/repository.js.map +1 -1
  34. package/lib/commonjs/acmo/modules/dashboard/top_offers.js +70 -63
  35. package/lib/commonjs/acmo/modules/dashboard/top_offers.js.map +1 -1
  36. package/lib/commonjs/assets/images/angle_up.png +0 -0
  37. package/lib/commonjs/assets/images/diamond.png +0 -0
  38. package/lib/commonjs/assets/images/info.png +0 -0
  39. package/lib/commonjs/assets/images/info_icon.png +0 -0
  40. package/lib/commonjs/assets/images/premium-emptybg.jpeg +0 -0
  41. package/lib/commonjs/assets/images/rank_1.png +0 -0
  42. package/lib/commonjs/assets/images/rank_2.png +0 -0
  43. package/lib/commonjs/assets/images/rank_3.png +0 -0
  44. package/lib/commonjs/assets/images/rank_4.png +0 -0
  45. package/lib/commonjs/assets/images/rank_5.png +0 -0
  46. package/lib/commonjs/index.js +15 -16
  47. package/lib/commonjs/index.js.map +1 -1
  48. package/lib/module/acmo/core/helpers/launcher.js +15 -0
  49. package/lib/module/acmo/core/helpers/launcher.js.map +1 -0
  50. package/lib/module/acmo/modules/dashboard/components/active_offers_button.js +70 -0
  51. package/lib/module/acmo/modules/dashboard/components/active_offers_button.js.map +1 -0
  52. package/lib/module/acmo/modules/dashboard/components/custom_card.js +7 -10
  53. package/lib/module/acmo/modules/dashboard/components/custom_card.js.map +1 -1
  54. package/lib/module/acmo/modules/dashboard/components/custom_scroller.js +135 -0
  55. package/lib/module/acmo/modules/dashboard/components/custom_scroller.js.map +1 -0
  56. package/lib/module/acmo/modules/dashboard/components/custom_shimmer.js +66 -0
  57. package/lib/module/acmo/modules/dashboard/components/custom_shimmer.js.map +1 -0
  58. package/lib/module/acmo/modules/dashboard/components/offer_card.js +257 -0
  59. package/lib/module/acmo/modules/dashboard/components/offer_card.js.map +1 -0
  60. package/lib/module/acmo/modules/dashboard/components/offer_list_item.js +191 -0
  61. package/lib/module/acmo/modules/dashboard/components/offer_list_item.js.map +1 -0
  62. package/lib/module/acmo/modules/dashboard/components/premium_empty_widget.js +78 -0
  63. package/lib/module/acmo/modules/dashboard/components/premium_empty_widget.js.map +1 -0
  64. package/lib/module/acmo/modules/dashboard/components/premium_header.js +12 -10
  65. package/lib/module/acmo/modules/dashboard/components/premium_header.js.map +1 -1
  66. package/lib/module/acmo/modules/dashboard/components/premium_loading.js +113 -0
  67. package/lib/module/acmo/modules/dashboard/components/premium_loading.js.map +1 -0
  68. package/lib/module/acmo/modules/dashboard/repository.js +105 -30
  69. package/lib/module/acmo/modules/dashboard/repository.js.map +1 -1
  70. package/lib/module/acmo/modules/dashboard/top_offers.js +71 -64
  71. package/lib/module/acmo/modules/dashboard/top_offers.js.map +1 -1
  72. package/lib/module/assets/images/angle_up.png +0 -0
  73. package/lib/module/assets/images/diamond.png +0 -0
  74. package/lib/module/assets/images/info.png +0 -0
  75. package/lib/module/assets/images/info_icon.png +0 -0
  76. package/lib/module/assets/images/premium-emptybg.jpeg +0 -0
  77. package/lib/module/assets/images/rank_1.png +0 -0
  78. package/lib/module/assets/images/rank_2.png +0 -0
  79. package/lib/module/assets/images/rank_3.png +0 -0
  80. package/lib/module/assets/images/rank_4.png +0 -0
  81. package/lib/module/assets/images/rank_5.png +0 -0
  82. package/lib/module/index.js +15 -16
  83. package/lib/module/index.js.map +1 -1
  84. package/lib/typescript/commonjs/src/acmo/core/helpers/launcher.d.ts +3 -0
  85. package/lib/typescript/commonjs/src/acmo/core/helpers/launcher.d.ts.map +1 -0
  86. package/lib/typescript/commonjs/src/acmo/core/storage/storage.d.ts.map +1 -1
  87. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/active_offers_button.d.ts +9 -0
  88. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/active_offers_button.d.ts.map +1 -0
  89. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/custom_card.d.ts.map +1 -1
  90. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/custom_scroller.d.ts +17 -0
  91. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/custom_scroller.d.ts.map +1 -0
  92. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/custom_shimmer.d.ts +11 -0
  93. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/custom_shimmer.d.ts.map +1 -0
  94. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_card.d.ts +12 -0
  95. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_card.d.ts.map +1 -0
  96. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_list_item.d.ts +15 -0
  97. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_list_item.d.ts.map +1 -0
  98. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_empty_widget.d.ts +7 -0
  99. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_empty_widget.d.ts.map +1 -0
  100. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_loading.d.ts +9 -0
  101. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_loading.d.ts.map +1 -0
  102. package/lib/typescript/commonjs/src/acmo/modules/dashboard/repository.d.ts +2 -1
  103. package/lib/typescript/commonjs/src/acmo/modules/dashboard/repository.d.ts.map +1 -1
  104. package/lib/typescript/commonjs/src/acmo/modules/dashboard/top_offers.d.ts +8 -7
  105. package/lib/typescript/commonjs/src/acmo/modules/dashboard/top_offers.d.ts.map +1 -1
  106. package/lib/typescript/commonjs/src/index.d.ts +6 -8
  107. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  108. package/lib/typescript/module/src/acmo/core/helpers/launcher.d.ts +3 -0
  109. package/lib/typescript/module/src/acmo/core/helpers/launcher.d.ts.map +1 -0
  110. package/lib/typescript/module/src/acmo/core/storage/storage.d.ts.map +1 -1
  111. package/lib/typescript/module/src/acmo/modules/dashboard/components/active_offers_button.d.ts +9 -0
  112. package/lib/typescript/module/src/acmo/modules/dashboard/components/active_offers_button.d.ts.map +1 -0
  113. package/lib/typescript/module/src/acmo/modules/dashboard/components/custom_card.d.ts.map +1 -1
  114. package/lib/typescript/module/src/acmo/modules/dashboard/components/custom_scroller.d.ts +17 -0
  115. package/lib/typescript/module/src/acmo/modules/dashboard/components/custom_scroller.d.ts.map +1 -0
  116. package/lib/typescript/module/src/acmo/modules/dashboard/components/custom_shimmer.d.ts +11 -0
  117. package/lib/typescript/module/src/acmo/modules/dashboard/components/custom_shimmer.d.ts.map +1 -0
  118. package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_card.d.ts +12 -0
  119. package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_card.d.ts.map +1 -0
  120. package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_list_item.d.ts +15 -0
  121. package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_list_item.d.ts.map +1 -0
  122. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_empty_widget.d.ts +7 -0
  123. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_empty_widget.d.ts.map +1 -0
  124. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_loading.d.ts +9 -0
  125. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_loading.d.ts.map +1 -0
  126. package/lib/typescript/module/src/acmo/modules/dashboard/repository.d.ts +2 -1
  127. package/lib/typescript/module/src/acmo/modules/dashboard/repository.d.ts.map +1 -1
  128. package/lib/typescript/module/src/acmo/modules/dashboard/top_offers.d.ts +8 -7
  129. package/lib/typescript/module/src/acmo/modules/dashboard/top_offers.d.ts.map +1 -1
  130. package/lib/typescript/module/src/index.d.ts +6 -8
  131. package/lib/typescript/module/src/index.d.ts.map +1 -1
  132. package/package.json +3 -2
  133. package/readme.md +8 -8
  134. package/src/acmo/core/helpers/launcher.ts +14 -0
  135. package/src/acmo/core/types/types.d.ts +11 -13
  136. package/src/acmo/modules/dashboard/components/active_offers_button.tsx +61 -0
  137. package/src/acmo/modules/dashboard/components/custom_card.tsx +5 -8
  138. package/src/acmo/modules/dashboard/components/custom_scroller.tsx +164 -0
  139. package/src/acmo/modules/dashboard/components/custom_shimmer.tsx +75 -0
  140. package/src/acmo/modules/dashboard/components/offer_card.tsx +248 -0
  141. package/src/acmo/modules/dashboard/components/offer_list_item.tsx +225 -0
  142. package/src/acmo/modules/dashboard/components/premium_empty_widget.tsx +76 -0
  143. package/src/acmo/modules/dashboard/components/premium_header.tsx +8 -8
  144. package/src/acmo/modules/dashboard/components/premium_loading.tsx +78 -0
  145. package/src/acmo/modules/dashboard/repository.ts +121 -46
  146. package/src/acmo/modules/dashboard/top_offers.tsx +89 -52
  147. package/src/assets/images/angle_up.png +0 -0
  148. package/src/assets/images/diamond.png +0 -0
  149. package/src/assets/images/info.png +0 -0
  150. package/src/assets/images/info_icon.png +0 -0
  151. package/src/assets/images/premium-emptybg.jpeg +0 -0
  152. package/src/assets/images/rank_1.png +0 -0
  153. package/src/assets/images/rank_2.png +0 -0
  154. package/src/assets/images/rank_3.png +0 -0
  155. package/src/assets/images/rank_4.png +0 -0
  156. package/src/assets/images/rank_5.png +0 -0
  157. package/src/index.tsx +19 -23
  158. package/android/src/main/java/com/tyradssdk/TyradsSdkComposeViewManager.kt +0 -112
  159. package/lib/commonjs/acmo/core/marquee.js.map +0 -1
  160. package/lib/commonjs/acmo/modules/dashboard/components/auto_scroller.js +0 -87
  161. package/lib/commonjs/acmo/modules/dashboard/components/auto_scroller.js.map +0 -1
  162. package/lib/commonjs/acmo/modules/dashboard/components/my_games_button.js +0 -48
  163. package/lib/commonjs/acmo/modules/dashboard/components/my_games_button.js.map +0 -1
  164. package/lib/commonjs/acmo/modules/dashboard/components/offer_info_section.js +0 -158
  165. package/lib/commonjs/acmo/modules/dashboard/components/offer_info_section.js.map +0 -1
  166. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_1.js +0 -181
  167. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_1.js.map +0 -1
  168. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_2.js +0 -102
  169. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_2.js.map +0 -1
  170. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_3.js +0 -41
  171. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_3.js.map +0 -1
  172. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_4.js +0 -214
  173. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_4.js.map +0 -1
  174. package/lib/module/acmo/core/marquee.js +0 -54
  175. package/lib/module/acmo/core/marquee.js.map +0 -1
  176. package/lib/module/acmo/modules/dashboard/components/auto_scroller.js +0 -81
  177. package/lib/module/acmo/modules/dashboard/components/auto_scroller.js.map +0 -1
  178. package/lib/module/acmo/modules/dashboard/components/my_games_button.js +0 -43
  179. package/lib/module/acmo/modules/dashboard/components/my_games_button.js.map +0 -1
  180. package/lib/module/acmo/modules/dashboard/components/offer_info_section.js +0 -153
  181. package/lib/module/acmo/modules/dashboard/components/offer_info_section.js.map +0 -1
  182. package/lib/module/acmo/modules/dashboard/components/premium_option_1.js +0 -176
  183. package/lib/module/acmo/modules/dashboard/components/premium_option_1.js.map +0 -1
  184. package/lib/module/acmo/modules/dashboard/components/premium_option_2.js +0 -97
  185. package/lib/module/acmo/modules/dashboard/components/premium_option_2.js.map +0 -1
  186. package/lib/module/acmo/modules/dashboard/components/premium_option_3.js +0 -36
  187. package/lib/module/acmo/modules/dashboard/components/premium_option_3.js.map +0 -1
  188. package/lib/module/acmo/modules/dashboard/components/premium_option_4.js +0 -209
  189. package/lib/module/acmo/modules/dashboard/components/premium_option_4.js.map +0 -1
  190. package/lib/typescript/commonjs/src/acmo/core/marquee.d.ts +0 -11
  191. package/lib/typescript/commonjs/src/acmo/core/marquee.d.ts.map +0 -1
  192. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/auto_scroller.d.ts +0 -10
  193. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/auto_scroller.d.ts.map +0 -1
  194. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/my_games_button.d.ts +0 -8
  195. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/my_games_button.d.ts.map +0 -1
  196. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_info_section.d.ts +0 -11
  197. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_info_section.d.ts.map +0 -1
  198. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_1.d.ts +0 -9
  199. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_1.d.ts.map +0 -1
  200. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_2.d.ts +0 -9
  201. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_2.d.ts.map +0 -1
  202. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_3.d.ts +0 -9
  203. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_3.d.ts.map +0 -1
  204. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_4.d.ts +0 -9
  205. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_4.d.ts.map +0 -1
  206. package/lib/typescript/module/src/acmo/core/marquee.d.ts +0 -11
  207. package/lib/typescript/module/src/acmo/core/marquee.d.ts.map +0 -1
  208. package/lib/typescript/module/src/acmo/modules/dashboard/components/auto_scroller.d.ts +0 -10
  209. package/lib/typescript/module/src/acmo/modules/dashboard/components/auto_scroller.d.ts.map +0 -1
  210. package/lib/typescript/module/src/acmo/modules/dashboard/components/my_games_button.d.ts +0 -8
  211. package/lib/typescript/module/src/acmo/modules/dashboard/components/my_games_button.d.ts.map +0 -1
  212. package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_info_section.d.ts +0 -11
  213. package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_info_section.d.ts.map +0 -1
  214. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_1.d.ts +0 -9
  215. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_1.d.ts.map +0 -1
  216. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_2.d.ts +0 -9
  217. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_2.d.ts.map +0 -1
  218. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_3.d.ts +0 -9
  219. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_3.d.ts.map +0 -1
  220. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_4.d.ts +0 -9
  221. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_4.d.ts.map +0 -1
  222. package/src/acmo/core/marquee.tsx +0 -62
  223. package/src/acmo/modules/dashboard/components/auto_scroller.tsx +0 -85
  224. package/src/acmo/modules/dashboard/components/my_games_button.tsx +0 -40
  225. package/src/acmo/modules/dashboard/components/offer_info_section.tsx +0 -139
  226. package/src/acmo/modules/dashboard/components/premium_option_1.tsx +0 -156
  227. package/src/acmo/modules/dashboard/components/premium_option_2.tsx +0 -100
  228. package/src/acmo/modules/dashboard/components/premium_option_3.tsx +0 -42
  229. package/src/acmo/modules/dashboard/components/premium_option_4.tsx +0 -185
@@ -1,16 +1,3 @@
1
- interface TransformedCampaign {
2
- campaignId: number;
3
- appId: number;
4
- title: string;
5
- creativePackName: string;
6
- fileUrl: string;
7
- points: number;
8
- rewards: number;
9
- currency: any;
10
- thumbnail: string;
11
- premium: boolean;
12
- sortingScore: number;
13
- }
14
1
 
15
2
  interface Campaign {
16
3
  campaignId: number;
@@ -54,6 +41,7 @@ interface Campaign {
54
41
  tracking: {
55
42
  impressionUrl: string;
56
43
  clickUrl: string;
44
+ s2sClickUrl: string;
57
45
  };
58
46
  targeting: {
59
47
  os: string;
@@ -88,7 +76,17 @@ interface Campaign {
88
76
  }[];
89
77
  }[];
90
78
  };
79
+ isInstalled: boolean;
91
80
  isRetryDownload: boolean;
92
81
  capReached: boolean;
93
82
  premium: boolean;
83
+ }
84
+
85
+ interface CurrencySales {
86
+ name: null | string,
87
+ multiplier: null | number,
88
+ bannerUrl: null | string,
89
+ dateStart: null | string,
90
+ dateEnd: null | string,
91
+ remainingTimeSeconds: null | number
94
92
  }
@@ -0,0 +1,61 @@
1
+ import React from 'react';
2
+ import { TouchableOpacity, Text, StyleSheet, View, } from 'react-native';
3
+ // import { useTranslation } from 'react-i18next';
4
+
5
+ interface ActiveOffersBtnProps {
6
+ premiumColor?: string;
7
+ activeCount: number;
8
+ onPress: (route: string) => void;
9
+ }
10
+
11
+ const ActiveOffersButton: React.FC<ActiveOffersBtnProps> = ({ premiumColor, activeCount, onPress }) => {
12
+ // const { t } = useTranslation();
13
+ return (
14
+ <TouchableOpacity
15
+ style={[styles.button, { borderColor: premiumColor }]}
16
+ onPress={() => onPress && onPress('active-offers')}
17
+ >
18
+ <View style={{ flexDirection: 'row', alignItems: 'center' }}>
19
+ <Text style={[styles.buttonText, { color: premiumColor }]}>Active Offers</Text>
20
+ {activeCount > 0 &&
21
+ <View style={styles.activeCountContainer}>
22
+ <Text style={styles.activeCountText}>{activeCount > 99 ? '99+' : activeCount}</Text>
23
+ </View>}
24
+ </View>
25
+ </TouchableOpacity>
26
+ );
27
+ };
28
+
29
+ const styles = StyleSheet.create({
30
+ button: {
31
+ borderRadius: 42,
32
+ paddingHorizontal: 16,
33
+ paddingVertical: 8,
34
+ height: 40,
35
+ justifyContent: 'center',
36
+ alignItems: 'center',
37
+ marginHorizontal: 16,
38
+ marginBottom: 16,
39
+ borderWidth: 2,
40
+ },
41
+ buttonText: {
42
+ fontSize: 14,
43
+ fontWeight: 'bold',
44
+ },
45
+ activeCountContainer: {
46
+ marginLeft: 8,
47
+ width: 18,
48
+ height: 18,
49
+ backgroundColor: '#FF554A',
50
+ alignItems: 'center',
51
+ justifyContent: 'center',
52
+ borderRadius: 9,
53
+ },
54
+ activeCountText: {
55
+ color: 'white',
56
+ fontSize: 10,
57
+ fontWeight: 'bold',
58
+ }
59
+ });
60
+
61
+ export default ActiveOffersButton;
@@ -13,18 +13,15 @@ const CustomCard: React.FC<CustomCardProps> = ({ children, style }) => {
13
13
  const styles = StyleSheet.create({
14
14
  card: {
15
15
  backgroundColor: 'white',
16
- borderTopLeftRadius: 20,
17
- borderTopRightRadius: 20,
18
- borderBottomLeftRadius: 14,
19
- borderBottomRightRadius: 14,
16
+ borderRadius: 16,
20
17
  paddingTop: 6,
21
18
  paddingBottom: 5,
22
19
  shadowColor: '#000',
23
- shadowOffset: { width: 4, height: 4 },
24
- shadowOpacity: 0.2,
25
- shadowRadius: 4,
26
- elevation: 4,
27
20
  alignSelf: 'center',
21
+ shadowOffset: { width: 0, height: 2 },
22
+ shadowOpacity: 0.24,
23
+ shadowRadius: 3.5,
24
+ elevation: 4,
28
25
  },
29
26
  });
30
27
 
@@ -0,0 +1,164 @@
1
+ import React, { useRef, useState, useEffect } from 'react';
2
+ import {
3
+ View,
4
+ Animated,
5
+ StyleSheet,
6
+ type ViewStyle,
7
+ type StyleProp,
8
+ type LayoutChangeEvent,
9
+ } from 'react-native';
10
+
11
+ interface PagerProps {
12
+ totalPages: number;
13
+ delayInMillis?: number;
14
+ premiumColor?: string;
15
+ content: (index: number) => React.ReactNode;
16
+ viewportFraction?: number;
17
+ scaleFactor?: number;
18
+ spacing?: number;
19
+ indicatorStyle?: StyleProp<ViewStyle>;
20
+ activeIndicatorColor?: string;
21
+ inactiveIndicatorColor?: string;
22
+ }
23
+
24
+ const AcmoScrollPager: React.FC<PagerProps> = ({
25
+ totalPages,
26
+ delayInMillis = 5000,
27
+ content,
28
+ viewportFraction = 0.92,
29
+ scaleFactor = 0.94,
30
+ spacing = 2,
31
+ indicatorStyle,
32
+ activeIndicatorColor = 'red',
33
+ inactiveIndicatorColor = 'lightgray',
34
+ }) => {
35
+ const scrollX = useRef(new Animated.Value(0)).current;
36
+ const scrollViewRef = useRef<React.RefObject<typeof Animated.ScrollView> | any>(null);
37
+ const [currentPage, setCurrentPage] = useState(0);
38
+ const [containerWidth, setContainerWidth] = useState<number | null>(null);
39
+
40
+ const intervalRef = useRef<ReturnType<typeof setInterval> | null>(null);
41
+
42
+ const onContainerLayout = (e: LayoutChangeEvent) => {
43
+ const { width } = e.nativeEvent.layout;
44
+ if (width !== containerWidth) setContainerWidth(width);
45
+ };
46
+
47
+ useEffect(() => {
48
+ if (!containerWidth) return;
49
+
50
+ const itemWidth = containerWidth * viewportFraction;
51
+ const offset = itemWidth + spacing;
52
+
53
+ intervalRef.current = setInterval(() => {
54
+ const next = (currentPage + 1) % totalPages;
55
+ setCurrentPage(next);
56
+ scrollViewRef.current.scrollTo({
57
+ x: next * offset,
58
+ animated: true,
59
+ });
60
+ }, delayInMillis);
61
+
62
+ return () => {
63
+ if (intervalRef.current) clearInterval(intervalRef.current);
64
+ };
65
+ }, [containerWidth, currentPage, delayInMillis, totalPages, viewportFraction, spacing]);
66
+
67
+ const handleScroll = Animated.event(
68
+ [{ nativeEvent: { contentOffset: { x: scrollX } } }],
69
+ {
70
+ useNativeDriver: true,
71
+ listener: (event: { nativeEvent: { contentOffset: { x: number } } }) => {
72
+ if (!containerWidth) return;
73
+ const offset = containerWidth * viewportFraction + spacing;
74
+ const index = Math.round(event.nativeEvent.contentOffset.x / offset);
75
+ setCurrentPage(index);
76
+ },
77
+ }
78
+ );
79
+
80
+ const renderIndicators = () => (
81
+ <View style={[styles.indicatorContainer, indicatorStyle]}>
82
+ {Array.from({ length: totalPages }, (_, i) => (
83
+ <View
84
+ key={i}
85
+ style={[
86
+ styles.indicator,
87
+ {
88
+ backgroundColor:
89
+ i === currentPage ? activeIndicatorColor : inactiveIndicatorColor,
90
+ },
91
+ ]}
92
+ />
93
+ ))}
94
+ </View>
95
+ );
96
+
97
+ if (!containerWidth) {
98
+ return <View onLayout={onContainerLayout} style={{ width: '100%' }} />;
99
+ }
100
+
101
+ const itemWidth = containerWidth * viewportFraction;
102
+ const itemOffset = itemWidth + spacing;
103
+ const sidePadding = (containerWidth - itemWidth - 16) / 2;
104
+
105
+ return (
106
+ <View onLayout={onContainerLayout} style={{ width: '100%', alignItems: 'center' }}>
107
+ <Animated.ScrollView
108
+ ref={scrollViewRef}
109
+ horizontal
110
+ pagingEnabled={false}
111
+ snapToInterval={itemOffset}
112
+ decelerationRate="fast"
113
+ showsHorizontalScrollIndicator={false}
114
+ scrollEventThrottle={16}
115
+ onScroll={handleScroll}
116
+ contentContainerStyle={{ paddingHorizontal: sidePadding }}
117
+ >
118
+ {Array.from({ length: totalPages }, (_, i) => {
119
+ const inputRange = [
120
+ itemOffset * (i - 1),
121
+ itemOffset * i,
122
+ itemOffset * (i + 1),
123
+ ];
124
+
125
+ const scale = scrollX.interpolate({
126
+ inputRange,
127
+ outputRange: [scaleFactor, 1, scaleFactor],
128
+ extrapolate: 'clamp',
129
+ });
130
+
131
+ return (
132
+ <Animated.View
133
+ key={i}
134
+ style={{
135
+ width: itemWidth,
136
+ transform: [{ scale }],
137
+ }}
138
+ >
139
+ {content(i)}
140
+ </Animated.View>
141
+ );
142
+ })}
143
+ </Animated.ScrollView>
144
+ {renderIndicators()}
145
+ </View>
146
+ );
147
+ };
148
+
149
+ const styles = StyleSheet.create({
150
+ indicatorContainer: {
151
+ flexDirection: 'row',
152
+ justifyContent: 'center',
153
+ marginTop: 6,
154
+ marginBottom: 8,
155
+ },
156
+ indicator: {
157
+ width: 8,
158
+ height: 8,
159
+ borderRadius: 4,
160
+ marginHorizontal: 4,
161
+ },
162
+ });
163
+
164
+ export default AcmoScrollPager;
@@ -0,0 +1,75 @@
1
+ import React, { useEffect, useRef } from 'react';
2
+ import { View, Animated, StyleSheet, Dimensions, type DimensionValue, type ViewStyle, type StyleProp } from 'react-native';
3
+
4
+ interface ShimmerProps {
5
+ width?: DimensionValue;
6
+ shimmerHeight?: number;
7
+ style?: StyleProp<ViewStyle>;
8
+ duration?: number;
9
+ }
10
+
11
+ const SCREEN_WIDTH = Dimensions.get('window').width;
12
+
13
+ const Shimmer: React.FC<ShimmerProps> = ({
14
+ width = '100%',
15
+ shimmerHeight: height = 16,
16
+ style,
17
+ duration = 1500,
18
+ }) => {
19
+ const translateX = useRef(new Animated.Value(-1)).current;
20
+
21
+ useEffect(() => {
22
+ const animation = Animated.loop(
23
+ Animated.timing(translateX, {
24
+ toValue: 1,
25
+ duration,
26
+ useNativeDriver: true,
27
+ }),
28
+ );
29
+ animation.start();
30
+ return () => animation.stop();
31
+ }, [translateX, duration]);
32
+
33
+ const translateXInterpolate = translateX.interpolate({
34
+ inputRange: [-1, 1],
35
+ outputRange: [-SCREEN_WIDTH, SCREEN_WIDTH],
36
+ });
37
+
38
+ return (
39
+ <View style={[styles.container, { width }, style]}>
40
+ <View style={[styles.shimmerBackground, { height }]} />
41
+ <Animated.View
42
+ style={[
43
+ styles.shimmerOverlay,
44
+ {
45
+ width: SCREEN_WIDTH,
46
+ height,
47
+ transform: [{ translateX: translateXInterpolate }],
48
+ },
49
+ ]}
50
+ />
51
+ </View>
52
+ );
53
+ };
54
+
55
+ const styles = StyleSheet.create({
56
+ container: {
57
+ overflow: 'hidden',
58
+ backgroundColor: '#e1e1e1',
59
+ borderRadius: 4,
60
+ },
61
+ shimmerBackground: {
62
+ flex: 1,
63
+ backgroundColor: '#d3d3d3',
64
+ },
65
+ shimmerOverlay: {
66
+ position: 'absolute',
67
+ top: 0,
68
+ left: 0,
69
+ backgroundColor: 'rgba(255,255,255,0.5)',
70
+ opacity: 0.4,
71
+ borderRadius: 4,
72
+ },
73
+ });
74
+
75
+ export default Shimmer;
@@ -0,0 +1,248 @@
1
+ import numeral from 'numeral';
2
+ import React, { useState } from 'react';
3
+ import {
4
+ View,
5
+ Text,
6
+ Image,
7
+ StyleSheet,
8
+ TouchableOpacity,
9
+ ActivityIndicator,
10
+ } from 'react-native';
11
+
12
+
13
+ interface Props {
14
+ item: Campaign;
15
+ onButtonClick: () => Promise<void>;
16
+ currencySaleModel?: CurrencySales;
17
+ premiumColor?: string;
18
+ isLoading: boolean;
19
+ onTap?: () => Promise<void>;
20
+ }
21
+
22
+ const AcmoOfferCard: React.FC<Props> = ({
23
+ item,
24
+ onButtonClick,
25
+ currencySaleModel,
26
+ premiumColor,
27
+ isLoading,
28
+ onTap,
29
+ }) => {
30
+ const [loading, setLoading] = useState<boolean>(isLoading);
31
+ const bonusMultiplier = currencySaleModel?.multiplier ?? 1;
32
+ const itemHeight = 132;
33
+
34
+ const handleClick = async () => {
35
+ if (loading) return;
36
+ setLoading(true);
37
+ await onButtonClick();
38
+ setLoading(false);
39
+ };
40
+
41
+ return (
42
+ <TouchableOpacity
43
+ key={item.campaignId}
44
+ activeOpacity={0.9}
45
+ style={styles.container}
46
+ onPress={() => {
47
+ if (!loading && onTap) onTap();
48
+ }}
49
+ >
50
+ <View style={styles.cardShadow}>
51
+ <View style={[styles.imageContainer, { height: itemHeight }]}>
52
+ <Image
53
+ source={{ uri: item.creative.creativePacks[0]?.creatives[0]?.fileUrl || '' }}
54
+ style={styles.image}
55
+ />
56
+ {item.premium && (
57
+ <View style={styles.diamondIcon}>
58
+ <Image
59
+ style={{ width: 12, height: 12, objectFit: 'contain', tintColor: 'white' }}
60
+ source={require('../../../../assets/images/diamond.png')}
61
+ />
62
+ </View>
63
+ )}
64
+ </View>
65
+
66
+ <View style={styles.detailCard}>
67
+ <View style={styles.header}>
68
+ <Image source={{ uri: item.app.thumbnail }} style={styles.appIcon} />
69
+ <Text style={styles.title}>{item.app.title}</Text>
70
+
71
+ <View style={styles.payoutSection}>
72
+ {currencySaleModel?.multiplier && (
73
+ <Text style={styles.strikePayout}>
74
+ {numeral(item.campaignPayout.totalPlayablePayoutConverted).format("0.00a").toUpperCase()}
75
+ </Text>
76
+ )}
77
+ <View style={styles.payoutRow}>
78
+ <Image source={{ uri: item.currency.adUnitCurrencyIcon }} style={styles.currencyIcon} />
79
+ <Text style={styles.payoutText}>
80
+ {numeral(item.campaignPayout.totalPlayablePayoutConverted * bonusMultiplier).format("0.00a").toUpperCase()}
81
+ </Text>
82
+ </View>
83
+ </View>
84
+
85
+ <TouchableOpacity onPress={onTap} disabled={loading}>
86
+ <Image source={require('../../../../assets/images/info_icon.png')} style={styles.infoIcon} />
87
+ </TouchableOpacity>
88
+ </View>
89
+
90
+ <TouchableOpacity
91
+ style={[styles.button, loading && styles.buttonDisabled, { backgroundColor: loading ? '#888' : premiumColor || '#1C90DF' }]}
92
+ onPress={handleClick}
93
+ disabled={loading}
94
+ >
95
+ {loading ? (
96
+ <ActivityIndicator color="white" />
97
+ ) : (
98
+ <Text style={styles.buttonText}>Play Now</Text>
99
+ )}
100
+ </TouchableOpacity>
101
+ </View>
102
+
103
+ {currencySaleModel?.multiplier && (
104
+ <View style={[styles.bonusBadge, { backgroundColor: `${premiumColor}` || '#1C90DF' }]}>
105
+ <Text style={styles.bonusText}>{currencySaleModel?.multiplier.toFixed(1)}x Bonus</Text>
106
+ </View>
107
+ )}
108
+ {currencySaleModel?.multiplier && (
109
+ <View style={[styles.trianlge, { backgroundColor: `${premiumColor}cc` || '#1C90DF' }]}>
110
+ </View>
111
+
112
+ )}
113
+ </View>
114
+ </TouchableOpacity>
115
+ );
116
+ };
117
+
118
+ const styles = StyleSheet.create({
119
+ container: {
120
+ margin: 16,
121
+ width: "100%"
122
+ },
123
+ cardShadow: {
124
+ borderRadius: 16,
125
+ backgroundColor: 'white',
126
+ shadowColor: 'black',
127
+ shadowOffset: { width: 0, height: 16 },
128
+ shadowOpacity: 0.06,
129
+ shadowRadius: 18,
130
+ elevation: 4,
131
+ },
132
+ imageContainer: {
133
+ borderTopLeftRadius: 16,
134
+ borderTopRightRadius: 16,
135
+ overflow: 'hidden',
136
+ },
137
+ image: {
138
+ width: '100%',
139
+ height: '100%',
140
+ resizeMode: 'cover',
141
+ },
142
+ diamondIcon: {
143
+ position: 'absolute',
144
+ top: 16,
145
+ right: 16,
146
+ backgroundColor: '#1E2020DD',
147
+ width: 28,
148
+ height: 28,
149
+ borderRadius: 8,
150
+ justifyContent: 'center',
151
+ alignItems: 'center',
152
+ },
153
+ diamondText: {
154
+ color: 'white',
155
+ fontSize: 14,
156
+ },
157
+ detailCard: {
158
+ padding: 16,
159
+ },
160
+ header: {
161
+ flexDirection: 'row',
162
+ justifyContent: 'space-between',
163
+ alignItems: 'center',
164
+ },
165
+ appIcon: {
166
+ width: 38,
167
+ height: 38,
168
+ borderRadius: 8,
169
+ marginRight: 8,
170
+ },
171
+ title: {
172
+ flex: 1,
173
+ fontWeight: '600',
174
+ fontSize: 14,
175
+ },
176
+ payoutSection: {
177
+ alignItems: 'flex-end',
178
+ },
179
+ strikePayout: {
180
+ textDecorationLine: 'line-through',
181
+ color: '#454646',
182
+ fontSize: 12,
183
+ },
184
+ payoutRow: {
185
+ flexDirection: 'row',
186
+ alignItems: 'center',
187
+ },
188
+ currencyIcon: {
189
+ width: 16,
190
+ height: 16,
191
+ marginRight: 4,
192
+ },
193
+ payoutText: {
194
+ fontWeight: '700',
195
+ fontSize: 14,
196
+ },
197
+ infoIcon: {
198
+ width: 16,
199
+ height: 16,
200
+ marginLeft: 8,
201
+ },
202
+ button: {
203
+ marginTop: 12,
204
+ height: 42,
205
+ borderRadius: 8,
206
+ justifyContent: 'center',
207
+ alignItems: 'center',
208
+ },
209
+ buttonDisabled: {
210
+ backgroundColor: '#e0e2e7',
211
+ },
212
+ buttonText: {
213
+ color: 'white',
214
+ fontWeight: '600',
215
+ fontSize: 14,
216
+ },
217
+ bonusBadge: {
218
+ position: 'absolute',
219
+ top: 16,
220
+ left: -6,
221
+ paddingVertical: 8,
222
+ paddingHorizontal: 14,
223
+ borderTopRightRadius: 100,
224
+ borderTopLeftRadius: 10,
225
+ borderBottomRightRadius: 100,
226
+ shadowColor: 'black',
227
+ shadowOffset: { width: 0, height: 8 },
228
+ shadowOpacity: 0.3,
229
+ shadowRadius: 10,
230
+ backgroundColor: 'transparent',
231
+ },
232
+ trianlge: {
233
+ position: 'absolute',
234
+ top: 46.6,
235
+ left: -7.4,
236
+ zIndex: -10,
237
+ width: 20,
238
+ height: 10,
239
+ transform: [{ rotate: '65deg' }]
240
+ },
241
+ bonusText: {
242
+ color: 'white',
243
+ fontWeight: '700',
244
+ fontSize: 12,
245
+ },
246
+ });
247
+
248
+ export default AcmoOfferCard;