@quintype/native-components 2.22.5-beta.0 → 2.22.6

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.
Files changed (44) hide show
  1. package/package.json +1 -1
  2. package/src/components/AlsoRead/index.js +4 -4
  3. package/src/components/AuthorRow/index.js +3 -3
  4. package/src/components/BackNavigator/index.js +6 -6
  5. package/src/components/Button/index.js +1 -1
  6. package/src/components/CollectionCard/index.js +10 -20
  7. package/src/components/CollectionCardNew/index.js +84 -0
  8. package/src/components/CollectionTitle/CollectionTitle.test.js +12 -0
  9. package/src/components/CollectionTitle/__snapshots__/CollectionTitle.test.js.snap +3 -0
  10. package/src/components/CollectionTitle/index.js +38 -19
  11. package/src/components/CollectionTitle/styles.js +13 -11
  12. package/src/components/CollectionTitleNew/index.js +44 -0
  13. package/src/components/CollectionTitleNew/styles.js +20 -0
  14. package/src/components/CustomSwitch/index.js +4 -4
  15. package/src/components/DailyMotionPlayer/index.js +2 -2
  16. package/src/components/Header/index.js +2 -2
  17. package/src/components/Html/index.js +4 -4
  18. package/src/components/IconText/index.js +4 -4
  19. package/src/components/JSEmbedElement/index.js +35 -6
  20. package/src/components/LightBoxImage/index.js +2 -2
  21. package/src/components/PDFReader/index.js +8 -7
  22. package/src/components/PrimaryStoryCard/PrimaryStoryCard.test.js +43 -0
  23. package/src/components/PrimaryStoryCard/index.js +63 -44
  24. package/src/components/PrimaryStoryCard/styles.js +28 -32
  25. package/src/components/PrimaryStoryCardNew/index.js +134 -0
  26. package/src/components/PrimaryStoryCardNew/styles.js +70 -0
  27. package/src/components/RadioButton/index.js +3 -3
  28. package/src/components/Rating/index.js +1 -1
  29. package/src/components/RelatedStoriesCard/index.js +12 -2
  30. package/src/components/SecondaryStoryCard/SecondaryStoryCard.test.js +51 -0
  31. package/src/components/SecondaryStoryCard/index.js +62 -37
  32. package/src/components/SecondaryStoryCard/styles.js +34 -37
  33. package/src/components/SecondaryStoryCardNew/index.js +140 -0
  34. package/src/components/SecondaryStoryCardNew/styles.js +82 -0
  35. package/src/components/Story/index.js +13 -12
  36. package/src/components/StoryHeader/index.js +8 -8
  37. package/src/components/StoryText/index.js +2 -5
  38. package/src/components/Text/index.js +1 -3
  39. package/src/components/TextA/index.js +4 -4
  40. package/src/components/TextBigFact/index.js +4 -4
  41. package/src/components/TextBlockQuote/index.js +5 -5
  42. package/src/components/TextBlurb/index.js +3 -3
  43. package/src/components/TextQandA/index.js +3 -2
  44. package/src/components/index.js +4 -0
@@ -1,36 +1,46 @@
1
- import { get, throttle } from 'lodash';
1
+ import { throttle } from 'lodash';
2
+ import get from 'lodash/get';
2
3
  import PropTypes from 'prop-types';
3
- import React, { useContext, memo } from 'react';
4
+ import React, { useContext } from 'react';
4
5
  import {
6
+ Image,
5
7
  StyleSheet,
6
8
  TouchableOpacity,
7
9
  View,
10
+ TextStyle,
11
+ TouchableOpacityProps,
8
12
  } from 'react-native';
9
13
  import Icon from 'react-native-vector-icons/FontAwesome';
10
14
  import {
11
15
  AppTheme,
12
16
  getImageMetadata,
13
17
  getImageSlug,
18
+ getTimeForStoryCards,
14
19
  } from '../../utils';
15
20
  import { getStoryHeadline } from '../../utils/story';
16
- import { ResponsiveImage, Text, StoryCardDetailsRow } from '../index';
17
- import { storyStyles } from './styles';
21
+ import { ResponsiveImage, Text } from '../index';
22
+ import { secStoryCardStyles } from './styles';
18
23
  import {
19
24
  COMP_GENERAL_CONSTANTS,
25
+ COMP_CONTENT_CONSTANTS,
20
26
  } from '../../constants/component-constants';
21
- import PremiumIcons from '../../Icons/PremiumIcons/index';
22
27
 
23
- const SecondaryStoryCardBase = (props) => {
24
- const { story = {} } = props;
28
+ export const SecondaryStoryCard = (props) => {
25
29
  const { theme } = useContext(AppTheme);
30
+ const translate = get(theme, ['translate'], (word) => word);
31
+
26
32
  const {
33
+ locale,
27
34
  COLORS,
28
- premiumIcon,
29
- FONT_SIZE,
30
- storyCardOptions = {},
35
+ reverseTimeAdverbPosition,
36
+ enableReadTimeOnStoryCards,
37
+ DATE_TIME_FORMAT,
31
38
  } = theme;
39
+ const styles = secStoryCardStyles(theme);
40
+ const { story = {} } = props;
41
+
42
+ const DATE_FORMAT = DATE_TIME_FORMAT.dateFormat;
32
43
 
33
- const styles = storyStyles(theme);
34
44
  const containerStyle = StyleSheet.flatten([
35
45
  styles.container,
36
46
  { paddingHorizontal: props.horizontalPadding },
@@ -39,8 +49,17 @@ const SecondaryStoryCardBase = (props) => {
39
49
  styles.headline,
40
50
  props.headlineStyle,
41
51
  ]);
52
+ const authorTextStyle = StyleSheet.flatten([
53
+ styles.authorText,
54
+ props.dateTextStyle,
55
+ ]);
56
+ const iconStyles = StyleSheet.flatten([styles.iconStyles, props.iconStyle]);
42
57
 
43
- const isPremiumStory = story['access'] === 'subscription';
58
+ const name = get(story.authors, [0, 'name']);
59
+ const authorName = name ? `${translate('By')} ${name} | ` : '';
60
+ const readTime = enableReadTimeOnStoryCards && story['read-time']
61
+ ? `${story['read-time']} ${translate('min read')}`
62
+ : '';
44
63
 
45
64
  const throttledOnpress = throttle(props.onPress, 1000);
46
65
 
@@ -73,65 +92,71 @@ const SecondaryStoryCardBase = (props) => {
73
92
  };
74
93
 
75
94
  return (
76
- <>
77
95
  <TouchableOpacity
78
96
  testID={COMP_GENERAL_CONSTANTS.secondaryStoryCard}
79
97
  onPress={throttledOnpress}
80
98
  activeOpacity={0.8}
81
99
  style={containerStyle}
82
100
  >
83
- <View style={[styles.imageAndDetails, storyCardOptions.alignSmallCardImage === "right" && { flexDirection: 'row-reverse'}]}>
84
- {storyCardOptions.enableSmallCardImage && (<ResponsiveImage
85
- styles={styles.image}
101
+ <ResponsiveImage
86
102
  metaData={getImageMetadata(story)}
87
103
  slug={getImageSlug(story) || ''}
88
104
  cdn={props.cdn || ''}
89
105
  imageWidth={props.imageWidth}
90
106
  >
107
+ <Text style={styles.xminContainer}>
108
+ {readTime && (
109
+ <View style={styles.xmin}>
110
+ <Text style={styles.xminText}>{readTime}</Text>
111
+ </View>
112
+ )}
113
+ </Text>
91
114
  <View style={styles.storyTypeContainer}>{showStoryType()}</View>
92
- </ResponsiveImage>)
93
- }
94
- <View style={styles.headlineAndTimestampBlockContainer}>
95
- {storyCardOptions.enableSectionName && <Text numberOfLines={1} ellipsizeMode="tail" style={styles.sectionName}>{get(story, ['sections', 0, 'display-name'], '')}</Text>}
96
- <View style={{display:'flex', flexDirection:'row'}}>
115
+ </ResponsiveImage>
116
+ <View style={styles.headlineAndAuthorBlockContainer}>
97
117
  <Text
98
118
  primary
99
- numberOfLines={storyCardOptions.numberOfLinesForTitle}
119
+ numberOfLines={3}
100
120
  ellipsizeMode="tail"
101
121
  style={headlineStyle}
102
122
  testID={COMP_GENERAL_CONSTANTS.secondaryStoryHeadline}
103
123
  >
104
- {isPremiumStory && premiumIcon !=='none' && <PremiumIcons style={styles.premiumIcon} name={premiumIcon} color={COLORS.primary} size={FONT_SIZE.h4} />}
105
- {isPremiumStory && premiumIcon !=='none' && ' '}
106
124
  {getStoryHeadline(story)?.trim()}
107
125
  </Text>
126
+ <View style={styles.authorAndIconContainer}>
127
+ <Text
128
+ style={authorTextStyle}
129
+ numberOfLines={2}
130
+ testID={COMP_CONTENT_CONSTANTS.authorName}
131
+ >
132
+ {authorName
133
+ + getTimeForStoryCards(
134
+ story['published-at'],
135
+ DATE_FORMAT,
136
+ locale,
137
+ translate,
138
+ reverseTimeAdverbPosition,
139
+ )}
140
+ </Text>
141
+ <View style={iconStyles}>{props.iconComponent}</View>
108
142
  </View>
109
- <StoryCardDetailsRow
110
- authorName={get(story.authors, [0, 'name'])}
111
- publishedAt={story["published-at"]}
112
- readTime={story['read-time']}
113
- />
114
143
  </View>
115
- </View>
116
- <View style={styles.icon}>{props.iconComponent}</View>
117
144
  </TouchableOpacity>
118
- <View style={[styles.separatorLine, { marginHorizontal: props.horizontalPadding }]}/>
119
- </>
120
145
  );
121
146
  };
122
147
 
123
- SecondaryStoryCardBase.propTypes = TouchableOpacityProps && {
148
+ SecondaryStoryCard.propTypes = TouchableOpacityProps && {
124
149
  cdn: PropTypes.string.isRequired,
150
+ imageStyle: Image.style,
125
151
  imageWidth: PropTypes.number,
126
152
  headlineStyle: TextStyle,
153
+ dateTextStyle: TextStyle,
127
154
  story: PropTypes.any.isRequired,
128
155
  iconComponent: PropTypes.element,
129
156
  horizontalPadding: PropTypes.number,
130
157
  };
131
158
 
132
- SecondaryStoryCardBase.defaultProps = {
159
+ SecondaryStoryCard.defaultProps = {
133
160
  cdn: '',
134
161
  horizontalPadding: 12,
135
162
  };
136
-
137
- export const SecondaryStoryCard = memo(SecondaryStoryCardBase);
@@ -1,46 +1,52 @@
1
1
  import { StyleSheet } from 'react-native';
2
2
 
3
- export const storyStyles = ({ COLORS, FONT_SIZE, FONT_FAMILY, lineHeightMultiplier, storyCardOptions = {} }) => StyleSheet.create({
3
+ export const secStoryCardStyles = ({ COLORS, FONT_SIZE, DARK_MODE }) => StyleSheet.create({
4
4
  container: {
5
5
  flexDirection: 'row',
6
- justifyContent: 'space-between',
7
6
  backgroundColor: COLORS.BRAND_WHITE,
8
- paddingVertical: 10,
9
- alignItems: 'flex-start',
10
- gap: 10,
7
+ paddingVertical: 15,
11
8
  },
12
- imageAndDetails: {
13
- flexDirection: 'row',
9
+ headlineAndAuthorBlockContainer: {
14
10
  flexShrink: 1,
15
- alignItems: 'flex-start',
16
- gap: 10,
17
- },
18
- image: {
19
- marginBottom: 4,
20
- marginTop: storyCardOptions.enableSectionName ? FONT_SIZE.h4 * lineHeightMultiplier + 8 : 4,
21
- },
22
- icon: {
23
- marginBottom: 4,
24
- marginTop: storyCardOptions.enableSectionName ? FONT_SIZE.h4 * lineHeightMultiplier + 8 : 4,
11
+ flex: 1,
12
+ justifyContent: 'space-between',
13
+ paddingHorizontal: 10,
25
14
  },
26
- headlineAndTimestampBlockContainer: {
27
- flexShrink: 1,
28
- flexGrow: 1,
29
- gap: 4,
15
+ authorAndIconContainer: {
16
+ flexDirection: 'row',
30
17
  justifyContent: 'space-between',
31
18
  },
32
- sectionName: {
33
- color: COLORS.BRAND_1,
34
- fontSize: FONT_SIZE.h4,
35
- lineHeight: FONT_SIZE.h4 * lineHeightMultiplier,
19
+ authorText: {
20
+ color: COLORS.BRAND_BLACK,
21
+ fontSize: FONT_SIZE.h6,
22
+ lineHeight: FONT_SIZE.h6 * 1.3,
23
+ opacity: 0.5,
24
+ fontWeight: '500',
25
+ paddingTop: 8,
36
26
  },
37
27
  headline: {
38
28
  color: COLORS.BRAND_BLACK,
29
+ opacity: 0.9,
39
30
  flexWrap: 'wrap',
40
31
  fontSize: FONT_SIZE.h3,
41
- fontFamily: FONT_FAMILY.primaryBold,
42
- lineHeight: FONT_SIZE.h3 * lineHeightMultiplier,
43
- marginBottom: 4,
32
+ lineHeight: FONT_SIZE.h3 * 1.5,
33
+ },
34
+ iconStyles: {
35
+ justifyContent: 'flex-end',
36
+ },
37
+ xminContainer: {
38
+ position: 'absolute',
39
+ bottom: 8,
40
+ right: 8,
41
+ },
42
+ xmin: {
43
+ backgroundColor: DARK_MODE ? COLORS.MONO6 : COLORS.BRAND_WHITE,
44
+ paddingLeft: 8,
45
+ paddingRight: 8,
46
+ },
47
+ xminText: {
48
+ color: COLORS.BRAND_BLACK,
49
+ fontSize: FONT_SIZE.h5,
44
50
  },
45
51
  storyTypeContainer: {
46
52
  position: 'absolute',
@@ -70,13 +76,4 @@ export const storyStyles = ({ COLORS, FONT_SIZE, FONT_FAMILY, lineHeightMultipli
70
76
  borderRadius: 50,
71
77
  backgroundColor: COLORS.BRAND_3,
72
78
  },
73
- premiumIcon: {
74
- marginTop: FONT_SIZE.h3 * 0.45,
75
- marginRight: 3,
76
- },
77
- separatorLine: {
78
- height: 0.8,
79
- opacity: 0.1,
80
- backgroundColor: COLORS.BRAND_BLACK,
81
- },
82
79
  });
@@ -0,0 +1,140 @@
1
+ import { get, isNull, throttle } from 'lodash';
2
+ import PropTypes from 'prop-types';
3
+ import React, { useContext, memo } from 'react';
4
+ import {
5
+ StyleSheet,
6
+ TouchableOpacity,
7
+ View,
8
+ TextStyle,
9
+ TouchableOpacityProps,
10
+ } from 'react-native';
11
+ import Icon from 'react-native-vector-icons/FontAwesome';
12
+ import {
13
+ AppTheme,
14
+ getImageMetadata,
15
+ getImageSlug,
16
+ } from '../../utils';
17
+ import { getStoryHeadline } from '../../utils/story';
18
+ import { ResponsiveImage, Text, StoryCardDetailsRow } from '../index';
19
+ import { storyStyles } from './styles';
20
+ import {
21
+ COMP_GENERAL_CONSTANTS,
22
+ COMP_CONTENT_CONSTANTS,
23
+ } from '../../constants/component-constants';
24
+ import PremiumIcons from '../../Icons/PremiumIcons/index';
25
+
26
+ const SecondaryStoryCardNewBase = (props) => {
27
+ const { story = {} } = props;
28
+ const { theme } = useContext(AppTheme);
29
+ const {
30
+ COLORS,
31
+ premiumIcon,
32
+ FONT_SIZE,
33
+ storyCardOptions = {},
34
+ } = theme;
35
+
36
+ const styles = storyStyles(theme);
37
+ const containerStyle = StyleSheet.flatten([
38
+ styles.container,
39
+ { paddingHorizontal: props.horizontalPadding },
40
+ ]);
41
+ const headlineStyle = StyleSheet.flatten([
42
+ styles.headline,
43
+ props.headlineStyle,
44
+ ]);
45
+
46
+ const isPremiumStory = story['access'] === 'subscription';
47
+
48
+ const throttledOnpress = throttle(props.onPress, 1000);
49
+
50
+ const showIcon = (name) => (
51
+ <View style={styles.storyType}>
52
+ <Icon name={name} size={14} color={COLORS.MONO7} />
53
+ </View>
54
+ );
55
+
56
+ const showLiveBlogIcon = () => (
57
+ <View style={styles.storyType}>
58
+ <View style={styles.liveBlogIcon} />
59
+ <Text style={styles.liveBlogText}>LIVE</Text>
60
+ </View>
61
+ );
62
+
63
+ const showStoryType = () => {
64
+ switch (story['story-template']) {
65
+ case 'text':
66
+ return null;
67
+ case 'photo':
68
+ return showIcon('photo');
69
+ case 'video':
70
+ return showIcon('play');
71
+ case 'live-blog':
72
+ return showLiveBlogIcon();
73
+ default:
74
+ null;
75
+ }
76
+ };
77
+
78
+ return (
79
+ <>
80
+ <TouchableOpacity
81
+ testID={COMP_GENERAL_CONSTANTS.secondaryStoryCard}
82
+ onPress={throttledOnpress}
83
+ activeOpacity={0.8}
84
+ style={containerStyle}
85
+ >
86
+ <View style={[styles.imageAndDetails, storyCardOptions.alignSmallCardImage === "right" && { flexDirection: 'row-reverse'}]}>
87
+ {storyCardOptions.enableSmallCardImage && (<ResponsiveImage
88
+ styles={styles.image}
89
+ metaData={getImageMetadata(story)}
90
+ slug={getImageSlug(story) || ''}
91
+ cdn={props.cdn || ''}
92
+ imageWidth={props.imageWidth}
93
+ >
94
+ <View style={styles.storyTypeContainer}>{showStoryType()}</View>
95
+ </ResponsiveImage>)
96
+ }
97
+ <View style={styles.headlineAndTimestampBlockContainer}>
98
+ {storyCardOptions.enableSectionName && <Text numberOfLines={1} ellipsizeMode="tail" style={styles.sectionName}>{get(story, ['sections', 0, 'display-name'], '')}</Text>}
99
+ <View style={{display:'flex', flexDirection:'row'}}>
100
+ <Text
101
+ primary
102
+ numberOfLines={storyCardOptions.numberOfLinesForTitle}
103
+ ellipsizeMode="tail"
104
+ style={headlineStyle}
105
+ testID={COMP_GENERAL_CONSTANTS.secondaryStoryHeadline}
106
+ >
107
+ {isPremiumStory && premiumIcon !=='none' && <PremiumIcons style={styles.premiumIcon} name={premiumIcon} color={COLORS.primary} size={FONT_SIZE.h4} />}
108
+ {isPremiumStory && premiumIcon !=='none' && ' '}
109
+ {getStoryHeadline(story)?.trim()}
110
+ </Text>
111
+ </View>
112
+ <StoryCardDetailsRow
113
+ authorName={get(story.authors, [0, 'name'])}
114
+ publishedAt={story["published-at"]}
115
+ readTime={story['read-time']}
116
+ />
117
+ </View>
118
+ </View>
119
+ <View style={styles.icon}>{props.iconComponent}</View>
120
+ </TouchableOpacity>
121
+ <View style={[styles.separatorLine, { marginHorizontal: props.horizontalPadding }]}/>
122
+ </>
123
+ );
124
+ };
125
+
126
+ SecondaryStoryCardNewBase.propTypes = TouchableOpacityProps && {
127
+ cdn: PropTypes.string.isRequired,
128
+ imageWidth: PropTypes.number,
129
+ headlineStyle: TextStyle,
130
+ story: PropTypes.any.isRequired,
131
+ iconComponent: PropTypes.element,
132
+ horizontalPadding: PropTypes.number,
133
+ };
134
+
135
+ SecondaryStoryCardNewBase.defaultProps = {
136
+ cdn: '',
137
+ horizontalPadding: 12,
138
+ };
139
+
140
+ export const SecondaryStoryCardNew = memo(SecondaryStoryCardNewBase);
@@ -0,0 +1,82 @@
1
+ import { StyleSheet } from 'react-native';
2
+
3
+ export const storyStyles = ({ COLORS, FONT_SIZE, FONT_FAMILY, lineHeightMultiplier, storyCardOptions = {} }) => StyleSheet.create({
4
+ container: {
5
+ flexDirection: 'row',
6
+ justifyContent: 'space-between',
7
+ backgroundColor: COLORS.BRAND_WHITE,
8
+ paddingVertical: 10,
9
+ alignItems: 'flex-start',
10
+ gap: 10,
11
+ },
12
+ imageAndDetails: {
13
+ flexDirection: 'row',
14
+ flexShrink: 1,
15
+ alignItems: 'flex-start',
16
+ gap: 10,
17
+ },
18
+ image: {
19
+ marginBottom: 4,
20
+ marginTop: storyCardOptions.enableSectionName ? FONT_SIZE.h4 * lineHeightMultiplier + 8 : 4,
21
+ },
22
+ icon: {
23
+ marginBottom: 4,
24
+ marginTop: storyCardOptions.enableSectionName ? FONT_SIZE.h4 * lineHeightMultiplier + 8 : 4,
25
+ },
26
+ headlineAndTimestampBlockContainer: {
27
+ flexShrink: 1,
28
+ flexGrow: 1,
29
+ gap: 4,
30
+ justifyContent: 'space-between',
31
+ },
32
+ sectionName: {
33
+ color: COLORS.BRAND_1,
34
+ fontSize: FONT_SIZE.h4,
35
+ lineHeight: FONT_SIZE.h4 * lineHeightMultiplier,
36
+ },
37
+ headline: {
38
+ color: COLORS.BRAND_BLACK,
39
+ flexWrap: 'wrap',
40
+ fontSize: FONT_SIZE.h3,
41
+ fontFamily: FONT_FAMILY.primaryBold,
42
+ lineHeight: FONT_SIZE.h3 * lineHeightMultiplier,
43
+ marginBottom: 4,
44
+ },
45
+ storyTypeContainer: {
46
+ position: 'absolute',
47
+ backgroundColor: COLORS.MONO1,
48
+ bottom: 0,
49
+ left: 0,
50
+ },
51
+ storyType: {
52
+ padding: 5,
53
+ justifyContent: 'space-between',
54
+ alignItems: 'center',
55
+ flexDirection: 'row',
56
+ },
57
+ storyTypeText: {
58
+ color: COLORS.MONO7,
59
+ fontSize: FONT_SIZE.h5,
60
+ },
61
+ liveBlogText: {
62
+ color: COLORS.MONO7,
63
+ fontSize: FONT_SIZE.h5,
64
+ marginLeft: 4,
65
+ fontWeight: 'bold',
66
+ },
67
+ liveBlogIcon: {
68
+ height: 12,
69
+ width: 12,
70
+ borderRadius: 50,
71
+ backgroundColor: COLORS.BRAND_3,
72
+ },
73
+ premiumIcon: {
74
+ marginTop: FONT_SIZE.h3 * 0.45,
75
+ marginRight: 3,
76
+ },
77
+ separatorLine: {
78
+ height: 0.8,
79
+ opacity: 0.1,
80
+ backgroundColor: COLORS.BRAND_BLACK,
81
+ },
82
+ });
@@ -1,19 +1,20 @@
1
- import { hexToRgb } from '@quintype/native-components/src/utils/colorUtils';
2
1
  import PropTypes from 'prop-types';
3
- import React, { useContext, useEffect } from 'react';
4
- import { I18nManager, View } from 'react-native';
5
- import LinearGradient from "react-native-linear-gradient";
6
- import { ClockIcon } from '../../Icons/ClockIcon';
7
- import { AppTheme, getTimeInFormat } from '../../utils';
8
- import { isMiddleIndexOfArray } from '../../utils/arrayUtils';
9
- import { getFirstVideoElement, isStoryFree } from '../../utils/story';
10
- import { STORY_TYPES } from '../../utils/story-types';
11
- import { FBCommentsRow } from '../FBCommentsRow';
12
- import { StoryContent } from '../StoryContent';
2
+ import React, { useEffect, useContext } from 'react';
3
+ import { View, I18nManager, TouchableOpacity } from 'react-native';
4
+ import { Text } from '../index';
13
5
  import { StoryHeader } from '../StoryHeader';
6
+ import { StoryContent } from '../StoryContent';
14
7
  import { TagsRow } from '../TagsRow/TagsRow';
15
- import { ShareButton, Text } from '../index';
8
+ import { FBCommentsRow } from '../FBCommentsRow';
9
+ import { STORY_TYPES } from '../../utils/story-types';
10
+ import { getTimeInFormat, AppTheme } from '../../utils';
11
+ import { ShareButton } from '../index';
12
+ import { ClockIcon } from '../../Icons/ClockIcon';
16
13
  import { storyStyles } from './styles';
14
+ import { isStoryFree, getFirstVideoElement } from '../../utils/story';
15
+ import { isMiddleIndexOfArray } from '../../utils/arrayUtils';
16
+ import LinearGradient from "react-native-linear-gradient";
17
+ import { hexToRgb } from '@quintype/native-components/src/utils/colorUtils';
17
18
 
18
19
  const getLiveBlogTimeStamp = (card, DATE_FORMAT, story, styles, locale) => {
19
20
  const slug = `?cardId=${card.id}`;
@@ -1,25 +1,25 @@
1
1
  import get from 'lodash/get';
2
2
  import PropTypes from 'prop-types';
3
3
  import React, { useContext } from 'react';
4
- import { TouchableOpacity, View } from 'react-native';
5
- import { COMP_CONTENT_CONSTANTS } from '../../constants/component-constants/content-constants/constants';
4
+ import { TouchableOpacity, View, I18nManager,StyleSheet } from 'react-native';
6
5
  import {
7
- AppTheme,
8
6
  getImageMetadata,
9
7
  getScreenPercentageWidth,
10
- getTimeInFormat
8
+ getTimeInFormat,
9
+ AppTheme,
10
+ stripHTML,
11
11
  } from '../../utils';
12
12
  import { STORY_TYPES } from '../../utils/story-types';
13
- import { YouTubePlayer } from '../YouTubePlayer';
14
13
  import {
15
- AuthorRow, ResponsiveImage,
16
- StoryTitle, Text
14
+ AuthorRow, ResponsiveImage, StoryText, StoryTitle, Text,
17
15
  } from '../index';
16
+ import { YouTubePlayer } from '../YouTubePlayer';
18
17
  import { storyHeaderStyles } from './styles';
18
+ import { COMP_CONTENT_CONSTANTS } from '../../constants/component-constants/content-constants/constants';
19
19
 
20
20
  import { DailyMotionPlayer } from '../DailyMotionPlayer';
21
21
  import { RatingLayout } from '../Rating';
22
- import CustomHtmlParser from './../Html/index';
22
+ import CustomHtmlParser from './../Html/index';
23
23
 
24
24
  const getHeroImage = (cdn, story) => {
25
25
  const imageSlug = story['hero-image-s3-key'];
@@ -1,14 +1,11 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React, { useContext } from 'react';
3
3
  import {
4
- I18nManager,
5
- StyleSheet,
6
- Text,
7
- View
4
+ View, StyleSheet, Linking, Text, I18nManager,
8
5
  } from 'react-native';
9
6
  import HTML from 'react-native-render-html';
10
- import { customHTMLStyles } from '../../constants/renderHTML';
11
7
  import { AppTheme } from '../../utils/context';
8
+ import { customHTMLStyles } from '../../constants/renderHTML';
12
9
 
13
10
  import { storyTextStyles } from './styles';
14
11
 
@@ -1,9 +1,7 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React, { useContext } from 'react';
3
3
  import {
4
- I18nManager,
5
- Text as RNText,
6
- StyleSheet
4
+ Text as RNText, TextProps, StyleSheet, I18nManager,
7
5
  } from 'react-native';
8
6
 
9
7
  import { AppTheme } from '../../utils/context';
@@ -1,9 +1,9 @@
1
- import { Text } from '@quintype/native-components/src/components';
2
- import { textAnswerStyles } from '@quintype/native-components/src/components/TextA/styles';
3
- import { AppTheme } from '@quintype/native-components/src/utils/context';
4
1
  import PropTypes from 'prop-types';
5
2
  import React, { useContext } from 'react';
6
- import { I18nManager, Linking, StyleSheet, View } from 'react-native';
3
+ import { View, StyleSheet, Linking,I18nManager } from 'react-native';
4
+ import { StoryText, Text } from '@quintype/native-components/src/components';
5
+ import { textAnswerStyles } from '@quintype/native-components/src/components/TextA/styles';
6
+ import { AppTheme } from '@quintype/native-components/src/utils/context';
7
7
  import HTML from 'react-native-render-html';
8
8
  import { customHTMLStyles } from '../../constants/renderHTML';
9
9
 
@@ -1,12 +1,12 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React, { useContext } from 'react';
3
- import { StyleSheet, View } from 'react-native';
3
+ import { View, Linking, StyleSheet } from 'react-native';
4
4
  import HTML from 'react-native-render-html';
5
- import { customHTMLStyles } from '../../constants/renderHTML';
6
- import { alterQuoteData } from '../../utils';
7
- import { AppTheme } from '../../utils/context';
8
5
  import { Text } from '../index';
9
6
  import { bigTextStyles } from './styles';
7
+ import { AppTheme } from '../../utils/context';
8
+ import { customHTMLStyles } from '../../constants/renderHTML';
9
+ import { alterQuoteData } from '../../utils';
10
10
 
11
11
  export const TextBigFact = ({ text, attribution, id }) => {
12
12
  const { theme, useDeeplinkHandler } = useContext(AppTheme);
@@ -1,13 +1,13 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React, { useContext } from 'react';
3
- import { StyleSheet, View } from 'react-native';
4
- import HTML from 'react-native-render-html';
3
+ import { View, Linking, StyleSheet } from 'react-native';
5
4
  import Icon from 'react-native-vector-icons/FontAwesome';
6
- import { customHTMLStyles } from '../../constants/renderHTML';
7
- import { alterQuoteData } from '../../utils';
8
- import { AppTheme } from '../../utils/context';
5
+ import HTML from 'react-native-render-html';
9
6
  import { Text } from '../index';
7
+ import { customHTMLStyles } from '../../constants/renderHTML';
10
8
  import { blockQuoteTextStyles } from './styles';
9
+ import { AppTheme } from '../../utils/context';
10
+ import { alterQuoteData } from '../../utils';
11
11
 
12
12
  export const TextBlockQuote = ({ text, attribution }) => {
13
13
  const { theme, useDeeplinkHandler } = useContext(AppTheme);
@@ -1,10 +1,10 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React, { useContext } from 'react';
3
- import { StyleSheet, View } from 'react-native';
3
+ import { View, Linking, StyleSheet } from 'react-native';
4
4
  import HTML from 'react-native-render-html';
5
- import { customHTMLStyles } from '../../constants/renderHTML';
6
- import { AppTheme } from '../../utils/context';
7
5
  import { textBlurbStyles } from './styles';
6
+ import { AppTheme } from '../../utils/context';
7
+ import { customHTMLStyles } from '../../constants/renderHTML';
8
8
 
9
9
  export const TextBlurb = ({ text }) => {
10
10
  const { theme, useDeeplinkHandler } = useContext(AppTheme);
@@ -1,10 +1,11 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React, { useContext } from 'react';
3
3
  import { View } from 'react-native';
4
+ import { Text } from '../index';
5
+ import { textQandAStyles } from './styles';
4
6
  import { AppTheme } from '../../utils/context';
5
- import { TextA } from '../TextA/index';
6
7
  import { TextQ } from '../TextQ/index';
7
- import { textQandAStyles } from './styles';
8
+ import { TextA } from '../TextA/index';
8
9
 
9
10
  export const TextQandA = ({ question, answer }) => {
10
11
  const { theme } = useContext(AppTheme);