@whatmore-repo/whatmore-reactnative-sdk 1.0.34 → 1.0.35

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whatmore-repo/whatmore-reactnative-sdk",
3
- "version": "1.0.34",
3
+ "version": "1.0.35",
4
4
  "description": "",
5
5
  "private": false,
6
6
  "main": "index.js",
@@ -12,11 +12,14 @@ export default function EventTileWithProduct(props) {
12
12
  const [renderedEvents, setRenderedEvents] = useState(5)
13
13
  const { width } = Dimensions.get('window');
14
14
  const customStyles= getGlobalState('customStyles');
15
+ const whatmorePrimaryFont= getGlobalState('whatmorePrimaryFont');
15
16
  const ITEM_WIDTH = width * 0.33;
16
17
  const CARD_HEIGHT = 40 * (customStyles?.videoTileSize ?? 5.5);
17
18
  const appMarginBottom = customStyles?.widgetMarginBottom ?? 50
18
19
  const safeAreaViewHeight = customStyles?.showProductDetails ? 50 + (appMarginBottom) : (appMarginBottom);
19
20
  const brandThemeColor = customStyles?.brandThemeColor;
21
+ const BASE_FONT_SIZE = customStyles?.fontSize ?? 20
22
+ const fontFamily = customStyles?.fontFamily ?? whatmorePrimaryFont
20
23
  // const brandThemeFont = customStyles?.brandThemeFont;
21
24
 
22
25
  const styles = StyleSheet.create({
@@ -111,21 +114,21 @@ export default function EventTileWithProduct(props) {
111
114
  {(customStyles?.showProductDetails) &&
112
115
  <View style={{ display: 'flex', paddingTop: 10, gap: 4 }}>
113
116
  <Text
114
- style={{ fontSize: 9, paddingRight: 4 }}
117
+ style={{ fontSize: BASE_FONT_SIZE*0.5, paddingRight: 4, fontFamily: fontFamily }}
115
118
  numberOfLines={1}
116
119
  ellipsizeMode="tail">
117
120
  {item?.products?.[0]?.title}
118
121
  </Text>
119
122
  <View style={{ display: 'flex', flexDirection: 'row', gap: 6 }}>
120
123
  <Text
121
- style={{ fontSize: 9, fontWeight: 'bold' }}
124
+ style={{ fontSize: BASE_FONT_SIZE*0.5, fontFamily: fontFamily, fontWeight: 'bold' }}
122
125
  numberOfLines={1}
123
126
  ellipsizeMode="tail">
124
127
  {getPriceStringWithCurrency(price, " ", item.products?.[0]?.currency)}
125
128
  </Text>
126
129
  {!isNaN(compare_price) && compare_price > price &&
127
130
  <Text
128
- style={{ fontSize: 9, textDecorationLine: 'line-through', color: '#808191' }}
131
+ style={{ fontSize: BASE_FONT_SIZE*0.5, fontFamily: fontFamily, textDecorationLine: 'line-through', color: '#808191' }}
129
132
  numberOfLines={1}
130
133
  ellipsizeMode="tail">
131
134
  {getPriceStringWithCurrency(compare_price, " ", item.products?.[0]?.currency)}
@@ -143,7 +146,8 @@ export default function EventTileWithProduct(props) {
143
146
  paddingHorizontal: 4
144
147
  }}>
145
148
  <Text style={{
146
- fontSize: 9,
149
+ fontSize: BASE_FONT_SIZE*0.5,
150
+ fontFamily: fontFamily,
147
151
  color: 'white',
148
152
  width: "fit-content",
149
153
 
@@ -3,7 +3,6 @@ import { Text, TouchableOpacity, View } from "react-native";
3
3
 
4
4
  function ShopNow(props){
5
5
  const whatmorePrimaryColor = getGlobalState('whatmorePrimaryColor');
6
- const whatmorePrimaryFont = getGlobalState('whatmorePrimaryFont');
7
6
  const customStyles= getGlobalState('customStyles');
8
7
  // const onClick = props.onClick;
9
8
  const height = props.height;
@@ -36,7 +35,7 @@ function ShopNow(props){
36
35
  style={{
37
36
  fontSize: props.fontSize,
38
37
  fontWeight: 'bold',
39
- fontFamily: whatmorePrimaryFont,
38
+ fontFamily: props.fontFamily,
40
39
  color: 'white'
41
40
  }}
42
41
  >
@@ -25,6 +25,7 @@ export default function ProductPriceBadge(props) {
25
25
  style={{
26
26
  fontWeight: 'bold',
27
27
  fontSize: fontSize,
28
+ fontFamily: props.fontFamily,
28
29
  color: color
29
30
  }}
30
31
  >
@@ -39,6 +40,7 @@ export default function ProductPriceBadge(props) {
39
40
  numberOfLines={1}
40
41
  style={{
41
42
  fontWeight: 'normal',
43
+ fontFamily: props.fontFamily,
42
44
  textDecorationLine: 'line-through',
43
45
  fontSize: fontSize
44
46
  }}
@@ -18,8 +18,10 @@ export default function ProductTileV1(props) {
18
18
  const whatmorePrimaryFont = getGlobalState('whatmorePrimaryFont');
19
19
  const brandDomainContext = getGlobalState('brandDomainContext');
20
20
  const whatmoreShopId = getGlobalState('whatmoreShopId');
21
+ const customStyles= getGlobalState('customStyles');
21
22
  const PRODUCT_TILE_TOTAL_HEIGHT = Dimensions.get('window').height * 0.2;
22
- const BASE_FONT_SIZE = 20;
23
+ const BASE_FONT_SIZE = customStyles?.fontSize ?? 20;
24
+ const fontFamily = customStyles?.fontFamily ?? whatmorePrimaryFont
23
25
 
24
26
  useEffect(() => {
25
27
  if(tileTapAnimate){
@@ -98,8 +100,8 @@ export default function ProductTileV1(props) {
98
100
  style={{
99
101
 
100
102
  fontWeight: 'normal',
101
- fontFamily: whatmorePrimaryFont,
102
- fontSize: BASE_FONT_SIZE * 0.9,
103
+ fontFamily: fontFamily,
104
+ fontSize: BASE_FONT_SIZE * 0.8,
103
105
  color: 'black',
104
106
  overflow: 'hidden',
105
107
 
@@ -114,7 +116,7 @@ export default function ProductTileV1(props) {
114
116
  }}
115
117
  ></View>
116
118
 
117
- <ProductPriceBadge product={product} event={event} fontSize={BASE_FONT_SIZE * 0.9} color={'black'} />
119
+ <ProductPriceBadge fontFamily={fontFamily} product={product} event={event} fontSize={BASE_FONT_SIZE * 0.75} color={'black'} />
118
120
  </View>
119
121
 
120
122
 
@@ -132,7 +134,8 @@ export default function ProductTileV1(props) {
132
134
  <View style={{ flexDirection: 'row', width: '100%', justifyContent: 'center', alignItems: 'center'}}>
133
135
  <ShopNow
134
136
  height={PRODUCT_TILE_TOTAL_HEIGHT * 0.3}
135
- fontSize={BASE_FONT_SIZE*1.1}
137
+ fontSize={BASE_FONT_SIZE}
138
+ fontFamily={fontFamily}
136
139
  />
137
140
  </View>
138
141
  </View>