@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,100 +0,0 @@
1
- import React from 'react';
2
- import {
3
- View,
4
- Text,
5
- Image,
6
- StyleSheet,
7
- Dimensions,
8
- TouchableOpacity,
9
- } from 'react-native';
10
- import AutoScrollPagerWithIndicators from './auto_scroller';
11
- import OfferInfoSection from './offer_info_section';
12
-
13
- const { width } = Dimensions.get('window');
14
-
15
- interface PremiumOption2Props {
16
- data: TransformedCampaign[];
17
- premiumColor?: string;
18
- onCampaignPress?: (campaignId: number) => void;
19
- }
20
-
21
- const PremiumOption2: React.FC<PremiumOption2Props> = ({ data, onCampaignPress, premiumColor }) => {
22
- return (
23
- <AutoScrollPagerWithIndicators
24
- totalPages={data.length}
25
- premiumColor={premiumColor}
26
- content={(page) => (
27
- <TouchableOpacity
28
- key={page}
29
- onPress={() => onCampaignPress && onCampaignPress(data[page]?.campaignId ?? 0)
30
- }
31
- activeOpacity={0.8}
32
- >
33
- {data[page] && (
34
- <>
35
- <OfferBanner details={data[page]} index={page} premiumColor={premiumColor} />
36
- <OfferInfoSection details={data[page]} premiumColor={premiumColor} onButtonPress={() => onCampaignPress && onCampaignPress(data[page]?.campaignId ?? 0)}/>
37
- </>
38
- )}
39
- </TouchableOpacity>
40
- )}
41
- />
42
- );
43
- };
44
-
45
- interface OfferBannerProps {
46
- details: TransformedCampaign;
47
- index: number;
48
- premiumColor?: string;
49
- }
50
-
51
- const OfferBanner: React.FC<OfferBannerProps> = ({ details, index, premiumColor }) => {
52
- return (
53
- <View style={styles.bannerContainer}>
54
- <Image style={styles.bannerImage} source={{ uri: details.fileUrl }} resizeMode="cover" />
55
- <View style={styles.starContainer}>
56
- <Image
57
- source={require('../../../../assets/images/premium_star.png')}
58
- style={[styles.starIcon, { tintColor: premiumColor || '#1C90DF' }]}
59
- />
60
- <Text style={styles.index} numberOfLines={1} ellipsizeMode="tail">
61
- {index + 1}
62
- </Text>
63
- </View>
64
- </View>
65
- );
66
- };
67
-
68
- const styles = StyleSheet.create({
69
- bannerContainer: {
70
- width: width,
71
- height: 180,
72
- },
73
- bannerImage: {
74
- flex: 1,
75
- },
76
- starContainer: {
77
- position: 'absolute',
78
- top: 10,
79
- left: 10,
80
- backgroundColor: 'rgba(0,0,0,0)',
81
- },
82
- starIcon: {
83
- width: 30,
84
- height: 30,
85
- },
86
- index: {
87
- position: 'absolute',
88
- top: 0,
89
- left: 0,
90
- right: 0,
91
- bottom: 0,
92
- textAlign: 'center',
93
- textAlignVertical: 'center',
94
- color: 'white',
95
- fontSize: 14,
96
- fontWeight: 'bold',
97
- },
98
- });
99
-
100
- export default PremiumOption2;
@@ -1,42 +0,0 @@
1
- import React from 'react';
2
- import { TouchableOpacity, View, } from 'react-native';
3
- import AutoScrollPagerWithIndicators from './auto_scroller';
4
- import OfferInfoSection from './offer_info_section';
5
-
6
- interface PremiumOption3Props {
7
- data: TransformedCampaign[];
8
- premiumColor?: string;
9
- onCampaignPress?: (campaignId: number) => void;
10
- }
11
-
12
- const PremiumOption3: React.FC<PremiumOption3Props> = ({ data, onCampaignPress, premiumColor }) => {
13
- return (
14
- <AutoScrollPagerWithIndicators
15
- totalPages={data.length}
16
- premiumColor={premiumColor}
17
- content={(page) => (
18
- <TouchableOpacity
19
- key={page}
20
- style={{ flex: 1 }}
21
- activeOpacity={0.8}
22
- onPress={() => onCampaignPress && onCampaignPress(data[page]?.campaignId ?? 0)}
23
- >
24
- <View>
25
- {
26
- data[page] && (
27
- <OfferInfoSection
28
- details={data[page]}
29
- premiumColor={premiumColor}
30
- style={{ paddingVertical: 23 }}
31
- onButtonPress={() => onCampaignPress && onCampaignPress(data[page]?.campaignId ?? 0)}
32
- />
33
- )
34
- }
35
- </View>
36
- </TouchableOpacity>
37
- )}
38
- />
39
- );
40
- };
41
-
42
- export default PremiumOption3;
@@ -1,185 +0,0 @@
1
- import React from 'react';
2
- import {
3
- View,
4
- Text,
5
- Image,
6
- StyleSheet,
7
- Dimensions,
8
- TouchableOpacity,
9
- } from 'react-native';
10
- import AutoScrollPagerWithIndicators from './auto_scroller';
11
- import numeral from 'numeral';
12
- import { useTranslation } from 'react-i18next';
13
-
14
- const { width } = Dimensions.get('window');
15
-
16
- interface PremiumOption4Props {
17
- data: TransformedCampaign[];
18
- premiumColor?: string;
19
- onCampaignPress?: (campaignId: number) => void;
20
- }
21
-
22
- const PremiumOption4: React.FC<PremiumOption4Props> = ({ data, onCampaignPress, premiumColor }) => {
23
- return (
24
- <AutoScrollPagerWithIndicators
25
- totalPages={data.length}
26
- premiumColor={premiumColor}
27
- content={(page) => (
28
- <View key={page}>
29
- {
30
- data[page] && (
31
- <OfferBanner details={data[page]} index={page} premiumColor={premiumColor} onCampaignPress={onCampaignPress} />
32
- )
33
- }
34
- </View>
35
- )}
36
- />
37
- );
38
- };
39
-
40
- interface OfferBannerProps {
41
- details: TransformedCampaign;
42
- index: number;
43
- onCampaignPress?: (campaignId: number) => void;
44
- premiumColor?: string;
45
- }
46
-
47
- const OfferBanner: React.FC<OfferBannerProps> = ({ details, index, onCampaignPress, premiumColor }) => {
48
- const { t } = useTranslation();
49
- return (
50
- <View style={styles.outerContainer}>
51
- <View style={styles.bannerContainer}>
52
- <Image style={styles.bannerImage} source={{ uri: details.fileUrl }} resizeMode="cover" />
53
-
54
- <View style={styles.starContainer}>
55
- <Image
56
- source={require('../../../../assets/images/premium_star.png')}
57
- style={[styles.starIcon, { tintColor: premiumColor || '#1C90DF' }]}
58
- />
59
- <Text style={styles.index} numberOfLines={1} ellipsizeMode="tail">
60
- {index + 1}
61
- </Text>
62
- </View>
63
- </View>
64
- <View style={styles.titleContainer}>
65
- <View style={{ flexDirection: 'row', flex: 8, width: '70%' }}>
66
- <Image style={styles.gameIcon} source={{ uri: details.thumbnail }} resizeMode="cover" />
67
- <View style={{ marginLeft: 10 }}>
68
- <Text style={styles.titleText}>{details.title}</Text>
69
- <View style={styles.rewardDetails}>
70
- <Image
71
- source={{ uri: details.currency.adUnitCurrencyIcon }}
72
- resizeMode="contain"
73
- style={styles.coinIcon}
74
- />
75
- <Text style={styles.points}>{numeral(details.points).format("0.00a").toUpperCase()}</Text>
76
- <Text style={styles.points}>{''}{details.currency.adUnitCurrencyName}</Text>
77
- <Text style={styles.rewards}>
78
- {' '}
79
- {details.rewards} {t('dashboard.rewards', { count: details.rewards })}
80
- </Text>
81
- </View>
82
- </View>
83
- </View>
84
- <TouchableOpacity
85
- onPress={() => onCampaignPress && onCampaignPress(details.campaignId)}
86
- style={[styles.playButton, { backgroundColor: premiumColor || '#1C90DF' }]}
87
- >
88
- <Text style={styles.playButtonText}>{t('dashboard.play_button')}</Text>
89
- </TouchableOpacity>
90
- </View>
91
- </View>
92
- );
93
- };
94
-
95
- const styles = StyleSheet.create({
96
- outerContainer: {},
97
- bannerContainer: {
98
- width: width,
99
- height: 190,
100
- },
101
- bannerImage: {
102
- flex: 1,
103
- borderRadius: 8,
104
- },
105
- starContainer: {
106
- position: 'absolute',
107
- top: 10,
108
- left: 10,
109
- backgroundColor: 'rgba(0,0,0,0)',
110
- },
111
- starIcon: {
112
- width: 30,
113
- height: 30,
114
- },
115
- index: {
116
- position: 'absolute',
117
- top: 0,
118
- left: 0,
119
- right: 0,
120
- bottom: 0,
121
- textAlign: 'center',
122
- textAlignVertical: 'center',
123
- color: 'white',
124
- fontSize: 14,
125
- fontWeight: 'bold',
126
- },
127
- titleContainer: {
128
- flex: 1,
129
- width: '91.5%',
130
- flexDirection: 'row',
131
- justifyContent: 'space-between',
132
- alignItems: 'center',
133
- padding: 8,
134
- backgroundColor: 'rgba(0,0,0,0.5)',
135
- position: 'absolute',
136
- bottom: 0,
137
- left: 0,
138
- right: 0,
139
- },
140
- titleText: {
141
- color: 'white',
142
- fontSize: 14,
143
- fontWeight: 'bold',
144
- marginBottom: 4,
145
- },
146
- gameIcon: {
147
- width: 35,
148
- height: 35,
149
- borderRadius: 8,
150
- },
151
- coinIcon: {
152
- width: 16,
153
- height: 16,
154
- },
155
- points: {
156
- fontSize: 12,
157
- marginLeft: 4,
158
- fontWeight: 'bold',
159
- color: 'white',
160
- },
161
- rewardDetails: {
162
- flexDirection: 'row',
163
- alignItems: 'center',
164
- },
165
- rewards: {
166
- fontSize: 10,
167
- fontStyle: 'italic',
168
- color: 'lightgray',
169
- },
170
- playButton: {
171
- paddingHorizontal: 12,
172
- paddingVertical: 2,
173
- height: 31,
174
- borderRadius: 8,
175
- alignItems: 'center',
176
- justifyContent: 'center',
177
- },
178
- playButtonText: {
179
- fontSize: 16,
180
- fontWeight: 'bold',
181
- color: 'white',
182
- },
183
- });
184
-
185
- export default PremiumOption4;