@quintype/native-components 2.19.14 → 2.19.16

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/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [2.19.16](https://github.com/quintype/native-components/compare/v2.19.15...v2.19.16) (2022-05-09)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **story-template:** Fixed story-template-icon color :hammer: ([#182](https://github.com/quintype/native-components/issues/182)) ([95f750d](https://github.com/quintype/native-components/commit/95f750d7df5f7cc400095317be26900c0cffd3e1))
11
+
12
+ ### [2.19.15](https://github.com/quintype/native-components/compare/v2.19.14...v2.19.15) (2022-04-12)
13
+
5
14
  ### [2.19.14](https://github.com/quintype/native-components/compare/v2.19.7...v2.19.14) (2022-04-04)
6
15
 
7
16
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quintype/native-components",
3
- "version": "2.19.14",
3
+ "version": "2.19.16",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -24,7 +24,6 @@
24
24
  "react-native-share": "^3.7.0",
25
25
  "react-native-render-html": "^4.2.3",
26
26
  "react-native-vector-icons": "^7.0.0",
27
- "react-native-webview": "^11.0.0",
28
27
  "rn-fetch-blob": "^0.10.16"
29
28
  },
30
29
  "peerDependencies": {
@@ -1,28 +1,30 @@
1
- import { get, throttle } from "lodash";
2
- import PropTypes from "prop-types";
3
- import React, { useContext, memo } from "react";
4
- import { StyleSheet, TouchableOpacity, View } from "react-native";
5
- import Icon from "react-native-vector-icons/FontAwesome";
1
+ import { get, throttle } from 'lodash';
2
+ import PropTypes from 'prop-types';
3
+ import React, { useContext, memo } from 'react';
4
+ import { StyleSheet, TouchableOpacity, View } from 'react-native';
5
+ import Icon from 'react-native-vector-icons/FontAwesome';
6
6
  import {
7
7
  AppTheme,
8
8
  getImageMetadata,
9
9
  getImageSlug,
10
10
  getTimeForStoryCards,
11
- } from "../../utils";
12
- import { getStoryHeadline } from "../../utils/story";
13
- import { ResponsiveImage, Text } from "../index";
14
- import { storyStyles } from "./styles";
11
+ } from '../../utils';
12
+ import { getStoryHeadline } from '../../utils/story';
13
+ import { ResponsiveImage, Text } from '../index';
14
+ import { storyStyles } from './styles';
15
15
  import {
16
16
  COMP_GENERAL_CONSTANTS,
17
17
  COMP_CONTENT_CONSTANTS,
18
- } from "../../constants/component-constants";
18
+ } from '../../constants/component-constants';
19
19
 
20
20
  const PrimaryStoryCardNewBase = (props) => {
21
21
  const { story = {} } = props;
22
22
  const { theme } = useContext(AppTheme);
23
- const { COLORS, FONT_SIZE, locale, DARK_MODE } = theme || {};
23
+ const {
24
+ COLORS, FONT_SIZE, locale, DARK_MODE,
25
+ } = theme || {};
24
26
 
25
- const translate = get(theme, ["translate"], (word) => word);
27
+ const translate = get(theme, ['translate'], (word) => word);
26
28
 
27
29
  const styles = storyStyles(COLORS, FONT_SIZE, DARK_MODE);
28
30
  const containerStyle = StyleSheet.flatten([
@@ -38,16 +40,16 @@ const PrimaryStoryCardNewBase = (props) => {
38
40
  props.timestampStyle,
39
41
  ]);
40
42
 
41
- const DATE_FORMAT = "d MMM, yyyy";
42
- const readTime = story["read-time"]
43
- ? `${story["read-time"]} ${translate("min read")} · `
44
- : "";
43
+ const DATE_FORMAT = 'd MMM, yyyy';
44
+ const readTime = story['read-time']
45
+ ? `${story['read-time']} ${translate('min read')} · `
46
+ : '';
45
47
 
46
48
  const throttledOnpress = throttle(props.onPress, 1000);
47
49
 
48
50
  const showIcon = (name) => (
49
51
  <View style={styles.storyType}>
50
- <Icon name={name} size={22} color={COLORS.BRAND_BLACK} />
52
+ <Icon name={name} size={22} color={COLORS.MONO7} />
51
53
  </View>
52
54
  );
53
55
 
@@ -58,14 +60,14 @@ const PrimaryStoryCardNewBase = (props) => {
58
60
  </View>
59
61
  );
60
62
  const showStoryType = () => {
61
- switch (story["story-template"]) {
62
- case "text":
63
+ switch (story['story-template']) {
64
+ case 'text':
63
65
  return null;
64
- case "photo":
65
- return showIcon("photo");
66
- case "video":
67
- return showIcon("play");
68
- case "live-blog":
66
+ case 'photo':
67
+ return showIcon('photo');
68
+ case 'video':
69
+ return showIcon('play');
70
+ case 'live-blog':
69
71
  return showLiveBlogIcon();
70
72
  default:
71
73
  null;
@@ -103,12 +105,12 @@ const PrimaryStoryCardNewBase = (props) => {
103
105
  numberOfLines={2}
104
106
  testID={COMP_CONTENT_CONSTANTS.publishedDate}
105
107
  >
106
- {readTime +
107
- getTimeForStoryCards(
108
- story["published-at"],
108
+ {readTime
109
+ + getTimeForStoryCards(
110
+ story['published-at'],
109
111
  DATE_FORMAT,
110
112
  locale,
111
- translate
113
+ translate,
112
114
  )}
113
115
  </Text>
114
116
  </View>
@@ -130,7 +132,7 @@ PrimaryStoryCardNewBase.propTypes = {
130
132
  };
131
133
 
132
134
  PrimaryStoryCardNewBase.defaultProps = {
133
- cdn: "",
135
+ cdn: '',
134
136
  horizontalPadding: 12,
135
137
  };
136
138
 
@@ -119,8 +119,9 @@ const getStoryCards = (
119
119
  )}
120
120
  {/* Skip first card if it's a listicle */}
121
121
 
122
- {source.length > 1 && isMiddleIndexOfArray(index, source) && getAd(true)}
123
- {/* ^ Requesting Ad if there are multiple cards. Sending param true for mid-content ad */}
122
+ {source.length > 1 && (!STORY_TYPES.VIDEO_STORY || source.length > 2) && isMiddleIndexOfArray(index, source) && getAd(true)}
123
+ {/* ^ Requesting Ad if there are multiple cards. Sending param true for mid-content ad
124
+ If the story is from video template and have single card then not showing mid-ad */}
124
125
 
125
126
  {(card['story-elements'] || []).map((storyElement, index, source) => {
126
127
  /* Skip the first video element for video story */
@@ -36,6 +36,7 @@ const webviewStyles = (windowWidth) => {
36
36
  },
37
37
  container: {
38
38
  flex: 1,
39
+ marginVertical: 10,
39
40
  },
40
41
  };
41
42
  };