@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.
- package/android/build.gradle +18 -2
- package/android/src/main/java/com/tyradssdk/TyradsSdkComposeViewManager.kt +112 -0
- package/android/src/main/java/com/tyradssdk/TyradsSdkModule.kt +21 -9
- package/android/src/main/java/com/tyradssdk/TyradsSdkPackage.kt +2 -1
- package/ios/Tyrads/Tyrads.swift +43 -18
- package/ios/TyradsSdk.mm +3 -1
- package/ios/TyradsSdk.swift +5 -4
- package/lib/commonjs/acmo/core/marquee.js +60 -0
- package/lib/commonjs/acmo/core/marquee.js.map +1 -0
- package/lib/commonjs/acmo/core/storage/storage.js +36 -0
- package/lib/commonjs/acmo/core/storage/storage.js.map +1 -0
- package/lib/commonjs/acmo/core/types/types.d.js +2 -0
- package/lib/commonjs/acmo/core/types/types.d.js.map +1 -0
- package/lib/commonjs/acmo/modules/dashboard/components/auto_scroller.js +87 -0
- package/lib/commonjs/acmo/modules/dashboard/components/auto_scroller.js.map +1 -0
- package/lib/commonjs/acmo/modules/dashboard/components/custom_card.js +41 -0
- package/lib/commonjs/acmo/modules/dashboard/components/custom_card.js.map +1 -0
- package/lib/commonjs/acmo/modules/dashboard/components/my_games_button.js +50 -0
- package/lib/commonjs/acmo/modules/dashboard/components/my_games_button.js.map +1 -0
- package/lib/commonjs/acmo/modules/dashboard/components/offer_info_section.js +163 -0
- package/lib/commonjs/acmo/modules/dashboard/components/offer_info_section.js.map +1 -0
- package/lib/commonjs/acmo/modules/dashboard/components/premium_header.js +103 -0
- package/lib/commonjs/acmo/modules/dashboard/components/premium_header.js.map +1 -0
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_1.js +186 -0
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_1.js.map +1 -0
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_2.js +104 -0
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_2.js.map +1 -0
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_3.js +43 -0
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_3.js.map +1 -0
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_4.js +215 -0
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_4.js.map +1 -0
- package/lib/commonjs/acmo/modules/dashboard/repository.js +71 -0
- package/lib/commonjs/acmo/modules/dashboard/repository.js.map +1 -0
- package/lib/commonjs/acmo/modules/dashboard/top_offers.js +137 -0
- package/lib/commonjs/acmo/modules/dashboard/top_offers.js.map +1 -0
- package/lib/commonjs/assets/images/premium_star.png +0 -0
- package/lib/commonjs/assets/images/right_arrow.png +0 -0
- package/lib/commonjs/assets/images/star_pointed.png +0 -0
- package/lib/commonjs/i18n.js +112 -0
- package/lib/commonjs/i18n.js.map +1 -0
- package/lib/commonjs/index.js +58 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/acmo/core/marquee.js +54 -0
- package/lib/module/acmo/core/marquee.js.map +1 -0
- package/lib/module/acmo/core/storage/storage.js +29 -0
- package/lib/module/acmo/core/storage/storage.js.map +1 -0
- package/lib/module/acmo/core/types/types.d.js +2 -0
- package/lib/module/acmo/core/types/types.d.js.map +1 -0
- package/lib/module/acmo/modules/dashboard/components/auto_scroller.js +81 -0
- package/lib/module/acmo/modules/dashboard/components/auto_scroller.js.map +1 -0
- package/lib/module/acmo/modules/dashboard/components/custom_card.js +36 -0
- package/lib/module/acmo/modules/dashboard/components/custom_card.js.map +1 -0
- package/lib/module/acmo/modules/dashboard/components/my_games_button.js +45 -0
- package/lib/module/acmo/modules/dashboard/components/my_games_button.js.map +1 -0
- package/lib/module/acmo/modules/dashboard/components/offer_info_section.js +158 -0
- package/lib/module/acmo/modules/dashboard/components/offer_info_section.js.map +1 -0
- package/lib/module/acmo/modules/dashboard/components/premium_header.js +98 -0
- package/lib/module/acmo/modules/dashboard/components/premium_header.js.map +1 -0
- package/lib/module/acmo/modules/dashboard/components/premium_option_1.js +181 -0
- package/lib/module/acmo/modules/dashboard/components/premium_option_1.js.map +1 -0
- package/lib/module/acmo/modules/dashboard/components/premium_option_2.js +99 -0
- package/lib/module/acmo/modules/dashboard/components/premium_option_2.js.map +1 -0
- package/lib/module/acmo/modules/dashboard/components/premium_option_3.js +38 -0
- package/lib/module/acmo/modules/dashboard/components/premium_option_3.js.map +1 -0
- package/lib/module/acmo/modules/dashboard/components/premium_option_4.js +210 -0
- package/lib/module/acmo/modules/dashboard/components/premium_option_4.js.map +1 -0
- package/lib/module/acmo/modules/dashboard/repository.js +65 -0
- package/lib/module/acmo/modules/dashboard/repository.js.map +1 -0
- package/lib/module/acmo/modules/dashboard/top_offers.js +130 -0
- package/lib/module/acmo/modules/dashboard/top_offers.js.map +1 -0
- package/lib/module/assets/images/premium_star.png +0 -0
- package/lib/module/assets/images/right_arrow.png +0 -0
- package/lib/module/assets/images/star_pointed.png +0 -0
- package/lib/module/i18n.js +107 -0
- package/lib/module/i18n.js.map +1 -0
- package/lib/module/index.js +59 -2
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/commonjs/src/acmo/core/marquee.d.ts +11 -0
- package/lib/typescript/commonjs/src/acmo/core/marquee.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/core/storage/storage.d.ts +3 -0
- package/lib/typescript/commonjs/src/acmo/core/storage/storage.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/auto_scroller.d.ts +10 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/auto_scroller.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/custom_card.d.ts +9 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/custom_card.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/my_games_button.d.ts +7 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/my_games_button.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_info_section.d.ts +10 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_info_section.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_header.d.ts +8 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_header.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_1.d.ts +8 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_1.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_2.d.ts +8 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_2.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_3.d.ts +8 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_3.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_4.d.ts +8 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_4.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/repository.d.ts +2 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/repository.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/top_offers.d.ts +10 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/top_offers.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/i18n.d.ts +3 -0
- package/lib/typescript/commonjs/src/i18n.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +15 -1
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/core/marquee.d.ts +11 -0
- package/lib/typescript/module/src/acmo/core/marquee.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/core/storage/storage.d.ts +3 -0
- package/lib/typescript/module/src/acmo/core/storage/storage.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/auto_scroller.d.ts +10 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/auto_scroller.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/custom_card.d.ts +9 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/custom_card.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/my_games_button.d.ts +7 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/my_games_button.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_info_section.d.ts +10 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_info_section.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_header.d.ts +8 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_header.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_1.d.ts +8 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_1.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_2.d.ts +8 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_2.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_3.d.ts +8 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_3.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_4.d.ts +8 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_4.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/repository.d.ts +2 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/repository.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/top_offers.d.ts +10 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/top_offers.d.ts.map +1 -0
- package/lib/typescript/module/src/i18n.d.ts +3 -0
- package/lib/typescript/module/src/i18n.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +15 -1
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/package.json +12 -1
- package/readme.md +71 -0
- package/src/acmo/core/marquee.tsx +62 -0
- package/src/acmo/core/storage/storage.ts +28 -0
- package/src/acmo/core/types/types.d.ts +94 -0
- package/src/acmo/modules/dashboard/components/auto_scroller.tsx +85 -0
- package/src/acmo/modules/dashboard/components/custom_card.tsx +31 -0
- package/src/acmo/modules/dashboard/components/my_games_button.tsx +40 -0
- package/src/acmo/modules/dashboard/components/offer_info_section.tsx +144 -0
- package/src/acmo/modules/dashboard/components/premium_header.tsx +81 -0
- package/src/acmo/modules/dashboard/components/premium_option_1.tsx +161 -0
- package/src/acmo/modules/dashboard/components/premium_option_2.tsx +104 -0
- package/src/acmo/modules/dashboard/components/premium_option_3.tsx +46 -0
- package/src/acmo/modules/dashboard/components/premium_option_4.tsx +184 -0
- package/src/acmo/modules/dashboard/repository.ts +95 -0
- package/src/acmo/modules/dashboard/top_offers.tsx +131 -0
- package/src/assets/images/premium_star.png +0 -0
- package/src/assets/images/right_arrow.png +0 -0
- package/src/assets/images/star_pointed.png +0 -0
- package/src/i18n.ts +115 -0
- 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;
|