@quintype/native-components 2.20.26 → 2.21.0-beta.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.
@@ -12,4 +12,4 @@ else
12
12
  npx standard-version --prerelease "$(git symbolic-ref --short HEAD | sed s:/:-:g )" --skip.changelog=true
13
13
  fi
14
14
 
15
- git push --follow-tags origin "$BRANCH"
15
+ git push --follow-tags origin "$BRANCH"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quintype/native-components",
3
- "version": "2.20.26",
3
+ "version": "2.21.0-beta.0",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -25,7 +25,7 @@
25
25
  "rn-fetch-blob": "^0.10.16"
26
26
  },
27
27
  "peerDependencies": {
28
- "@react-navigation/native": ">=5.7.3",
28
+ "@react-navigation/native": ">=6.1.17",
29
29
  "lodash": ">=4.17.20",
30
30
  "react": ">=17.0.2",
31
31
  "react-native": ">=0.67.5",
@@ -33,14 +33,12 @@
33
33
  "react-native-pdf": ">=6.2.0",
34
34
  "react-native-webview": ">=11.0.0",
35
35
  "rn-fetch-blob": ">=0.12.0",
36
- "react-native-vector-icons": "^10.0.0",
37
- "react-native-linear-gradient": "^2.8.3"
36
+ "react-native-vector-icons": "^10.0.0"
38
37
  },
39
38
  "devDependencies": {
40
39
  "@babel/core": "^7.11.1",
41
40
  "@babel/runtime": "^7.11.2",
42
41
  "@react-native-community/eslint-config": "^2.0.0",
43
- "@react-navigation/native": "^5.7.1",
44
42
  "@testing-library/jest-native": "^3.4.3",
45
43
  "@testing-library/react-native": "^7.1.0",
46
44
  "babel-jest": "^26.3.0",
@@ -53,10 +51,9 @@
53
51
  "husky": "^4.2.5",
54
52
  "jest": "^26.4.0",
55
53
  "metro-react-native-babel-preset": "^0.62.0",
56
- "react": "17.0.2",
57
- "react-native": "0.67.4",
54
+ "react": "18.2.0",
55
+ "react-native": "0.71.17",
58
56
  "react-native-device-info": "^5.6.5",
59
- "react-native-gesture-handler": "^1.9.0",
60
57
  "react-native-svg": "^12.3.0",
61
58
  "react-navigation-hooks": "^1.1.0",
62
59
  "react-test-renderer": "16.13.1"
@@ -65,7 +62,6 @@
65
62
  "preset": "react-native",
66
63
  "setupFilesAfterEnv": [
67
64
  "./jest-setup.js",
68
- "./node_modules/react-native-gesture-handler/jestSetup.js",
69
65
  "@testing-library/jest-native/extend-expect"
70
66
  ],
71
67
  "moduleNameMapper": {
@@ -1,8 +1,7 @@
1
1
  import { get } from 'lodash';
2
2
  import PropTypes from 'prop-types';
3
3
  import React, { useContext } from 'react';
4
- import { Linking, View } from 'react-native';
5
- import { TouchableOpacity } from 'react-native-gesture-handler';
4
+ import { Linking, View, TouchableOpacity } from 'react-native';
6
5
  import { AppTheme } from '../../utils';
7
6
  import { Text } from '../Text';
8
7
  import { styles } from './styles';
@@ -1,7 +1,6 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React, { useEffect, useContext } from 'react';
3
- import { View, I18nManager } from 'react-native';
4
- import { TouchableOpacity } from 'react-native-gesture-handler';
3
+ import { View, I18nManager, TouchableOpacity } from 'react-native';
5
4
  import { Text } from '../index';
6
5
  import { StoryHeader } from '../StoryHeader';
7
6
  import { StoryContent } from '../StoryContent';
@@ -15,8 +14,6 @@ import { storyStyles } from './styles';
15
14
  import { isStoryFree, mutateDataBeforeAccess, getFirstVideoElement } from '../../utils/story';
16
15
  import { isMiddleIndexOfArray } from '../../utils/arrayUtils';
17
16
 
18
-
19
-
20
17
  const getLiveBlogTimeStamp = (card, DATE_FORMAT, share, styles, locale) => {
21
18
  const slug = `?cardId=${card.id}`;
22
19
  return (
@@ -78,9 +75,8 @@ const getStoryCards = (
78
75
  currentLayout,
79
76
  getAd,
80
77
  locale,
81
- ) => cards.map((card, index, source) => {
82
- console.log('risi - vstf', card, source)
83
- return <View key={card?.id}>
78
+ ) => cards.map((card, index, source) => (
79
+ <View key={card?.id}>
84
80
  {isLiveBlog
85
81
  && getLiveBlogTimeStamp(card, DATE_FORMAT, share, styles, locale)}
86
82
 
@@ -110,6 +106,7 @@ const getStoryCards = (
110
106
  {/* ^ In the case of a story having just 1 card,
111
107
  requesting mid-content-Ad if there are > 1 story-elements in that card
112
108
  (> 2 story-elements in case of video story since the 1st story-element gets rendered in header). */}
109
+
113
110
  <StoryContent
114
111
  testID={contentTestID}
115
112
  key={storyElement?.id}
@@ -126,7 +123,7 @@ const getStoryCards = (
126
123
  );
127
124
  })}
128
125
  </View>
129
- });
126
+ ));
130
127
 
131
128
  export const Story = ({
132
129
  cdn,
@@ -189,7 +186,6 @@ export const Story = ({
189
186
 
190
187
  return (
191
188
  <>
192
- <View>
193
189
  <StoryHeader
194
190
  firstVideoElement={firstVideoElement}
195
191
  testID={headerTestID}
@@ -221,10 +217,6 @@ export const Story = ({
221
217
  getAd,
222
218
  locale,
223
219
  )}
224
- <View style={styles.overlay} />
225
- </View>
226
-
227
-
228
220
 
229
221
  {accessComponent(story, storyHasAccess)}
230
222
 
@@ -37,13 +37,4 @@ export const storyStyles = (COLORS, FONT_SIZE) => StyleSheet.create({
37
37
  color: COLORS.BRAND_1,
38
38
  fontSize: FONT_SIZE.title,
39
39
  },
40
- overlay: {
41
- position: 'absolute',
42
- bottom: -10,
43
- left: 0,
44
- right: 0,
45
- height: 180, // Adjust the height as needed
46
- backgroundColor: 'rgba(150, 0, 0, 0.2)',
47
- marginHorizontal:10
48
- },
49
40
  });
@@ -1,7 +1,6 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React, { useContext } from 'react';
3
- import { View } from 'react-native';
4
- import { TouchableOpacity } from 'react-native-gesture-handler';
3
+ import { View, TouchableOpacity } from 'react-native';
5
4
  import { ShareIcon } from '../../Icons/ShareIcon';
6
5
  import { AppTheme, getScreenPercentageWidth, stripHTML } from '../../utils';
7
6
  import { Text } from '../index';
@@ -1,7 +1,6 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React, { useContext, useRef, useState } from 'react';
3
- import { TouchableOpacity, View } from 'react-native';
4
- import { FlatList } from 'react-native-gesture-handler';
3
+ import { TouchableOpacity, View, FlatList } from 'react-native';
5
4
  import Icon from 'react-native-vector-icons/AntDesign';
6
5
  import { AppTheme } from '../../utils';
7
6
  import { SlideshowStoryCard } from '../SlideshowStoryCard';
@@ -1,7 +1,6 @@
1
1
  import React, { useContext } from 'react';
2
- import { View } from 'react-native';
2
+ import { View , ScrollView } from 'react-native';
3
3
  import get from 'lodash/get';
4
- import { ScrollView } from 'react-native-gesture-handler';
5
4
  import { formatData } from '../../utils/tableUtils';
6
5
  import { tableStyles } from './styles';
7
6
  import { Text } from '../index';
@@ -2,6 +2,7 @@ export const hexToRgb = (hex, alpha=1) => {
2
2
  let rgbCode = hex.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(m, r, g, b) => '#' + r + r + g + g + b + b)
3
3
  .substring(1).match(/.{2}/g)
4
4
  .map(x => parseInt(x, 16));
5
+ console.log('risi - color', `rgb(${rgbCode[0]}, ${rgbCode[1]}, ${rgbCode[2]}, ${alpha})`)
5
6
  return `rgba(${rgbCode[0]}, ${rgbCode[1]}, ${rgbCode[2]}, ${alpha})`;
6
7
  }
7
8
 
@@ -50,35 +50,13 @@ export const mutateDataBeforeAccess = (item, storyHasAccess) => {
50
50
  return item;
51
51
  }
52
52
  /* The following steps are necessary to keep argument mutation at bay */
53
- // console.log('riteshh - ittem', item.cards)
54
- const firstCardObject = get(item, ['cards', 2], {});
53
+ const firstCardObject = get(item, ['cards', 0], {});
55
54
  const firstCardElement = get(firstCardObject, !STORY_TYPES.VIDEO_STORY && ['story-elements', 0], {});
56
- let visibleContentsForBlockedStory = [];
57
- let textStoryFound = false;
58
- if(item.cards && item.cards.length > 0){
59
- for(let i = 0; i < Math.min(item.cards.length, 2); i++){
60
- let storyElement = [];
61
- for(let j=0; j<item.cards[i]['story-elements'].length; j++){
62
- let tempStoryElement = item.cards[i]['story-elements'][j];
63
- if(tempStoryElement?.type !== 'text'){
64
- storyElement.push(tempStoryElement);
65
- } else {
66
- textStoryFound = true;
67
- storyElement.push(tempStoryElement);
68
- break;
69
- }
70
- }
71
- // console.log('risi - temp - item', item.cards[i])
72
- visibleContentsForBlockedStory.push({...item.cards[i],'story-elements' : storyElement});
73
- if(textStoryFound) break;
74
- }
75
- }
76
-
77
55
 
78
56
  return {
79
57
  ...item,
80
58
  ...{
81
- cards: visibleContentsForBlockedStory,
59
+ cards: [{ ...firstCardObject, 'story-elements': [firstCardElement] }],
82
60
  },
83
61
  };
84
62
  };