@quintype/native-components 2.20.28 → 2.20.30
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/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [2.20.30](https://github.com/quintype/native-components/compare/v2.20.29...v2.20.30) (2024-06-04)
|
|
6
|
+
|
|
7
|
+
### [2.20.29](https://github.com/quintype/native-components/compare/v2.20.28...v2.20.29) (2024-06-04)
|
|
8
|
+
|
|
5
9
|
### [2.20.28](https://github.com/quintype/native-components/compare/v2.20.27...v2.20.28) (2024-05-17)
|
|
6
10
|
|
|
7
11
|
### [2.20.27](https://github.com/quintype/native-components/compare/v2.20.26...v2.20.27) (2024-05-17)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quintype/native-components",
|
|
3
|
-
"version": "2.20.
|
|
3
|
+
"version": "2.20.30",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
"react-native-pdf": "^5.1.4",
|
|
24
24
|
"react-native-render-html": "^4.2.3",
|
|
25
25
|
"react-native-share": "^8.1.0",
|
|
26
|
-
"rn-fetch-blob": "^0.10.16"
|
|
26
|
+
"rn-fetch-blob": "^0.10.16",
|
|
27
|
+
"react-native-star-rating-widget": "^1.7.3"
|
|
27
28
|
},
|
|
28
29
|
"peerDependencies": {
|
|
29
30
|
"@react-navigation/native": ">=5.7.3",
|
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import Icon from "react-native-vector-icons/
|
|
3
|
-
import
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
|
+
import Icon from "react-native-vector-icons/FontAwesome";
|
|
3
|
+
import { AppTheme } from "../../utils";
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
export const FallbackIcon = () => {
|
|
6
|
+
const { theme } = useContext(AppTheme);
|
|
7
|
+
const { COLORS } = theme;
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
<Icon
|
|
9
|
-
name="images"
|
|
10
|
-
size={size}
|
|
11
|
-
color={color}
|
|
12
|
-
/>
|
|
13
|
-
);
|
|
14
|
-
|
|
15
|
-
FallbackIcon.propTypes = {
|
|
16
|
-
size: PropTypes.number,
|
|
17
|
-
color: PropTypes.string,
|
|
9
|
+
return <Icon name="image" size={25} color={COLORS.MONO4} />;
|
|
18
10
|
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import PropTypes from "prop-types";
|
|
2
|
+
import React, { useContext } from "react";
|
|
3
|
+
import { View } from "react-native";
|
|
4
|
+
import { Text } from "../Text";
|
|
5
|
+
import {ratingStyles} from './styles'
|
|
6
|
+
import { AppTheme } from "../../utils";
|
|
7
|
+
import { StarRatingDisplay } from 'react-native-star-rating-widget';
|
|
8
|
+
|
|
9
|
+
export const RatingLayout = ({ reviewTitle, ratingValue, ratingLabel }) => {
|
|
10
|
+
const { theme } = useContext(AppTheme);
|
|
11
|
+
const {
|
|
12
|
+
COLORS, FONT_FAMILY, FONT_SIZE
|
|
13
|
+
} = theme;
|
|
14
|
+
const styles = ratingStyles(COLORS, FONT_SIZE, FONT_FAMILY);
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<View style={styles.container}>
|
|
18
|
+
{reviewTitle && <Text
|
|
19
|
+
style={styles.reviewTitle}
|
|
20
|
+
>
|
|
21
|
+
{reviewTitle}
|
|
22
|
+
</Text>}
|
|
23
|
+
{ratingValue && <View style={styles.child}>
|
|
24
|
+
<Text
|
|
25
|
+
style={styles.ratingLabel}
|
|
26
|
+
>
|
|
27
|
+
{`${ratingLabel}/5`}
|
|
28
|
+
</Text>
|
|
29
|
+
<StarRatingDisplay
|
|
30
|
+
rating={ratingValue}
|
|
31
|
+
starSize={FONT_SIZE.title}
|
|
32
|
+
color={COLORS.REVIEW_STAR_COLOR ?? '#F5A623'}
|
|
33
|
+
style={styles.starContiner}
|
|
34
|
+
starStyle={styles.starStyle}
|
|
35
|
+
/>
|
|
36
|
+
</View>}
|
|
37
|
+
</View>
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
RatingLayout.propTypes = {
|
|
42
|
+
reviewTitle: PropTypes.string.isRequired,
|
|
43
|
+
ratingValue: PropTypes.number.isRequired,
|
|
44
|
+
ratingLabel: PropTypes.string.isRequired
|
|
45
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
|
|
3
|
+
export const ratingStyles = (COLORS, FONT_SIZE, FONT_FAMILY) => StyleSheet.create({
|
|
4
|
+
container: { marginLeft: 10, marginTop: 10 },
|
|
5
|
+
reviewTitle: {
|
|
6
|
+
fontSize: FONT_SIZE.h2,
|
|
7
|
+
fontWeight: "700",
|
|
8
|
+
lineHeight: 24,
|
|
9
|
+
fontFamily: FONT_FAMILY.primary,
|
|
10
|
+
color: COLORS.BRAND_BLACK,
|
|
11
|
+
marginBottom:7
|
|
12
|
+
},
|
|
13
|
+
child: { display: "flex", flexDirection: "row", alignItems: "center"},
|
|
14
|
+
ratingLabel: {
|
|
15
|
+
fontSize: FONT_SIZE.h2,
|
|
16
|
+
fontWeight: "700",
|
|
17
|
+
lineHeight: 24,
|
|
18
|
+
fontFamily: FONT_FAMILY.secondary,
|
|
19
|
+
color: COLORS.BRAND_BLACK,
|
|
20
|
+
},
|
|
21
|
+
starContainer: { marginLeft: 10 },
|
|
22
|
+
starStyle: { marginHorizontal: 0 }
|
|
23
|
+
});
|
|
@@ -33,7 +33,7 @@ const ResponsiveImageBase = (props) => {
|
|
|
33
33
|
|
|
34
34
|
const placeholderStyle = {
|
|
35
35
|
...StyleSheet.absoluteFillObject,
|
|
36
|
-
backgroundColor: CustomFallBackBackground
|
|
36
|
+
backgroundColor: (CustomFallBackIcon && CustomFallBackBackground) ?? COLORS.MONO6,
|
|
37
37
|
justifyContent: 'center',
|
|
38
38
|
alignItems: 'center',
|
|
39
39
|
};
|
|
@@ -18,6 +18,7 @@ import { storyHeaderStyles } from './styles';
|
|
|
18
18
|
import { COMP_CONTENT_CONSTANTS } from '../../constants/component-constants/content-constants/constants';
|
|
19
19
|
|
|
20
20
|
import { DailyMotionPlayer } from '../DailyMotionPlayer';
|
|
21
|
+
import { RatingLayout } from '../Rating';
|
|
21
22
|
const getHeroImage = (cdn, story) => {
|
|
22
23
|
const imageSlug = story['hero-image-s3-key'];
|
|
23
24
|
if (!imageSlug) return null;
|
|
@@ -73,7 +74,8 @@ export const StoryHeader = (props) => {
|
|
|
73
74
|
const caption = story['hero-image-caption'];
|
|
74
75
|
const attribution = story['hero-image-attribution'];
|
|
75
76
|
const isPremiumStory = story['access'] === 'subscription';
|
|
76
|
-
|
|
77
|
+
const reviewTitle = story['metadata'] && story['metadata']['review-title'];
|
|
78
|
+
const reviewData = story['metadata'] && story['metadata']['review-rating'];
|
|
77
79
|
|
|
78
80
|
const showAttribution = () => {
|
|
79
81
|
if (!caption && !attribution) {
|
|
@@ -128,6 +130,7 @@ export const StoryHeader = (props) => {
|
|
|
128
130
|
cdn={props.cdn}
|
|
129
131
|
readtime={story['read-time']}
|
|
130
132
|
/>
|
|
133
|
+
{reviewTitle && <RatingLayout reviewTitle={reviewTitle} ratingValue={reviewData?.value} ratingLabel={reviewData?.label}/>}
|
|
131
134
|
</View>
|
|
132
135
|
);
|
|
133
136
|
};
|