@tyrads.com/tyrads-sdk 2.0.0-beta.2 → 2.0.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.
- package/LICENSE +11 -11
- package/android/build.gradle +117 -117
- package/android/gradle.properties +5 -5
- package/android/src/main/AndroidManifest.xml +3 -3
- package/android/src/main/AndroidManifestNew.xml +2 -2
- package/android/src/main/java/com/tyradssdk/TyradsSdkComposeViewManager.kt +112 -112
- package/android/src/main/java/com/tyradssdk/TyradsSdkModule.kt +56 -56
- package/android/src/main/java/com/tyradssdk/TyradsSdkPackage.kt +18 -21
- package/ios/Tyrads/AcmoConfig.swift +32 -31
- package/ios/Tyrads/ApiHeaders.swift +12 -0
- package/ios/Tyrads/InitModel.swift +48 -46
- package/ios/Tyrads/Tyrads.swift +199 -176
- package/ios/TyradsSdk-Bridging-Header.h +2 -2
- package/ios/TyradsSdk.mm +14 -11
- package/ios/TyradsSdk.swift +47 -27
- package/lib/commonjs/acmo/core/marquee.js.map +1 -1
- package/lib/commonjs/acmo/core/storage/storage.js.map +1 -1
- package/lib/commonjs/acmo/core/types/types.d.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/components/auto_scroller.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/components/custom_card.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/components/my_games_button.js +3 -5
- package/lib/commonjs/acmo/modules/dashboard/components/my_games_button.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/components/offer_info_section.js +3 -8
- package/lib/commonjs/acmo/modules/dashboard/components/offer_info_section.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/components/premium_header.js +3 -3
- package/lib/commonjs/acmo/modules/dashboard/components/premium_header.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_1.js +2 -7
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_1.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_2.js +4 -6
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_2.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_3.js +4 -6
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_3.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_4.js +5 -6
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_4.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/repository.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/top_offers.js +23 -7
- package/lib/commonjs/acmo/modules/dashboard/top_offers.js.map +1 -1
- package/lib/commonjs/i18n.js.map +1 -1
- package/lib/commonjs/index.js +12 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/acmo/core/marquee.js.map +1 -1
- package/lib/module/acmo/core/storage/storage.js.map +1 -1
- package/lib/module/acmo/core/types/types.d.js.map +1 -1
- package/lib/module/acmo/modules/dashboard/components/auto_scroller.js.map +1 -1
- package/lib/module/acmo/modules/dashboard/components/custom_card.js.map +1 -1
- package/lib/module/acmo/modules/dashboard/components/my_games_button.js +3 -5
- package/lib/module/acmo/modules/dashboard/components/my_games_button.js.map +1 -1
- package/lib/module/acmo/modules/dashboard/components/offer_info_section.js +3 -8
- package/lib/module/acmo/modules/dashboard/components/offer_info_section.js.map +1 -1
- package/lib/module/acmo/modules/dashboard/components/premium_header.js +3 -3
- package/lib/module/acmo/modules/dashboard/components/premium_header.js.map +1 -1
- package/lib/module/acmo/modules/dashboard/components/premium_option_1.js +2 -7
- package/lib/module/acmo/modules/dashboard/components/premium_option_1.js.map +1 -1
- package/lib/module/acmo/modules/dashboard/components/premium_option_2.js +4 -6
- package/lib/module/acmo/modules/dashboard/components/premium_option_2.js.map +1 -1
- package/lib/module/acmo/modules/dashboard/components/premium_option_3.js +4 -6
- package/lib/module/acmo/modules/dashboard/components/premium_option_3.js.map +1 -1
- package/lib/module/acmo/modules/dashboard/components/premium_option_4.js +5 -6
- package/lib/module/acmo/modules/dashboard/components/premium_option_4.js.map +1 -1
- package/lib/module/acmo/modules/dashboard/repository.js.map +1 -1
- package/lib/module/acmo/modules/dashboard/top_offers.js +23 -7
- package/lib/module/acmo/modules/dashboard/top_offers.js.map +1 -1
- package/lib/module/i18n.js.map +1 -1
- package/lib/module/index.js +12 -2
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/commonjs/src/acmo/core/storage/storage.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/my_games_button.d.ts +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/my_games_button.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_info_section.d.ts +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_info_section.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_header.d.ts +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_header.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_1.d.ts +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_1.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_2.d.ts +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_2.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_3.d.ts +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_3.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_4.d.ts +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_4.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/repository.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/top_offers.d.ts +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/top_offers.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/core/storage/storage.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/my_games_button.d.ts +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/my_games_button.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_info_section.d.ts +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_info_section.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_header.d.ts +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_header.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_1.d.ts +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_1.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_2.d.ts +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_2.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_3.d.ts +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_3.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_4.d.ts +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_4.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/repository.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/top_offers.d.ts +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/top_offers.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/package.json +197 -197
- package/readme.md +95 -97
- package/src/acmo/core/marquee.tsx +61 -61
- package/src/acmo/core/storage/storage.ts +27 -27
- package/src/acmo/core/types/types.d.ts +93 -93
- package/src/acmo/modules/dashboard/components/auto_scroller.tsx +84 -84
- package/src/acmo/modules/dashboard/components/custom_card.tsx +30 -30
- package/src/acmo/modules/dashboard/components/my_games_button.tsx +39 -39
- package/src/acmo/modules/dashboard/components/offer_info_section.tsx +138 -143
- package/src/acmo/modules/dashboard/components/premium_header.tsx +80 -80
- package/src/acmo/modules/dashboard/components/premium_option_1.tsx +155 -160
- package/src/acmo/modules/dashboard/components/premium_option_2.tsx +99 -103
- package/src/acmo/modules/dashboard/components/premium_option_3.tsx +41 -45
- package/src/acmo/modules/dashboard/components/premium_option_4.tsx +184 -183
- package/src/acmo/modules/dashboard/repository.ts +94 -94
- package/src/acmo/modules/dashboard/top_offers.tsx +144 -131
- package/src/i18n.ts +114 -114
- package/src/index.tsx +89 -81
- package/tyrads-sdk.podspec +41 -41
@@ -1,161 +1,156 @@
|
|
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
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
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
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
<View style={
|
62
|
-
<
|
63
|
-
{
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
<
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
},
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
},
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
},
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
},
|
137
|
-
|
138
|
-
fontSize:
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
},
|
154
|
-
|
155
|
-
|
156
|
-
fontWeight: 'bold',
|
157
|
-
color: 'white',
|
158
|
-
},
|
159
|
-
});
|
160
|
-
|
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 { useTranslation } from 'react-i18next';
|
12
|
+
|
13
|
+
interface PremiumOption1Props {
|
14
|
+
data: TransformedCampaign[];
|
15
|
+
premiumColor?: string;
|
16
|
+
onCampaignPress?: (campaignId: number) => void;
|
17
|
+
}
|
18
|
+
|
19
|
+
const PremiumOption1: React.FC<PremiumOption1Props> = ({ data, onCampaignPress, 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={() => onCampaignPress && onCampaignPress(item.campaignId)}
|
29
|
+
style={styles.itemContainer}
|
30
|
+
activeOpacity={0.75}
|
31
|
+
>
|
32
|
+
<View style={{ flexDirection: 'row', flex: 8, marginRight: 10 }}>
|
33
|
+
<Image source={{ uri: item.thumbnail }} style={styles.thumbnail} />
|
34
|
+
<View style={styles.infoContainer}>
|
35
|
+
<View style={{ width: '100%' }}>
|
36
|
+
{item.title.length > 25 ? (
|
37
|
+
<View style={{ overflow: 'hidden' }}>
|
38
|
+
<TextTicker
|
39
|
+
style={styles.titleText}
|
40
|
+
duration={3000}
|
41
|
+
loop
|
42
|
+
bounce
|
43
|
+
repeatSpacer={50}
|
44
|
+
marqueeDelay={1000}
|
45
|
+
>
|
46
|
+
{item.title}
|
47
|
+
</TextTicker>
|
48
|
+
</View>
|
49
|
+
) : (
|
50
|
+
<Text numberOfLines={1} style={styles.titleText}>
|
51
|
+
{item.title}
|
52
|
+
</Text>
|
53
|
+
)}
|
54
|
+
</View>
|
55
|
+
<View style={styles.infoRow}>
|
56
|
+
<View style={[styles.rankContainer, { backgroundColor: premiumColor || '#1C90DF' }]}>
|
57
|
+
<Text numberOfLines={1} style={styles.rankText} adjustsFontSizeToFit={true}>
|
58
|
+
{t('dashboard.top_ranking', { number: index + 1 })}
|
59
|
+
</Text>
|
60
|
+
</View>
|
61
|
+
<View style={styles.rewardDetails}>
|
62
|
+
<Image
|
63
|
+
source={{ uri: item.currency.adUnitCurrencyIcon }}
|
64
|
+
resizeMode="contain"
|
65
|
+
style={styles.coinIcon}
|
66
|
+
/>
|
67
|
+
<Text style={styles.points}>{numeral(item.points).format("0.00a").toUpperCase()}</Text>
|
68
|
+
<Text style={styles.points}>{''}{item.currency.adUnitCurrencyName}</Text>
|
69
|
+
</View>
|
70
|
+
</View>
|
71
|
+
</View>
|
72
|
+
</View>
|
73
|
+
<View style={[styles.playButton, { backgroundColor: premiumColor || '#1C90DF' }]}>
|
74
|
+
<Text style={styles.playButtonText}>{t('dashboard.play_button')}</Text>
|
75
|
+
</View>
|
76
|
+
</TouchableOpacity>
|
77
|
+
))}
|
78
|
+
</View>
|
79
|
+
);
|
80
|
+
};
|
81
|
+
|
82
|
+
const styles = StyleSheet.create({
|
83
|
+
itemContainer: {
|
84
|
+
flexDirection: 'row',
|
85
|
+
flex: 1,
|
86
|
+
width: '100%',
|
87
|
+
justifyContent: 'space-between',
|
88
|
+
alignItems: 'center',
|
89
|
+
paddingHorizontal: 16,
|
90
|
+
paddingVertical: 8,
|
91
|
+
},
|
92
|
+
thumbnail: {
|
93
|
+
height: 40,
|
94
|
+
width: 40,
|
95
|
+
borderRadius: 10,
|
96
|
+
},
|
97
|
+
infoContainer: {
|
98
|
+
marginLeft: 8,
|
99
|
+
},
|
100
|
+
titleText: {
|
101
|
+
fontSize: 14,
|
102
|
+
fontWeight: 'bold',
|
103
|
+
},
|
104
|
+
infoRow: {
|
105
|
+
flexDirection: 'row',
|
106
|
+
alignItems: 'center',
|
107
|
+
alignContent: 'center',
|
108
|
+
},
|
109
|
+
rankContainer: {
|
110
|
+
marginTop: 4,
|
111
|
+
borderRadius: 12,
|
112
|
+
paddingHorizontal: 4,
|
113
|
+
paddingVertical: 2,
|
114
|
+
width: 43,
|
115
|
+
alignItems: 'center',
|
116
|
+
},
|
117
|
+
rankText: {
|
118
|
+
fontSize: 10,
|
119
|
+
color: 'white',
|
120
|
+
fontWeight: 'bold',
|
121
|
+
},
|
122
|
+
rewardDetails: {
|
123
|
+
flexDirection: 'row',
|
124
|
+
alignItems: 'center',
|
125
|
+
marginTop: 4,
|
126
|
+
left: 4,
|
127
|
+
},
|
128
|
+
coinIcon: {
|
129
|
+
width: 14,
|
130
|
+
height: 14,
|
131
|
+
},
|
132
|
+
points: {
|
133
|
+
fontSize: 13,
|
134
|
+
marginLeft: 4,
|
135
|
+
fontWeight: '500',
|
136
|
+
},
|
137
|
+
rewards: {
|
138
|
+
fontSize: 10,
|
139
|
+
fontStyle: 'italic',
|
140
|
+
},
|
141
|
+
playButton: {
|
142
|
+
paddingHorizontal: 12,
|
143
|
+
paddingVertical: 5,
|
144
|
+
height: 30,
|
145
|
+
borderRadius: 8,
|
146
|
+
alignItems: 'center',
|
147
|
+
justifyContent: 'center',
|
148
|
+
},
|
149
|
+
playButtonText: {
|
150
|
+
fontSize: 14,
|
151
|
+
fontWeight: 'bold',
|
152
|
+
color: 'white',
|
153
|
+
},
|
154
|
+
});
|
155
|
+
|
161
156
|
export default PremiumOption1;
|
@@ -1,104 +1,100 @@
|
|
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
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
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
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
}
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
<
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
},
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
fontWeight: 'bold',
|
101
|
-
},
|
102
|
-
});
|
103
|
-
|
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
|
+
|
104
100
|
export default PremiumOption2;
|
@@ -1,46 +1,42 @@
|
|
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
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
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
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
/>
|
43
|
-
);
|
44
|
-
};
|
45
|
-
|
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
|
+
|
46
42
|
export default PremiumOption3;
|