@quintype/native-components 2.20.30 → 2.20.32

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.32](https://github.com/quintype/native-components/compare/v2.20.31...v2.20.32) (2024-06-05)
6
+
7
+ ### [2.20.31](https://github.com/quintype/native-components/compare/v2.20.30...v2.20.31) (2024-06-04)
8
+
5
9
  ### [2.20.30](https://github.com/quintype/native-components/compare/v2.20.29...v2.20.30) (2024-06-04)
6
10
 
7
11
  ### [2.20.29](https://github.com/quintype/native-components/compare/v2.20.28...v2.20.29) (2024-06-04)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quintype/native-components",
3
- "version": "2.20.30",
3
+ "version": "2.20.32",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -1,45 +1,50 @@
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";
1
+ import PropTypes from 'prop-types';
2
+ import React, { useContext } from 'react';
3
+ import { View } from 'react-native';
7
4
  import { StarRatingDisplay } from 'react-native-star-rating-widget';
5
+ import { Text } from '../Text';
6
+ import { ratingStyles } from './styles';
7
+ import { AppTheme } from '../../utils';
8
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
- );
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 && (
19
+ <Text
20
+ style={styles.reviewTitle}
21
+ primary
22
+ >
23
+ {reviewTitle}
24
+ </Text>
25
+ )}
26
+ {ratingValue && (
27
+ <View style={styles.child}>
28
+ <Text
29
+ style={styles.ratingLabel}
30
+ >
31
+ {`${ratingLabel}/5`}
32
+ </Text>
33
+ <StarRatingDisplay
34
+ rating={ratingValue}
35
+ starSize={FONT_SIZE.title}
36
+ color={COLORS.REVIEW_STAR_COLOR ?? '#F5A623'}
37
+ style={styles.starContiner}
38
+ starStyle={styles.starStyle}
39
+ />
40
+ </View>
41
+ )}
42
+ </View>
43
+ );
39
44
  };
40
45
 
41
46
  RatingLayout.propTypes = {
42
47
  reviewTitle: PropTypes.string.isRequired,
43
48
  ratingValue: PropTypes.number.isRequired,
44
- ratingLabel: PropTypes.string.isRequired
49
+ ratingLabel: PropTypes.string.isRequired,
45
50
  };
@@ -4,20 +4,18 @@ export const ratingStyles = (COLORS, FONT_SIZE, FONT_FAMILY) => StyleSheet.creat
4
4
  container: { marginLeft: 10, marginTop: 10 },
5
5
  reviewTitle: {
6
6
  fontSize: FONT_SIZE.h2,
7
- fontWeight: "700",
8
7
  lineHeight: 24,
9
8
  fontFamily: FONT_FAMILY.primary,
10
9
  color: COLORS.BRAND_BLACK,
11
- marginBottom:7
10
+ marginBottom: 7,
12
11
  },
13
- child: { display: "flex", flexDirection: "row", alignItems: "center"},
12
+ child: { display: 'flex', flexDirection: 'row', alignItems: 'center' },
14
13
  ratingLabel: {
15
14
  fontSize: FONT_SIZE.h2,
16
- fontWeight: "700",
17
15
  lineHeight: 24,
18
16
  fontFamily: FONT_FAMILY.secondary,
19
17
  color: COLORS.BRAND_BLACK,
20
18
  },
21
19
  starContainer: { marginLeft: 10 },
22
- starStyle: { marginHorizontal: 0 }
20
+ starStyle: { marginHorizontal: 0 },
23
21
  });