@quintype/native-components 2.29.5 → 2.29.6-beta.0
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
CHANGED
|
@@ -13,7 +13,7 @@ const ShareButtonBase = (props) => {
|
|
|
13
13
|
const { theme } = useContext(AppTheme);
|
|
14
14
|
const styles = shareButtonStyles(theme);
|
|
15
15
|
const { storyCardOptions = {} } = theme;
|
|
16
|
-
const { story, type = 'story', slug, containerStyle, inListingStoryCard = false } = props;
|
|
16
|
+
const { story, type = 'story', slug, containerStyle, size, inListingStoryCard = false, onShare } = props;
|
|
17
17
|
|
|
18
18
|
const getShareURL = () => {
|
|
19
19
|
const { url } = story || {};
|
|
@@ -52,18 +52,18 @@ const ShareButtonBase = (props) => {
|
|
|
52
52
|
const renderIcon = () => {
|
|
53
53
|
switch (storyCardOptions.shareButtonIcon) {
|
|
54
54
|
case 'right-arrow':
|
|
55
|
-
return <IconAlt style={styles.iconStyle} name="share-outline" size={20} />;
|
|
55
|
+
return <IconAlt style={styles.iconStyle} name="share-outline" size={size ?? 20} />;
|
|
56
56
|
case 'up-arrow':
|
|
57
|
-
return <Icon style={styles.iconStyle} name="share-outline" size={20} />;
|
|
57
|
+
return <Icon style={styles.iconStyle} name="share-outline" size={size ?? 20} />;
|
|
58
58
|
case 'classic':
|
|
59
59
|
default:
|
|
60
|
-
return <Icon style={styles.iconStyle} name="share-social-outline" size={20} />;
|
|
60
|
+
return <Icon style={styles.iconStyle} name="share-social-outline" size={size ?? 20} />;
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
63
|
|
|
64
64
|
return inListingStoryCard && !storyCardOptions.enableShareButton ? null : (
|
|
65
65
|
<TouchableOpacity
|
|
66
|
-
onPress={share}
|
|
66
|
+
onPress={onShare ?? share}
|
|
67
67
|
testID={COMP_GENERAL_CONSTANTS.shareButtonTouch}
|
|
68
68
|
style={containerStyle}
|
|
69
69
|
>
|
|
@@ -76,6 +76,9 @@ ShareButtonBase.propTypes = {
|
|
|
76
76
|
story: PropTypes.any,
|
|
77
77
|
type: PropTypes.string,
|
|
78
78
|
slug: PropTypes.string,
|
|
79
|
+
size: PropTypes.number,
|
|
80
|
+
inListingStoryCard: PropTypes.bool,
|
|
81
|
+
onShare: PropTypes.func,
|
|
79
82
|
};
|
|
80
83
|
|
|
81
84
|
export const ShareButton = memo(ShareButtonBase);
|
|
@@ -95,7 +95,7 @@ const getStoryCards = (
|
|
|
95
95
|
|
|
96
96
|
{source.length > (storyType === STORY_TYPES.VIDEO_STORY ? 2 : 1)
|
|
97
97
|
&& isMiddleIndexOfArray(index, source)
|
|
98
|
-
&& getAd(true)}
|
|
98
|
+
&& getAd(true, "body")}
|
|
99
99
|
{/* ^ Requesting mid-content-ad if there are > 1 card
|
|
100
100
|
(> 2 cards in case of video story since the 1st card gets rendered in header). */}
|
|
101
101
|
|
|
@@ -108,7 +108,7 @@ const getStoryCards = (
|
|
|
108
108
|
{cards.length === 1
|
|
109
109
|
&& source.length > (storyType === STORY_TYPES.VIDEO_STORY ? 2 : 1)
|
|
110
110
|
&& isMiddleIndexOfArray(index, source)
|
|
111
|
-
&& getAd(true)}
|
|
111
|
+
&& getAd(true, "body")}
|
|
112
112
|
{/* ^ In the case of a story having just 1 card,
|
|
113
113
|
requesting mid-content-Ad if there are > 1 story-elements in that card
|
|
114
114
|
(> 2 story-elements in case of video story since the 1st story-element gets rendered in header). */}
|
|
@@ -419,7 +419,7 @@ export const Story = ({
|
|
|
419
419
|
</View>))}
|
|
420
420
|
|
|
421
421
|
|
|
422
|
-
{getAd()}
|
|
422
|
+
{getAd(false, "header")}
|
|
423
423
|
|
|
424
424
|
{getStoryCards(
|
|
425
425
|
cards,
|
|
@@ -16,7 +16,7 @@ export const Text = (props) => {
|
|
|
16
16
|
};
|
|
17
17
|
const flattenedStyle = StyleSheet.flatten([RNStyle, props.style]);
|
|
18
18
|
|
|
19
|
-
const { ellipsizeMode, numberOfLines, testID } = props;
|
|
19
|
+
const { ellipsizeMode, numberOfLines, allowFontScaling, testID } = props;
|
|
20
20
|
|
|
21
21
|
const textData = I18nManager.isRTL ? `\u200F${props.children}` : props.children;
|
|
22
22
|
|
|
@@ -31,6 +31,7 @@ export const Text = (props) => {
|
|
|
31
31
|
testID={testID}
|
|
32
32
|
style={flattenedStyle}
|
|
33
33
|
fontFamily={RNStyle.fontFamily}
|
|
34
|
+
allowFontScaling={allowFontScaling}
|
|
34
35
|
>
|
|
35
36
|
{textData}
|
|
36
37
|
</RNText>
|
|
@@ -40,6 +41,7 @@ export const Text = (props) => {
|
|
|
40
41
|
Text.propTypes = TextProps && {
|
|
41
42
|
primary: PropTypes.bool,
|
|
42
43
|
ellipsizeMode: PropTypes.string,
|
|
44
|
+
allowFontScaling: PropTypes.bool,
|
|
43
45
|
testID: PropTypes.string,
|
|
44
46
|
numberOfLines: PropTypes.number,
|
|
45
47
|
};
|