@quintype/native-components 2.20.25 → 2.20.26

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,13 +1,12 @@
1
1
  {
2
2
  "name": "@quintype/native-components",
3
- "version": "2.20.25",
3
+ "version": "2.20.26",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
7
7
  "test": "jest --detectOpenHandles",
8
8
  "lint": "npx eslint './src/**/*.{js,jsx}'",
9
- "lint:ci": "npx eslint $(git diff --pretty='' --diff-filter=d --name-only origin/master..HEAD -- '*.js' '*.jsx') ./start.js",
10
- "prepublishOnly": "./bin-dev-scripts/standard-version-release.sh"
9
+ "lint:ci": "npx eslint $(git diff --pretty='' --diff-filter=d --name-only origin/master..HEAD -- '*.js' '*.jsx') ./start.js"
11
10
  },
12
11
  "dependencies": {
13
12
  "atob": "^2.1.2",
@@ -34,7 +33,8 @@
34
33
  "react-native-pdf": ">=6.2.0",
35
34
  "react-native-webview": ">=11.0.0",
36
35
  "rn-fetch-blob": ">=0.12.0",
37
- "react-native-vector-icons": "^10.0.0"
36
+ "react-native-vector-icons": "^10.0.0",
37
+ "react-native-linear-gradient": "^2.8.3"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@babel/core": "^7.11.1",
@@ -15,6 +15,8 @@ import { storyStyles } from './styles';
15
15
  import { isStoryFree, mutateDataBeforeAccess, getFirstVideoElement } from '../../utils/story';
16
16
  import { isMiddleIndexOfArray } from '../../utils/arrayUtils';
17
17
 
18
+
19
+
18
20
  const getLiveBlogTimeStamp = (card, DATE_FORMAT, share, styles, locale) => {
19
21
  const slug = `?cardId=${card.id}`;
20
22
  return (
@@ -76,8 +78,9 @@ const getStoryCards = (
76
78
  currentLayout,
77
79
  getAd,
78
80
  locale,
79
- ) => cards.map((card, index, source) => (
80
- <View key={card?.id}>
81
+ ) => cards.map((card, index, source) => {
82
+ console.log('risi - vstf', card, source)
83
+ return <View key={card?.id}>
81
84
  {isLiveBlog
82
85
  && getLiveBlogTimeStamp(card, DATE_FORMAT, share, styles, locale)}
83
86
 
@@ -107,7 +110,6 @@ const getStoryCards = (
107
110
  {/* ^ In the case of a story having just 1 card,
108
111
  requesting mid-content-Ad if there are > 1 story-elements in that card
109
112
  (> 2 story-elements in case of video story since the 1st story-element gets rendered in header). */}
110
-
111
113
  <StoryContent
112
114
  testID={contentTestID}
113
115
  key={storyElement?.id}
@@ -124,7 +126,7 @@ const getStoryCards = (
124
126
  );
125
127
  })}
126
128
  </View>
127
- ));
129
+ });
128
130
 
129
131
  export const Story = ({
130
132
  cdn,
@@ -187,6 +189,7 @@ export const Story = ({
187
189
 
188
190
  return (
189
191
  <>
192
+ <View>
190
193
  <StoryHeader
191
194
  firstVideoElement={firstVideoElement}
192
195
  testID={headerTestID}
@@ -218,6 +221,10 @@ export const Story = ({
218
221
  getAd,
219
222
  locale,
220
223
  )}
224
+ <View style={styles.overlay} />
225
+ </View>
226
+
227
+
221
228
 
222
229
  {accessComponent(story, storyHasAccess)}
223
230
 
@@ -37,4 +37,13 @@ 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
+ },
40
49
  });
@@ -2,7 +2,6 @@ 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})`)
6
5
  return `rgba(${rgbCode[0]}, ${rgbCode[1]}, ${rgbCode[2]}, ${alpha})`;
7
6
  }
8
7
 
@@ -50,13 +50,35 @@ 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
- const firstCardObject = get(item, ['cards', 0], {});
53
+ // console.log('riteshh - ittem', item.cards)
54
+ const firstCardObject = get(item, ['cards', 2], {});
54
55
  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
+
55
77
 
56
78
  return {
57
79
  ...item,
58
80
  ...{
59
- cards: [{ ...firstCardObject, 'story-elements': [firstCardElement] }],
81
+ cards: visibleContentsForBlockedStory,
60
82
  },
61
83
  };
62
84
  };