@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,144 +1,139 @@
|
|
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
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
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
|
-
|
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
|
-
alignItems: 'center',
|
91
|
-
width: '
|
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
|
-
color: '
|
121
|
-
fontSize:
|
122
|
-
|
123
|
-
},
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
fontSize: 14,
|
140
|
-
fontWeight: 'bold',
|
141
|
-
},
|
142
|
-
});
|
143
|
-
|
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 { useTranslation } from "react-i18next";
|
6
|
+
|
7
|
+
const { width } = Dimensions.get('window');
|
8
|
+
|
9
|
+
interface OfferInfoSectionProps {
|
10
|
+
details: TransformedCampaign;
|
11
|
+
premiumColor?: string;
|
12
|
+
style?: ViewStyle;
|
13
|
+
onButtonPress: () => void;
|
14
|
+
}
|
15
|
+
|
16
|
+
const OfferInfoSection: React.FC<OfferInfoSectionProps> = ({ details, premiumColor, style, onButtonPress }) => {
|
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={onButtonPress}
|
65
|
+
style={styles.playButton}
|
66
|
+
>
|
67
|
+
<Text style={[styles.playButtonText, { color: premiumColor || '#1C90DF' }]}>
|
68
|
+
{t('dashboard.play_button')}
|
69
|
+
</Text>
|
70
|
+
</TouchableOpacity>
|
71
|
+
</View>
|
72
|
+
</View>
|
73
|
+
);
|
74
|
+
};
|
75
|
+
|
76
|
+
const styles = StyleSheet.create({
|
77
|
+
infoContainer: {
|
78
|
+
width: width,
|
79
|
+
paddingVertical: 8,
|
80
|
+
paddingHorizontal: 16,
|
81
|
+
},
|
82
|
+
infoRow: {
|
83
|
+
flexDirection: 'row',
|
84
|
+
justifyContent: 'space-between',
|
85
|
+
alignItems: 'center',
|
86
|
+
width: '90%',
|
87
|
+
},
|
88
|
+
leftInfo: {
|
89
|
+
flexDirection: 'row',
|
90
|
+
alignItems: 'center',
|
91
|
+
width: '68%',
|
92
|
+
},
|
93
|
+
gameIcon: {
|
94
|
+
width: 50,
|
95
|
+
height: 50,
|
96
|
+
borderRadius: 8,
|
97
|
+
},
|
98
|
+
gameDetails: {
|
99
|
+
marginLeft: 10,
|
100
|
+
},
|
101
|
+
gameTitle: {
|
102
|
+
color: 'white',
|
103
|
+
fontSize: 14,
|
104
|
+
marginBottom: 4,
|
105
|
+
},
|
106
|
+
rewardDetails: {
|
107
|
+
flexDirection: 'row',
|
108
|
+
marginTop: 4,
|
109
|
+
},
|
110
|
+
coinIcon: {
|
111
|
+
width: 18,
|
112
|
+
height: 18,
|
113
|
+
},
|
114
|
+
points: {
|
115
|
+
color: 'white',
|
116
|
+
fontSize: 12,
|
117
|
+
marginLeft: 4,
|
118
|
+
},
|
119
|
+
rewards: {
|
120
|
+
color: 'lightgrey',
|
121
|
+
fontSize: 11,
|
122
|
+
fontStyle: 'italic',
|
123
|
+
},
|
124
|
+
playButton: {
|
125
|
+
paddingHorizontal: 12,
|
126
|
+
paddingVertical: 2,
|
127
|
+
height: 30,
|
128
|
+
borderRadius: 8,
|
129
|
+
backgroundColor: 'white',
|
130
|
+
alignItems: 'center',
|
131
|
+
justifyContent: 'center',
|
132
|
+
},
|
133
|
+
playButtonText: {
|
134
|
+
fontSize: 14,
|
135
|
+
fontWeight: 'bold',
|
136
|
+
},
|
137
|
+
});
|
138
|
+
|
144
139
|
export default OfferInfoSection;
|
@@ -1,81 +1,81 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { View, Text, Image, TouchableOpacity, StyleSheet,} from 'react-native';
|
3
|
-
import
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
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={
|
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
|
-
|
1
|
+
import React from 'react';
|
2
|
+
import { View, Text, Image, TouchableOpacity, StyleSheet,} from 'react-native';
|
3
|
+
import { useTranslation } from 'react-i18next';
|
4
|
+
|
5
|
+
interface PremiumHeaderSectionProps {
|
6
|
+
showMore?: boolean;
|
7
|
+
premiumColor?: string;
|
8
|
+
onShowOffers?: () => void;
|
9
|
+
}
|
10
|
+
|
11
|
+
const PremiumHeaderSection: React.FC<PremiumHeaderSectionProps> = ({ showMore = true, premiumColor, onShowOffers }) => {
|
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={onShowOffers}>
|
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
81
|
export default PremiumHeaderSection;
|