@quintype/native-components 2.22.0-beta.2 → 2.22.0-beta.3
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/bin-dev-scripts/standard-version-release.sh +11 -11
- package/package.json +1 -1
- package/src/components/PDFReader/index.js +4 -12
- package/src/components/PrimaryStoryCardNew/index.js +1 -1
- package/src/components/PrimaryStoryCardNew/styles.js +1 -1
- package/src/components/SecondaryStoryCardNew/index.js +1 -1
- package/src/components/SecondaryStoryCardNew/styles.js +1 -1
- package/src/components/ShareButton/index.js +3 -2
- package/src/components/Story/index.js +8 -16
- package/src/components/StoryCardDetailsRow/index.js +1 -1
- package/src/components/StoryContent/index.js +4 -5
- package/src/components/StoryImage/index.js +5 -7
- package/src/Icons/ShareIcon/index.js +0 -19
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
#!/bin/bash -e
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
npm install
|
|
4
|
+
git diff --quiet
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
BRANCH=$(git symbolic-ref --short HEAD)
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
if [ "$BRANCH" == 'master' ]
|
|
9
|
+
then
|
|
10
|
+
npx standard-version
|
|
11
|
+
else
|
|
12
|
+
npx standard-version --prerelease "$(git symbolic-ref --short HEAD | sed s:/:-:g )" --skip.changelog=true
|
|
13
|
+
fi
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
git push --follow-tags origin "$BRANCH"
|
package/package.json
CHANGED
|
@@ -13,10 +13,10 @@ import Pdf from 'react-native-pdf';
|
|
|
13
13
|
|
|
14
14
|
import { Text } from '../index';
|
|
15
15
|
import { pdfStyles } from './styles';
|
|
16
|
-
import {
|
|
16
|
+
import { ShareButton } from '../index';
|
|
17
17
|
import { AppTheme } from '../../utils';
|
|
18
18
|
|
|
19
|
-
export const PDFReader = ({ card,
|
|
19
|
+
export const PDFReader = ({ card, story }) => {
|
|
20
20
|
const [modalVisible, setModalVisible] = useState(false);
|
|
21
21
|
|
|
22
22
|
const { theme } = useContext(AppTheme);
|
|
@@ -66,15 +66,7 @@ export const PDFReader = ({ card, share }) => {
|
|
|
66
66
|
</Text>
|
|
67
67
|
</TouchableOpacity>
|
|
68
68
|
</View>
|
|
69
|
-
<
|
|
70
|
-
<TouchableOpacity
|
|
71
|
-
onPress={() => {
|
|
72
|
-
share(card.url, 'attachment');
|
|
73
|
-
}}
|
|
74
|
-
>
|
|
75
|
-
<ShareIcon />
|
|
76
|
-
</TouchableOpacity>
|
|
77
|
-
</View>
|
|
69
|
+
<ShareButton story={story} type={'attachment'} slug={card.url} containerStyle={styles.pdfShare} />
|
|
78
70
|
</View>
|
|
79
71
|
</SafeAreaView>
|
|
80
72
|
);
|
|
@@ -82,5 +74,5 @@ export const PDFReader = ({ card, share }) => {
|
|
|
82
74
|
|
|
83
75
|
PDFReader.propTypes = {
|
|
84
76
|
card: PropTypes.any.isRequired,
|
|
85
|
-
|
|
77
|
+
story: PropTypes.any,
|
|
86
78
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const storyStyles = ({COLORS, FONT_SIZE, FONT_FAMILY, lineHeightMultiplier, storyCardOptions}) => ({
|
|
1
|
+
export const storyStyles = ({COLORS, FONT_SIZE, FONT_FAMILY, lineHeightMultiplier, storyCardOptions = {}}) => ({
|
|
2
2
|
container: {
|
|
3
3
|
backgroundColor: COLORS.BRAND_WHITE,
|
|
4
4
|
paddingVertical: 10,
|
|
@@ -1,6 +1,6 @@
|
|
|
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 storyStyles = ({ COLORS, FONT_SIZE, FONT_FAMILY, lineHeightMultiplier, storyCardOptions = {} }) => StyleSheet.create({
|
|
4
4
|
container: {
|
|
5
5
|
flexDirection: 'row',
|
|
6
6
|
justifyContent: 'space-between',
|
|
@@ -12,8 +12,8 @@ import { COMP_GENERAL_CONSTANTS } from '../../constants/component-constants';
|
|
|
12
12
|
const ShareButtonBase = (props) => {
|
|
13
13
|
const { theme } = useContext(AppTheme);
|
|
14
14
|
const styles = shareButtonStyles(theme);
|
|
15
|
-
const { storyCardOptions } = theme;
|
|
16
|
-
const { story, type = 'story', slug } = props;
|
|
15
|
+
const { storyCardOptions = {} } = theme;
|
|
16
|
+
const { story, type = 'story', slug, containerStyle } = props;
|
|
17
17
|
|
|
18
18
|
const getShareURL = () => {
|
|
19
19
|
const { url } = story || {};
|
|
@@ -65,6 +65,7 @@ const ShareButtonBase = (props) => {
|
|
|
65
65
|
<TouchableOpacity
|
|
66
66
|
onPress={share}
|
|
67
67
|
testID={COMP_GENERAL_CONSTANTS.shareButtonTouch}
|
|
68
|
+
style={containerStyle}
|
|
68
69
|
>
|
|
69
70
|
{renderIcon()}
|
|
70
71
|
</TouchableOpacity>
|
|
@@ -8,15 +8,15 @@ import { TagsRow } from '../TagsRow/TagsRow';
|
|
|
8
8
|
import { FBCommentsRow } from '../FBCommentsRow';
|
|
9
9
|
import { STORY_TYPES } from '../../utils/story-types';
|
|
10
10
|
import { getTimeInFormat, AppTheme } from '../../utils';
|
|
11
|
-
import {
|
|
11
|
+
import { ShareButton } from '../index';
|
|
12
12
|
import { ClockIcon } from '../../Icons/ClockIcon';
|
|
13
13
|
import { storyStyles } from './styles';
|
|
14
|
-
import { isStoryFree,
|
|
14
|
+
import { isStoryFree, getFirstVideoElement } from '../../utils/story';
|
|
15
15
|
import { isMiddleIndexOfArray } from '../../utils/arrayUtils';
|
|
16
16
|
import LinearGradient from "react-native-linear-gradient";
|
|
17
17
|
import { hexToRgb } from '@quintype/native-components/src/utils/colorUtils';
|
|
18
18
|
|
|
19
|
-
const getLiveBlogTimeStamp = (card, DATE_FORMAT,
|
|
19
|
+
const getLiveBlogTimeStamp = (card, DATE_FORMAT, story, styles, locale) => {
|
|
20
20
|
const slug = `?cardId=${card.id}`;
|
|
21
21
|
return (
|
|
22
22
|
<View style={styles.container}>
|
|
@@ -26,11 +26,7 @@ const getLiveBlogTimeStamp = (card, DATE_FORMAT, share, styles, locale) => {
|
|
|
26
26
|
{getTimeInFormat(card['card-updated-at'], DATE_FORMAT, locale)}
|
|
27
27
|
</Text>
|
|
28
28
|
</View>
|
|
29
|
-
<
|
|
30
|
-
<TouchableOpacity onPress={() => share(slug, 'card')}>
|
|
31
|
-
<ShareIcon />
|
|
32
|
-
</TouchableOpacity>
|
|
33
|
-
</View>
|
|
29
|
+
<ShareButton story={story} type={'card'} slug={slug} containerStyle={styles.shareIcon} />
|
|
34
30
|
</View>
|
|
35
31
|
);
|
|
36
32
|
};
|
|
@@ -68,11 +64,10 @@ const getStoryCards = (
|
|
|
68
64
|
navigation,
|
|
69
65
|
isLiveBlog,
|
|
70
66
|
DATE_FORMAT,
|
|
71
|
-
|
|
67
|
+
story,
|
|
72
68
|
storyType,
|
|
73
69
|
isListicleStory,
|
|
74
70
|
bulletType,
|
|
75
|
-
storyHasAccess,
|
|
76
71
|
styles,
|
|
77
72
|
currentLayout,
|
|
78
73
|
getAd,
|
|
@@ -80,7 +75,7 @@ const getStoryCards = (
|
|
|
80
75
|
) => cards.map((card, index, source) => (
|
|
81
76
|
<View key={card?.id}>
|
|
82
77
|
{isLiveBlog
|
|
83
|
-
&& getLiveBlogTimeStamp(card, DATE_FORMAT,
|
|
78
|
+
&& getLiveBlogTimeStamp(card, DATE_FORMAT, story, styles, locale)}
|
|
84
79
|
|
|
85
80
|
{isListicleStory && index !== 0 && (
|
|
86
81
|
<View style={styles.listicleContainer}>
|
|
@@ -116,7 +111,7 @@ const getStoryCards = (
|
|
|
116
111
|
linkedStories={linkedStories}
|
|
117
112
|
screenList={screenList}
|
|
118
113
|
navigation={navigation}
|
|
119
|
-
|
|
114
|
+
story={story}
|
|
120
115
|
storyType={storyType}
|
|
121
116
|
currentLayout={currentLayout}
|
|
122
117
|
/>
|
|
@@ -137,7 +132,6 @@ export const Story = ({
|
|
|
137
132
|
onFbCommentPress,
|
|
138
133
|
screenList,
|
|
139
134
|
navigation,
|
|
140
|
-
share,
|
|
141
135
|
accessComponent,
|
|
142
136
|
checkStoryAccess,
|
|
143
137
|
enableFbComments,
|
|
@@ -231,11 +225,10 @@ export const Story = ({
|
|
|
231
225
|
navigation,
|
|
232
226
|
isLiveBlog,
|
|
233
227
|
DATE_FORMAT,
|
|
234
|
-
|
|
228
|
+
story,
|
|
235
229
|
storyType,
|
|
236
230
|
isListicleStory,
|
|
237
231
|
bulletType,
|
|
238
|
-
storyHasAccess,
|
|
239
232
|
styles,
|
|
240
233
|
currentLayout,
|
|
241
234
|
getAd,
|
|
@@ -267,7 +260,6 @@ Story.propTypes = {
|
|
|
267
260
|
onAuthorPress: PropTypes.func,
|
|
268
261
|
onTagsPress: PropTypes.func,
|
|
269
262
|
onSectionPress: PropTypes.func,
|
|
270
|
-
share: PropTypes.func,
|
|
271
263
|
storyHasAccess: PropTypes.string,
|
|
272
264
|
checkStoryAccess: PropTypes.func,
|
|
273
265
|
getAd: PropTypes.func,
|
|
@@ -13,7 +13,7 @@ const StoryCardDetailsRowBase = ({ authorName, publishedAt, readTime }) => {
|
|
|
13
13
|
locale,
|
|
14
14
|
reverseTimeAdverbPosition,
|
|
15
15
|
DATE_TIME_FORMAT,
|
|
16
|
-
storyCardOptions,
|
|
16
|
+
storyCardOptions = {},
|
|
17
17
|
} = theme;
|
|
18
18
|
const translate = get(theme, ["translate"], (word) => word);
|
|
19
19
|
|
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
STORY_ELEMENT_TYPES,
|
|
8
8
|
STORY_ELEMENT_METADATA_TYPES,
|
|
9
9
|
} from '../../constants';
|
|
10
|
-
import { stripHTML } from '../../utils';
|
|
11
10
|
import { DailyMotionPlayer } from '../DailyMotionPlayer';
|
|
12
11
|
|
|
13
12
|
export const StoryContent = ({
|
|
@@ -16,7 +15,7 @@ export const StoryContent = ({
|
|
|
16
15
|
linkedStories,
|
|
17
16
|
screenList,
|
|
18
17
|
navigation,
|
|
19
|
-
|
|
18
|
+
story,
|
|
20
19
|
storyType,
|
|
21
20
|
currentLayout,
|
|
22
21
|
}) => {
|
|
@@ -73,7 +72,7 @@ export const StoryContent = ({
|
|
|
73
72
|
<AllComponents.StoryImage
|
|
74
73
|
cdn={cdn}
|
|
75
74
|
card={storyElement}
|
|
76
|
-
|
|
75
|
+
story={story}
|
|
77
76
|
storyType={storyType}
|
|
78
77
|
currentLayout={currentLayout}
|
|
79
78
|
/>
|
|
@@ -81,7 +80,7 @@ export const StoryContent = ({
|
|
|
81
80
|
case STORY_ELEMENT_TYPES.YOUTUBE_VIDEO:
|
|
82
81
|
return <AllComponents.YouTubePlayer card={storyElement} />;
|
|
83
82
|
case STORY_ELEMENT_TYPES.FILE:
|
|
84
|
-
return <AllComponents.PDFReader card={storyElement}
|
|
83
|
+
return <AllComponents.PDFReader card={storyElement} story={story} />;
|
|
85
84
|
case STORY_ELEMENT_TYPES.DATA:
|
|
86
85
|
return <AllComponents.Table card={storyElement} />;
|
|
87
86
|
case STORY_ELEMENT_TYPES.COMPOSITE:
|
|
@@ -120,7 +119,7 @@ export const StoryContent = ({
|
|
|
120
119
|
StoryContent.propTypes = {
|
|
121
120
|
storyElement: PropTypes.any.isRequired,
|
|
122
121
|
cdn: PropTypes.string.isRequired,
|
|
123
|
-
|
|
122
|
+
story: PropTypes.any.isRequired,
|
|
124
123
|
storyType: PropTypes.string,
|
|
125
124
|
linkedStories: PropTypes.any,
|
|
126
125
|
screenList: PropTypes.object,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import React, { useContext } from 'react';
|
|
3
|
-
import { View
|
|
4
|
-
import {
|
|
3
|
+
import { View } from 'react-native';
|
|
4
|
+
import { ShareButton } from '../index';
|
|
5
5
|
import { AppTheme, getScreenPercentageWidth, stripHTML } from '../../utils';
|
|
6
6
|
import { Text } from '../index';
|
|
7
7
|
import { LightBoxImage } from '../LightBoxImage';
|
|
8
8
|
import { storyImageStyles } from './styles';
|
|
9
9
|
|
|
10
10
|
export const StoryImage = ({
|
|
11
|
-
card, cdn,
|
|
11
|
+
card, cdn, story, storyType, currentLayout,
|
|
12
12
|
}) => {
|
|
13
13
|
const slug = `?cardId=${card.id}`;
|
|
14
14
|
const sharePhotoCard = storyType === 'photo';
|
|
@@ -35,9 +35,7 @@ export const StoryImage = ({
|
|
|
35
35
|
</Text>
|
|
36
36
|
</View>
|
|
37
37
|
{sharePhotoCard && (
|
|
38
|
-
<
|
|
39
|
-
<ShareIcon />
|
|
40
|
-
</TouchableOpacity>
|
|
38
|
+
<ShareButton story={story} type={'image'} slug={slug} />
|
|
41
39
|
)}
|
|
42
40
|
</View>
|
|
43
41
|
</>
|
|
@@ -47,7 +45,7 @@ export const StoryImage = ({
|
|
|
47
45
|
StoryImage.propTypes = {
|
|
48
46
|
card: PropTypes.any.isRequired,
|
|
49
47
|
cdn: PropTypes.string.isRequired,
|
|
50
|
-
|
|
48
|
+
story: PropTypes.any.isRequired,
|
|
51
49
|
currentLayout: PropTypes.object,
|
|
52
50
|
storyType: PropTypes.string,
|
|
53
51
|
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { AppTheme } from '../../utils';
|
|
2
|
-
import React, { useContext } from 'react';
|
|
3
|
-
import Svg, { Path } from 'react-native-svg';
|
|
4
|
-
|
|
5
|
-
export const ShareIcon = (props) => {
|
|
6
|
-
const { theme } = useContext(AppTheme);
|
|
7
|
-
const { COLORS } = theme;
|
|
8
|
-
return (
|
|
9
|
-
<Svg width={24} height={24} {...props}>
|
|
10
|
-
<Path
|
|
11
|
-
fill={COLORS.BRAND_BLACK}
|
|
12
|
-
fillRule="evenodd"
|
|
13
|
-
d="M15.843 3.189c-1.478 0-2.689 1.239-2.689 2.75 0 .293.046.58.13.846L8.844 9.31a2.636 2.636 0 00-1.687-.621c-1.477 0-2.688 1.238-2.688 2.75 0 1.51 1.21 2.75 2.688 2.75a2.63 2.63 0 001.687-.615l4.446 2.525a2.759 2.759 0 00-.136.84c0 1.51 1.211 2.75 2.689 2.75 1.477 0 2.688-1.24 2.688-2.75 0-1.512-1.21-2.75-2.688-2.75a2.66 2.66 0 00-1.907.82l-4.323-2.46a2.757 2.757 0 000-2.221l4.317-2.459c.488.506 1.168.82 1.913.82 1.477 0 2.688-1.239 2.688-2.75s-1.21-2.75-2.688-2.75z"
|
|
14
|
-
/>
|
|
15
|
-
</Svg>
|
|
16
|
-
)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|