@tyrads.com/tyrads-sdk 1.1.15 → 2.0.0-beta.1

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 (158) hide show
  1. package/android/build.gradle +18 -2
  2. package/android/src/main/java/com/tyradssdk/TyradsSdkComposeViewManager.kt +112 -0
  3. package/android/src/main/java/com/tyradssdk/TyradsSdkModule.kt +21 -9
  4. package/android/src/main/java/com/tyradssdk/TyradsSdkPackage.kt +2 -1
  5. package/ios/Tyrads/Tyrads.swift +43 -18
  6. package/ios/TyradsSdk.mm +3 -1
  7. package/ios/TyradsSdk.swift +5 -4
  8. package/lib/commonjs/acmo/core/marquee.js +60 -0
  9. package/lib/commonjs/acmo/core/marquee.js.map +1 -0
  10. package/lib/commonjs/acmo/core/storage/storage.js +36 -0
  11. package/lib/commonjs/acmo/core/storage/storage.js.map +1 -0
  12. package/lib/commonjs/acmo/core/types/types.d.js +2 -0
  13. package/lib/commonjs/acmo/core/types/types.d.js.map +1 -0
  14. package/lib/commonjs/acmo/modules/dashboard/components/auto_scroller.js +87 -0
  15. package/lib/commonjs/acmo/modules/dashboard/components/auto_scroller.js.map +1 -0
  16. package/lib/commonjs/acmo/modules/dashboard/components/custom_card.js +41 -0
  17. package/lib/commonjs/acmo/modules/dashboard/components/custom_card.js.map +1 -0
  18. package/lib/commonjs/acmo/modules/dashboard/components/my_games_button.js +50 -0
  19. package/lib/commonjs/acmo/modules/dashboard/components/my_games_button.js.map +1 -0
  20. package/lib/commonjs/acmo/modules/dashboard/components/offer_info_section.js +163 -0
  21. package/lib/commonjs/acmo/modules/dashboard/components/offer_info_section.js.map +1 -0
  22. package/lib/commonjs/acmo/modules/dashboard/components/premium_header.js +103 -0
  23. package/lib/commonjs/acmo/modules/dashboard/components/premium_header.js.map +1 -0
  24. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_1.js +186 -0
  25. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_1.js.map +1 -0
  26. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_2.js +104 -0
  27. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_2.js.map +1 -0
  28. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_3.js +43 -0
  29. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_3.js.map +1 -0
  30. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_4.js +215 -0
  31. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_4.js.map +1 -0
  32. package/lib/commonjs/acmo/modules/dashboard/repository.js +71 -0
  33. package/lib/commonjs/acmo/modules/dashboard/repository.js.map +1 -0
  34. package/lib/commonjs/acmo/modules/dashboard/top_offers.js +137 -0
  35. package/lib/commonjs/acmo/modules/dashboard/top_offers.js.map +1 -0
  36. package/lib/commonjs/assets/images/premium_star.png +0 -0
  37. package/lib/commonjs/assets/images/right_arrow.png +0 -0
  38. package/lib/commonjs/assets/images/star_pointed.png +0 -0
  39. package/lib/commonjs/i18n.js +112 -0
  40. package/lib/commonjs/i18n.js.map +1 -0
  41. package/lib/commonjs/index.js +58 -1
  42. package/lib/commonjs/index.js.map +1 -1
  43. package/lib/module/acmo/core/marquee.js +54 -0
  44. package/lib/module/acmo/core/marquee.js.map +1 -0
  45. package/lib/module/acmo/core/storage/storage.js +29 -0
  46. package/lib/module/acmo/core/storage/storage.js.map +1 -0
  47. package/lib/module/acmo/core/types/types.d.js +2 -0
  48. package/lib/module/acmo/core/types/types.d.js.map +1 -0
  49. package/lib/module/acmo/modules/dashboard/components/auto_scroller.js +81 -0
  50. package/lib/module/acmo/modules/dashboard/components/auto_scroller.js.map +1 -0
  51. package/lib/module/acmo/modules/dashboard/components/custom_card.js +36 -0
  52. package/lib/module/acmo/modules/dashboard/components/custom_card.js.map +1 -0
  53. package/lib/module/acmo/modules/dashboard/components/my_games_button.js +45 -0
  54. package/lib/module/acmo/modules/dashboard/components/my_games_button.js.map +1 -0
  55. package/lib/module/acmo/modules/dashboard/components/offer_info_section.js +158 -0
  56. package/lib/module/acmo/modules/dashboard/components/offer_info_section.js.map +1 -0
  57. package/lib/module/acmo/modules/dashboard/components/premium_header.js +98 -0
  58. package/lib/module/acmo/modules/dashboard/components/premium_header.js.map +1 -0
  59. package/lib/module/acmo/modules/dashboard/components/premium_option_1.js +181 -0
  60. package/lib/module/acmo/modules/dashboard/components/premium_option_1.js.map +1 -0
  61. package/lib/module/acmo/modules/dashboard/components/premium_option_2.js +99 -0
  62. package/lib/module/acmo/modules/dashboard/components/premium_option_2.js.map +1 -0
  63. package/lib/module/acmo/modules/dashboard/components/premium_option_3.js +38 -0
  64. package/lib/module/acmo/modules/dashboard/components/premium_option_3.js.map +1 -0
  65. package/lib/module/acmo/modules/dashboard/components/premium_option_4.js +210 -0
  66. package/lib/module/acmo/modules/dashboard/components/premium_option_4.js.map +1 -0
  67. package/lib/module/acmo/modules/dashboard/repository.js +65 -0
  68. package/lib/module/acmo/modules/dashboard/repository.js.map +1 -0
  69. package/lib/module/acmo/modules/dashboard/top_offers.js +130 -0
  70. package/lib/module/acmo/modules/dashboard/top_offers.js.map +1 -0
  71. package/lib/module/assets/images/premium_star.png +0 -0
  72. package/lib/module/assets/images/right_arrow.png +0 -0
  73. package/lib/module/assets/images/star_pointed.png +0 -0
  74. package/lib/module/i18n.js +107 -0
  75. package/lib/module/i18n.js.map +1 -0
  76. package/lib/module/index.js +59 -2
  77. package/lib/module/index.js.map +1 -1
  78. package/lib/typescript/commonjs/src/acmo/core/marquee.d.ts +11 -0
  79. package/lib/typescript/commonjs/src/acmo/core/marquee.d.ts.map +1 -0
  80. package/lib/typescript/commonjs/src/acmo/core/storage/storage.d.ts +3 -0
  81. package/lib/typescript/commonjs/src/acmo/core/storage/storage.d.ts.map +1 -0
  82. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/auto_scroller.d.ts +10 -0
  83. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/auto_scroller.d.ts.map +1 -0
  84. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/custom_card.d.ts +9 -0
  85. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/custom_card.d.ts.map +1 -0
  86. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/my_games_button.d.ts +7 -0
  87. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/my_games_button.d.ts.map +1 -0
  88. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_info_section.d.ts +10 -0
  89. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_info_section.d.ts.map +1 -0
  90. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_header.d.ts +8 -0
  91. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_header.d.ts.map +1 -0
  92. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_1.d.ts +8 -0
  93. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_1.d.ts.map +1 -0
  94. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_2.d.ts +8 -0
  95. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_2.d.ts.map +1 -0
  96. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_3.d.ts +8 -0
  97. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_3.d.ts.map +1 -0
  98. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_4.d.ts +8 -0
  99. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_4.d.ts.map +1 -0
  100. package/lib/typescript/commonjs/src/acmo/modules/dashboard/repository.d.ts +2 -0
  101. package/lib/typescript/commonjs/src/acmo/modules/dashboard/repository.d.ts.map +1 -0
  102. package/lib/typescript/commonjs/src/acmo/modules/dashboard/top_offers.d.ts +10 -0
  103. package/lib/typescript/commonjs/src/acmo/modules/dashboard/top_offers.d.ts.map +1 -0
  104. package/lib/typescript/commonjs/src/i18n.d.ts +3 -0
  105. package/lib/typescript/commonjs/src/i18n.d.ts.map +1 -0
  106. package/lib/typescript/commonjs/src/index.d.ts +15 -1
  107. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  108. package/lib/typescript/module/src/acmo/core/marquee.d.ts +11 -0
  109. package/lib/typescript/module/src/acmo/core/marquee.d.ts.map +1 -0
  110. package/lib/typescript/module/src/acmo/core/storage/storage.d.ts +3 -0
  111. package/lib/typescript/module/src/acmo/core/storage/storage.d.ts.map +1 -0
  112. package/lib/typescript/module/src/acmo/modules/dashboard/components/auto_scroller.d.ts +10 -0
  113. package/lib/typescript/module/src/acmo/modules/dashboard/components/auto_scroller.d.ts.map +1 -0
  114. package/lib/typescript/module/src/acmo/modules/dashboard/components/custom_card.d.ts +9 -0
  115. package/lib/typescript/module/src/acmo/modules/dashboard/components/custom_card.d.ts.map +1 -0
  116. package/lib/typescript/module/src/acmo/modules/dashboard/components/my_games_button.d.ts +7 -0
  117. package/lib/typescript/module/src/acmo/modules/dashboard/components/my_games_button.d.ts.map +1 -0
  118. package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_info_section.d.ts +10 -0
  119. package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_info_section.d.ts.map +1 -0
  120. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_header.d.ts +8 -0
  121. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_header.d.ts.map +1 -0
  122. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_1.d.ts +8 -0
  123. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_1.d.ts.map +1 -0
  124. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_2.d.ts +8 -0
  125. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_2.d.ts.map +1 -0
  126. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_3.d.ts +8 -0
  127. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_3.d.ts.map +1 -0
  128. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_4.d.ts +8 -0
  129. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_4.d.ts.map +1 -0
  130. package/lib/typescript/module/src/acmo/modules/dashboard/repository.d.ts +2 -0
  131. package/lib/typescript/module/src/acmo/modules/dashboard/repository.d.ts.map +1 -0
  132. package/lib/typescript/module/src/acmo/modules/dashboard/top_offers.d.ts +10 -0
  133. package/lib/typescript/module/src/acmo/modules/dashboard/top_offers.d.ts.map +1 -0
  134. package/lib/typescript/module/src/i18n.d.ts +3 -0
  135. package/lib/typescript/module/src/i18n.d.ts.map +1 -0
  136. package/lib/typescript/module/src/index.d.ts +15 -1
  137. package/lib/typescript/module/src/index.d.ts.map +1 -1
  138. package/package.json +12 -1
  139. package/readme.md +71 -0
  140. package/src/acmo/core/marquee.tsx +62 -0
  141. package/src/acmo/core/storage/storage.ts +28 -0
  142. package/src/acmo/core/types/types.d.ts +94 -0
  143. package/src/acmo/modules/dashboard/components/auto_scroller.tsx +85 -0
  144. package/src/acmo/modules/dashboard/components/custom_card.tsx +31 -0
  145. package/src/acmo/modules/dashboard/components/my_games_button.tsx +40 -0
  146. package/src/acmo/modules/dashboard/components/offer_info_section.tsx +144 -0
  147. package/src/acmo/modules/dashboard/components/premium_header.tsx +81 -0
  148. package/src/acmo/modules/dashboard/components/premium_option_1.tsx +161 -0
  149. package/src/acmo/modules/dashboard/components/premium_option_2.tsx +104 -0
  150. package/src/acmo/modules/dashboard/components/premium_option_3.tsx +46 -0
  151. package/src/acmo/modules/dashboard/components/premium_option_4.tsx +184 -0
  152. package/src/acmo/modules/dashboard/repository.ts +95 -0
  153. package/src/acmo/modules/dashboard/top_offers.tsx +131 -0
  154. package/src/assets/images/premium_star.png +0 -0
  155. package/src/assets/images/right_arrow.png +0 -0
  156. package/src/assets/images/star_pointed.png +0 -0
  157. package/src/i18n.ts +115 -0
  158. package/src/index.tsx +64 -2
@@ -0,0 +1,144 @@
1
+ import React from 'react';
2
+ import { Dimensions, Image, StyleSheet, Text, TouchableOpacity, View, type ViewStyle,} from "react-native";
3
+ import numeral from 'numeral';
4
+ import TextTicker from "react-native-text-ticker";
5
+ import Tyrads from "../../../..";
6
+ import { useTranslation } from "react-i18next";
7
+
8
+ const { width } = Dimensions.get('window');
9
+
10
+ interface OfferInfoSectionProps {
11
+ details: TransformedCampaign;
12
+ premiumColor?: string;
13
+ style?: ViewStyle;
14
+ }
15
+
16
+ const OfferInfoSection: React.FC<OfferInfoSectionProps> = ({ details, premiumColor, style }) => {
17
+ const { t } = useTranslation();
18
+
19
+ return (
20
+ <View style={[styles.infoContainer, style, { backgroundColor: premiumColor || '#1C90DF' }]}>
21
+ <View style={styles.infoRow}>
22
+ <View style={styles.leftInfo}>
23
+ <Image
24
+ style={styles.gameIcon}
25
+ source={{ uri: details.thumbnail }}
26
+ resizeMode="cover"
27
+ />
28
+ <View style={styles.gameDetails}>
29
+ {details.title.length > 20 ? (
30
+ <View style={{ overflow: 'hidden' }}>
31
+ <TextTicker
32
+ style={styles.gameTitle}
33
+ duration={3000}
34
+ loop
35
+ bounce
36
+ repeatSpacer={50}
37
+ marqueeDelay={1000}
38
+ >
39
+ {details.title}
40
+ </TextTicker>
41
+ </View>
42
+ ) : (
43
+ <Text style={styles.gameTitle} numberOfLines={1} ellipsizeMode="tail">
44
+ {details.title}
45
+ </Text>
46
+ )}
47
+
48
+ <View style={styles.rewardDetails}>
49
+ <Image
50
+ source={{ uri: details.currency.adUnitCurrencyIcon }}
51
+ resizeMode="contain"
52
+ style={styles.coinIcon}
53
+ />
54
+ <Text style={styles.points}>{numeral(details.points).format("0.00a").toUpperCase()}</Text>
55
+ <Text style={styles.points}>{''}{details.currency.adUnitCurrencyName}</Text>
56
+ <Text style={styles.rewards}>
57
+ {' '}
58
+ {details.rewards} {t('dashboard.rewards', { count: details.rewards })}
59
+ </Text>
60
+ </View>
61
+ </View>
62
+ </View>
63
+ <TouchableOpacity
64
+ onPress={() => {
65
+ Tyrads.showOffers({
66
+ route: 'campaign-details',
67
+ campaignID: details.campaignId
68
+ })
69
+ }}
70
+ style={styles.playButton}
71
+ >
72
+ <Text style={[styles.playButtonText, { color: premiumColor || '#1C90DF' }]}>
73
+ {t('dashboard.play_button')}
74
+ </Text>
75
+ </TouchableOpacity>
76
+ </View>
77
+ </View>
78
+ );
79
+ };
80
+
81
+ const styles = StyleSheet.create({
82
+ infoContainer: {
83
+ width: width,
84
+ paddingVertical: 8,
85
+ paddingHorizontal: 16,
86
+ },
87
+ infoRow: {
88
+ flexDirection: 'row',
89
+ justifyContent: 'space-between',
90
+ alignItems: 'center',
91
+ width: '90%',
92
+ },
93
+ leftInfo: {
94
+ flexDirection: 'row',
95
+ alignItems: 'center',
96
+ width: '68%',
97
+ },
98
+ gameIcon: {
99
+ width: 50,
100
+ height: 50,
101
+ borderRadius: 8,
102
+ },
103
+ gameDetails: {
104
+ marginLeft: 10,
105
+ },
106
+ gameTitle: {
107
+ color: 'white',
108
+ fontSize: 14,
109
+ marginBottom: 4,
110
+ },
111
+ rewardDetails: {
112
+ flexDirection: 'row',
113
+ marginTop: 4,
114
+ },
115
+ coinIcon: {
116
+ width: 18,
117
+ height: 18,
118
+ },
119
+ points: {
120
+ color: 'white',
121
+ fontSize: 12,
122
+ marginLeft: 4,
123
+ },
124
+ rewards: {
125
+ color: 'lightgrey',
126
+ fontSize: 11,
127
+ fontStyle: 'italic',
128
+ },
129
+ playButton: {
130
+ paddingHorizontal: 12,
131
+ paddingVertical: 2,
132
+ height: 30,
133
+ borderRadius: 8,
134
+ backgroundColor: 'white',
135
+ alignItems: 'center',
136
+ justifyContent: 'center',
137
+ },
138
+ playButtonText: {
139
+ fontSize: 14,
140
+ fontWeight: 'bold',
141
+ },
142
+ });
143
+
144
+ export default OfferInfoSection;
@@ -0,0 +1,81 @@
1
+ import React from 'react';
2
+ import { View, Text, Image, TouchableOpacity, StyleSheet,} from 'react-native';
3
+ import Tyrads from '../../../..';
4
+ import { useTranslation } from 'react-i18next';
5
+
6
+ interface PremiumHeaderSectionProps {
7
+ showMore?: boolean;
8
+ premiumColor?: string;
9
+ }
10
+
11
+ const PremiumHeaderSection: React.FC<PremiumHeaderSectionProps> = ({ showMore = true, premiumColor }) => {
12
+ const { t } = useTranslation();
13
+ return (
14
+ <View style={styles.headerContainer}>
15
+ <View style={styles.leftContainer}>
16
+ <View style={[styles.starContainer, { backgroundColor: premiumColor || '#1C90DF' }]}>
17
+ <Image
18
+ source={require('../../../../assets/images/star_pointed.png')}
19
+ style={[styles.starIcon, { tintColor: 'white' }]}
20
+ />
21
+ </View>
22
+ <Text style={styles.headerText} numberOfLines={1} adjustsFontSizeToFit ellipsizeMode="tail">
23
+ {t('dashboard.suggested_offers')}
24
+ </Text>
25
+ </View>
26
+ {showMore && (
27
+ <TouchableOpacity style={styles.rightContainer} onPress={() => Tyrads.showOffers()}>
28
+ <Text style={[styles.moreOffersText, { color: premiumColor }]} numberOfLines={1}>
29
+ {t('dashboard.more_offers')}
30
+ </Text>
31
+ <Image
32
+ source={require('../../../../assets/images/right_arrow.png')}
33
+ style={{ width: 11, height: 11, objectFit: 'contain', marginLeft: 5, tintColor: premiumColor || "#1C90DF" }}
34
+ />
35
+ </TouchableOpacity>
36
+ )}
37
+ </View>
38
+ );
39
+ };
40
+
41
+ const styles = StyleSheet.create({
42
+ starContainer: {
43
+ borderRadius: 25,
44
+ height: 19,
45
+ width: 19,
46
+ justifyContent: 'center',
47
+ alignItems: 'center',
48
+ },
49
+ headerContainer: {
50
+ flexDirection: 'row',
51
+ justifyContent: 'space-between',
52
+ alignItems: 'center',
53
+ paddingHorizontal: 16,
54
+ paddingVertical: 6,
55
+ },
56
+ leftContainer: {
57
+ flexDirection: 'row',
58
+ alignItems: 'center',
59
+ flex: 1,
60
+ },
61
+ starIcon: {
62
+ width: 12,
63
+ height: 12,
64
+ },
65
+ headerText: {
66
+ marginLeft: 8,
67
+ fontSize: 16,
68
+ fontWeight: 'bold',
69
+ flex: 1,
70
+ },
71
+ rightContainer: {
72
+ flexDirection: 'row',
73
+ alignItems: 'center',
74
+ },
75
+ moreOffersText: {
76
+ fontSize: 14,
77
+ fontWeight: 'bold',
78
+ },
79
+ });
80
+
81
+ export default PremiumHeaderSection;
@@ -0,0 +1,161 @@
1
+ import React from 'react';
2
+ import numeral from 'numeral';
3
+ import {
4
+ View,
5
+ Text,
6
+ Image,
7
+ TouchableOpacity,
8
+ StyleSheet,
9
+ } from 'react-native';
10
+ import TextTicker from 'react-native-text-ticker';
11
+ import Tyrads from '../../../../index';
12
+ import { useTranslation } from 'react-i18next';
13
+
14
+ interface PremiumOption1Props {
15
+ data: TransformedCampaign[];
16
+ premiumColor?: string;
17
+ }
18
+
19
+ const PremiumOption1: React.FC<PremiumOption1Props> = ({ data, premiumColor }) => {
20
+ const { t } = useTranslation();
21
+ console.log("Prmium Color", premiumColor);
22
+
23
+ return (
24
+ <View>
25
+ {data.map((item, index) => (
26
+ <TouchableOpacity
27
+ key={index}
28
+ onPress={() => {
29
+ Tyrads.showOffers({
30
+ route: "campaign-details",
31
+ campaignID: item.campaignId,
32
+ });
33
+ }}
34
+ style={styles.itemContainer}
35
+ activeOpacity={0.75}
36
+ >
37
+ <View style={{ flexDirection: 'row', flex: 8, marginRight: 10 }}>
38
+ <Image source={{ uri: item.thumbnail }} style={styles.thumbnail} />
39
+ <View style={styles.infoContainer}>
40
+ <View style={{ width: '100%' }}>
41
+ {item.title.length > 25 ? (
42
+ <View style={{ overflow: 'hidden' }}>
43
+ <TextTicker
44
+ style={styles.titleText}
45
+ duration={3000}
46
+ loop
47
+ bounce
48
+ repeatSpacer={50}
49
+ marqueeDelay={1000}
50
+ >
51
+ {item.title}
52
+ </TextTicker>
53
+ </View>
54
+ ) : (
55
+ <Text numberOfLines={1} style={styles.titleText}>
56
+ {item.title}
57
+ </Text>
58
+ )}
59
+ </View>
60
+ <View style={styles.infoRow}>
61
+ <View style={[styles.rankContainer, { backgroundColor: premiumColor || '#1C90DF' }]}>
62
+ <Text numberOfLines={1} style={styles.rankText} adjustsFontSizeToFit={true}>
63
+ {t('dashboard.top_ranking', { number: index + 1 })}
64
+ </Text>
65
+ </View>
66
+ <View style={styles.rewardDetails}>
67
+ <Image
68
+ source={{ uri: item.currency.adUnitCurrencyIcon }}
69
+ resizeMode="contain"
70
+ style={styles.coinIcon}
71
+ />
72
+ <Text style={styles.points}>{numeral(item.points).format("0.00a").toUpperCase()}</Text>
73
+ <Text style={styles.points}>{''}{item.currency.adUnitCurrencyName}</Text>
74
+ </View>
75
+ </View>
76
+ </View>
77
+ </View>
78
+ <View style={[styles.playButton, { backgroundColor: premiumColor || '#1C90DF' }]}>
79
+ <Text style={styles.playButtonText}>{t('dashboard.play_button')}</Text>
80
+ </View>
81
+ </TouchableOpacity>
82
+ ))}
83
+ </View>
84
+ );
85
+ };
86
+
87
+ const styles = StyleSheet.create({
88
+ itemContainer: {
89
+ flexDirection: 'row',
90
+ flex: 1,
91
+ width: '100%',
92
+ justifyContent: 'space-between',
93
+ alignItems: 'center',
94
+ paddingHorizontal: 16,
95
+ paddingVertical: 8,
96
+ },
97
+ thumbnail: {
98
+ height: 40,
99
+ width: 40,
100
+ borderRadius: 10,
101
+ },
102
+ infoContainer: {
103
+ marginLeft: 8,
104
+ },
105
+ titleText: {
106
+ fontSize: 14,
107
+ fontWeight: 'bold',
108
+ },
109
+ infoRow: {
110
+ flexDirection: 'row',
111
+ alignItems: 'center',
112
+ alignContent: 'center',
113
+ },
114
+ rankContainer: {
115
+ marginTop: 4,
116
+ borderRadius: 12,
117
+ paddingHorizontal: 4,
118
+ paddingVertical: 2,
119
+ width: 43,
120
+ alignItems: 'center',
121
+ },
122
+ rankText: {
123
+ fontSize: 10,
124
+ color: 'white',
125
+ fontWeight: 'bold',
126
+ },
127
+ rewardDetails: {
128
+ flexDirection: 'row',
129
+ alignItems: 'center',
130
+ marginTop: 4,
131
+ left: 4,
132
+ },
133
+ coinIcon: {
134
+ width: 14,
135
+ height: 14,
136
+ },
137
+ points: {
138
+ fontSize: 13,
139
+ marginLeft: 4,
140
+ fontWeight: '500',
141
+ },
142
+ rewards: {
143
+ fontSize: 10,
144
+ fontStyle: 'italic',
145
+ },
146
+ playButton: {
147
+ paddingHorizontal: 12,
148
+ paddingVertical: 5,
149
+ height: 30,
150
+ borderRadius: 8,
151
+ alignItems: 'center',
152
+ justifyContent: 'center',
153
+ },
154
+ playButtonText: {
155
+ fontSize: 14,
156
+ fontWeight: 'bold',
157
+ color: 'white',
158
+ },
159
+ });
160
+
161
+ export default PremiumOption1;
@@ -0,0 +1,104 @@
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
+ import Tyrads from '../../../..';
13
+
14
+ const { width } = Dimensions.get('window');
15
+
16
+ interface PremiumOption2Props {
17
+ data: TransformedCampaign[];
18
+ premiumColor?: string;
19
+ }
20
+
21
+ const PremiumOption2: React.FC<PremiumOption2Props> = ({ data, premiumColor }) => {
22
+ return (
23
+ <AutoScrollPagerWithIndicators
24
+ totalPages={data.length}
25
+ premiumColor={premiumColor}
26
+ content={(page) => (
27
+ <TouchableOpacity
28
+ key={page}
29
+ onPress={() =>
30
+ Tyrads.showOffers({
31
+ route: 'campaign-details',
32
+ campaignID: data[page]?.campaignId,
33
+ })
34
+ }
35
+ activeOpacity={0.8}
36
+ >
37
+ {data[page] && (
38
+ <>
39
+ <OfferBanner details={data[page]} index={page} premiumColor={premiumColor} />
40
+ <OfferInfoSection details={data[page]} premiumColor={premiumColor} />
41
+ </>
42
+ )}
43
+ </TouchableOpacity>
44
+ )}
45
+ />
46
+ );
47
+ };
48
+
49
+ interface OfferBannerProps {
50
+ details: TransformedCampaign;
51
+ index: number;
52
+ premiumColor?: string;
53
+ }
54
+
55
+ const OfferBanner: React.FC<OfferBannerProps> = ({ details, index, premiumColor }) => {
56
+ return (
57
+ <View style={styles.bannerContainer}>
58
+ <Image style={styles.bannerImage} source={{ uri: details.fileUrl }} resizeMode="cover" />
59
+ <View style={styles.starContainer}>
60
+ <Image
61
+ source={require('../../../../assets/images/premium_star.png')}
62
+ style={[styles.starIcon, { tintColor: premiumColor || '#1C90DF' }]}
63
+ />
64
+ <Text style={styles.index} numberOfLines={1} ellipsizeMode="tail">
65
+ {index + 1}
66
+ </Text>
67
+ </View>
68
+ </View>
69
+ );
70
+ };
71
+
72
+ const styles = StyleSheet.create({
73
+ bannerContainer: {
74
+ width: width,
75
+ height: 180,
76
+ },
77
+ bannerImage: {
78
+ flex: 1,
79
+ },
80
+ starContainer: {
81
+ position: 'absolute',
82
+ top: 10,
83
+ left: 10,
84
+ backgroundColor: 'rgba(0,0,0,0)',
85
+ },
86
+ starIcon: {
87
+ width: 30,
88
+ height: 30,
89
+ },
90
+ index: {
91
+ position: 'absolute',
92
+ top: 0,
93
+ left: 0,
94
+ right: 0,
95
+ bottom: 0,
96
+ textAlign: 'center',
97
+ textAlignVertical: 'center',
98
+ color: 'white',
99
+ fontSize: 14,
100
+ fontWeight: 'bold',
101
+ },
102
+ });
103
+
104
+ export default PremiumOption2;
@@ -0,0 +1,46 @@
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
+ import Tyrads from "../../../..";
6
+
7
+ interface PremiumOption3Props {
8
+ data: TransformedCampaign[];
9
+ premiumColor?: string;
10
+ }
11
+
12
+ const PremiumOption3: React.FC<PremiumOption3Props> = ({ data, 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={() =>
23
+ Tyrads.showOffers({
24
+ route: 'campaign-details',
25
+ campaignID: data[page]?.campaignId,
26
+ })
27
+ }
28
+ >
29
+ <View>
30
+ {
31
+ data[page] && (
32
+ <OfferInfoSection
33
+ details={data[page]}
34
+ premiumColor={premiumColor}
35
+ style={{ paddingVertical: 23 }}
36
+ />
37
+ )
38
+ }
39
+ </View>
40
+ </TouchableOpacity>
41
+ )}
42
+ />
43
+ );
44
+ };
45
+
46
+ export default PremiumOption3;