@quintype/native-components 2.29.6 → 2.29.7
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);
|
|
@@ -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
|
};
|