@quintype/native-components 2.30.13 → 2.30.15

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quintype/native-components",
3
- "version": "2.30.13",
3
+ "version": "2.30.15",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -18,13 +18,20 @@ export const AuthorRow = ({
18
18
  disablePress,
19
19
  }) => {
20
20
  const { theme } = useContext(AppTheme);
21
- const { COLORS, translate, enableReadTimeOnStoryScreen } = theme;
21
+ const { COLORS, translate, enableReadTimeOnStoryScreen, hideAuthorName } = theme;
22
22
  const styles = authorRowStyleSheet(theme);
23
+ const shouldShowAuthors = !hideAuthorName;
24
+ const shouldShowReadTime = Boolean(enableReadTimeOnStoryScreen && readtime);
25
+ const readTimeLabel = `${shouldShowAuthors ? '| ' : ''}${readtime} ${translate(
26
+ 'min read',
27
+ )}`;
28
+
29
+ if (!shouldShowAuthors && !shouldShowReadTime) return null;
23
30
 
24
31
  return (
25
32
  <View style={styles.authorRow}>
26
- {authors?.map((author) => {
27
- const avatarUrl = author?.['avatar-s3-key'] ? `${cdn}/${author?.['avatar-s3-key']}` : author?.['avatar-url'] ?? null;
33
+ {shouldShowAuthors && authors?.map((author) => {
34
+ const avatarUrl = author?.['avatar-s3-key'] ? `${cdn}/${author?.['avatar-s3-key']}` : author?.['avatar-url'] ?? null;
28
35
  if (!author.name) {
29
36
  return null;
30
37
  }
@@ -71,12 +78,10 @@ export const AuthorRow = ({
71
78
  </View>
72
79
  );
73
80
  })}
74
- {enableReadTimeOnStoryScreen && readtime ? (
81
+ {shouldShowReadTime ? (
75
82
  <View style={styles.readtimeComponent}>
76
83
  <Text style={styles.readtime}>
77
- {`| ${readtime} ${translate(
78
- 'min read',
79
- )}`}
84
+ {readTimeLabel}
80
85
  </Text>
81
86
  </View>
82
87
  ) : null}
@@ -8,7 +8,7 @@ export const relatedStoriesStyles = (appThemeContext) => {
8
8
  fontFamily: FONT_FAMILY.secondaryBold,
9
9
  color: COLORS.BRAND_BLACK,
10
10
  writingDirection: I18nManager.isRTL ? 'rtl' : 'ltr',
11
- paddingHorizontal:5,
11
+ paddingHorizontal: 12,
12
12
  marginVertical: 8,
13
13
  },
14
14
  relatedStoriesContainer: {