@quintype/native-components 2.28.1 → 2.28.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/package.json +1 -1
- package/src/components/PDFReader/styles.js +1 -0
- package/src/components/RelatedStoriesCard/index.js +1 -1
- package/src/components/ResponsiveImage/index.js +39 -18
- package/src/components/SecondaryStoryCard/styles.js +0 -1
- package/src/components/ShareButton/index.js +1 -1
- package/src/components/StoryGallery/index.js +1 -1
- package/src/components/StoryGallery/styles.js +3 -0
- package/src/components/StoryTemplateIcon/index.js +1 -1
- package/src/components/StoryTemplateIcon/styles.js +1 -1
- package/src/components/index.js +2 -2
package/package.json
CHANGED
|
@@ -39,7 +39,7 @@ export const RelatedStoriesCard = ({
|
|
|
39
39
|
onPress: () => onStoryPress(secondaryStory),
|
|
40
40
|
key: secondaryStory?.id,
|
|
41
41
|
};
|
|
42
|
-
<SecondaryStoryCard
|
|
42
|
+
return <SecondaryStoryCard
|
|
43
43
|
{...storyCardProps}
|
|
44
44
|
iconComponent={<ShareButton story={secondaryStory} inListingStoryCard />}
|
|
45
45
|
imageWidth={getScreenPercentageWidth(28)}
|
|
@@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
|
|
|
2
2
|
import React, {
|
|
3
3
|
memo, useCallback, useContext, useState,
|
|
4
4
|
} from 'react';
|
|
5
|
-
import { StyleSheet, View } from 'react-native';
|
|
5
|
+
import { StyleSheet, View, ImageBackground } from 'react-native';
|
|
6
6
|
import FastImage from 'react-native-fast-image';
|
|
7
7
|
import Icon from 'react-native-vector-icons/FontAwesome';
|
|
8
8
|
import { FallbackIcon } from '../../Icons/FallBackIcon';
|
|
@@ -23,6 +23,18 @@ const ResponsiveImageBase = (props) => {
|
|
|
23
23
|
roundedImageCorners,
|
|
24
24
|
} = theme;
|
|
25
25
|
|
|
26
|
+
const flattenedBackgroudStyle = StyleSheet.flatten([
|
|
27
|
+
{marginTop: props.styles?.marginTop ?? 0},
|
|
28
|
+
roundedImageCorners && {
|
|
29
|
+
borderRadius: 12,
|
|
30
|
+
overflow: "hidden",
|
|
31
|
+
},
|
|
32
|
+
props.imageWidth && {
|
|
33
|
+
width: props.imageWidth,
|
|
34
|
+
height: (props.imageWidth * 9) / 16,
|
|
35
|
+
},
|
|
36
|
+
])
|
|
37
|
+
|
|
26
38
|
const flattenedImageStyle = StyleSheet.flatten([
|
|
27
39
|
styles.defaultImage,
|
|
28
40
|
props.styles,
|
|
@@ -30,15 +42,11 @@ const ResponsiveImageBase = (props) => {
|
|
|
30
42
|
width: props.imageWidth,
|
|
31
43
|
height: (props.imageWidth * 9) / 16,
|
|
32
44
|
},
|
|
33
|
-
props?.
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
roundedImageCorners && {
|
|
37
|
-
borderRadius: 12,
|
|
38
|
-
overflow: "hidden",
|
|
39
|
-
},
|
|
45
|
+
props.styles?.marginTop && { marginTop: 0 } ,
|
|
46
|
+
|
|
40
47
|
]);
|
|
41
48
|
|
|
49
|
+
|
|
42
50
|
const placeholderStyle = {
|
|
43
51
|
...StyleSheet.absoluteFillObject,
|
|
44
52
|
...props.styles,
|
|
@@ -47,6 +55,7 @@ const ResponsiveImageBase = (props) => {
|
|
|
47
55
|
justifyContent: "center",
|
|
48
56
|
alignItems: "center",
|
|
49
57
|
borderRadius: roundedImageCorners ? 12 : 0,
|
|
58
|
+
marginTop: 0
|
|
50
59
|
};
|
|
51
60
|
|
|
52
61
|
const fallBackIcon = CustomFallBackIcon ? (
|
|
@@ -55,13 +64,8 @@ const ResponsiveImageBase = (props) => {
|
|
|
55
64
|
<FallbackIcon />
|
|
56
65
|
);
|
|
57
66
|
|
|
58
|
-
let imageUrl = '';
|
|
59
67
|
|
|
60
|
-
|
|
61
|
-
imageUrl = getCustomResolutionImageURL(props, [1, 1]);
|
|
62
|
-
} else {
|
|
63
|
-
imageUrl = getImageURL(props);
|
|
64
|
-
}
|
|
68
|
+
let imageUrl = getImageURL(props)
|
|
65
69
|
|
|
66
70
|
const userFallback = () => <Icon name="user" size={20} />;
|
|
67
71
|
|
|
@@ -77,6 +81,11 @@ const ResponsiveImageBase = (props) => {
|
|
|
77
81
|
|
|
78
82
|
const onLoadHandler = useCallback(handleImageLoad, []);
|
|
79
83
|
|
|
84
|
+
const lowestQualitySourceURI = {
|
|
85
|
+
uri: decodeURIComponent(getImageURL(props,2)),
|
|
86
|
+
priority: FastImage.priority.high,
|
|
87
|
+
}
|
|
88
|
+
|
|
80
89
|
const sourceURI = {
|
|
81
90
|
uri: decodeURIComponent(imageUrl),
|
|
82
91
|
priority: FastImage.priority.high,
|
|
@@ -85,15 +94,27 @@ const ResponsiveImageBase = (props) => {
|
|
|
85
94
|
|
|
86
95
|
const preferredResizeMode = resizeImagesToFit ? FastImage.resizeMode.contain : FastImage.resizeMode.cover;
|
|
87
96
|
|
|
88
|
-
|
|
89
|
-
|
|
97
|
+
const ImageLayout = () => {
|
|
98
|
+
return (
|
|
90
99
|
<FastImage
|
|
91
100
|
style={flattenedImageStyle}
|
|
92
101
|
source={sourceURI}
|
|
93
|
-
|
|
94
|
-
resizeMode={props?.elementType === 'gallery' && !(props.hero) ? FastImage.resizeMode.contain : preferredResizeMode}
|
|
102
|
+
resizeMode={FastImage.resizeMode.contain}
|
|
95
103
|
{...props}
|
|
96
104
|
/>
|
|
105
|
+
)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return (
|
|
109
|
+
<View style={flattenedBackgroudStyle}>
|
|
110
|
+
<ImageBackground
|
|
111
|
+
source={lowestQualitySourceURI}
|
|
112
|
+
resizeMode='cover'
|
|
113
|
+
blurRadius={50}
|
|
114
|
+
onLoad={()=>setPlaceholder(false)}
|
|
115
|
+
>
|
|
116
|
+
<ImageLayout />
|
|
117
|
+
</ImageBackground>
|
|
97
118
|
{placeholder && (
|
|
98
119
|
<View style={placeholderStyle} testID={props.containerTestID}>
|
|
99
120
|
{showFallBackIcon()}
|
|
@@ -138,7 +138,7 @@ export const StoryGallery = ({ cdn, card }) => {
|
|
|
138
138
|
|
|
139
139
|
const style = galleryStyles.fullWidth;
|
|
140
140
|
return (
|
|
141
|
-
<TouchableOpacity>
|
|
141
|
+
<TouchableOpacity style={galleryStyles.subContainer}>
|
|
142
142
|
<LightBoxImage
|
|
143
143
|
onClickHandler={onPressHandler}
|
|
144
144
|
hero={!!data.metaData['focus-point']}
|
package/src/components/index.js
CHANGED
|
@@ -40,7 +40,7 @@ export { IconText } from './IconText';
|
|
|
40
40
|
export { CustomSwitch } from './CustomSwitch';
|
|
41
41
|
export { RelatedStoriesCard } from './RelatedStoriesCard';
|
|
42
42
|
export { References } from './References';
|
|
43
|
+
export { StoryTemplateIcon } from './StoryTemplateIcon'
|
|
43
44
|
export { StoryCardDetailsRow } from './StoryCardDetailsRow';
|
|
44
45
|
export { TextA } from './TextA'
|
|
45
|
-
export { TextQ } from './TextQ'
|
|
46
|
-
export { StoryTemplateIcon } from './StoryTemplateIcon'
|
|
46
|
+
export { TextQ } from './TextQ'
|