@quintype/native-components 2.20.0-fix-rtl-issues.1 → 2.20.1-temp-fast-image-constraint.1

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.
Files changed (34) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/package.json +2 -2
  3. package/src/Icons/ClockIcon/index.js +9 -5
  4. package/src/components/ActionText/ActionText.js +7 -9
  5. package/src/components/ActionText/ActionText.test.js +5 -12
  6. package/src/components/AlsoRead/index.js +1 -1
  7. package/src/components/AlsoRead/styles.js +2 -0
  8. package/src/components/AuthorRow/AuthorRow.test.js +4 -9
  9. package/src/components/AuthorRow/index.js +23 -21
  10. package/src/components/BackNavigator/styles.js +2 -0
  11. package/src/components/Button/index.js +13 -9
  12. package/src/components/CustomSwitch/index.js +16 -10
  13. package/src/components/Header/index.js +13 -9
  14. package/src/components/PrimaryStoryCard/index.js +43 -18
  15. package/src/components/PrimaryStoryCard/styles.js +29 -5
  16. package/src/components/PrimaryStoryCardNew/index.js +64 -26
  17. package/src/components/PrimaryStoryCardNew/styles.js +29 -5
  18. package/src/components/RadioButton/index.js +24 -9
  19. package/src/components/SecondaryStoryCard/index.js +46 -16
  20. package/src/components/SecondaryStoryCard/styles.js +29 -4
  21. package/src/components/SecondaryStoryCardNew/index.js +69 -26
  22. package/src/components/SecondaryStoryCardNew/styles.js +28 -4
  23. package/src/components/ShareButton/index.js +18 -14
  24. package/src/components/StoryHeader/index.js +5 -5
  25. package/src/components/StoryHeader/styles.js +1 -1
  26. package/src/components/StoryImage/index.js +1 -1
  27. package/src/components/StoryText/index.js +3 -1
  28. package/src/components/Table/index.js +1 -1
  29. package/src/components/Table/styles.js +5 -2
  30. package/src/components/TextQandA/styles.js +3 -3
  31. package/src/constants/component-constants/content-constants/constants.js +7 -5
  32. package/src/constants/component-constants/general-constants/constants.js +22 -14
  33. package/src/constants/renderHTML.js +10 -0
  34. package/src/utils/timeUtils.js +2 -2
@@ -1,7 +1,7 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React, { useContext } from 'react';
3
3
  import {
4
- View, StyleSheet, Linking, Text,
4
+ View, StyleSheet, Linking, Text, I18nManager,
5
5
  } from 'react-native';
6
6
  import HTML from 'react-native-render-html';
7
7
  import { AppTheme } from '../../utils/context';
@@ -21,8 +21,10 @@ export const StoryText = (props) => {
21
21
  {
22
22
  fontFamily: FONT_FAMILY.secondary,
23
23
  fontWeight: props.question ? '600' : 'normal',
24
+ writingDirection: I18nManager.isRTL ? 'rtl' : 'ltr',
24
25
  },
25
26
  ]);
27
+
26
28
  const customTagsStyles = customHTMLStyles();
27
29
 
28
30
  return (
@@ -27,7 +27,7 @@ export const Table = ({ card }) => {
27
27
  <View style={styles.tableRow}>
28
28
  {headerFields.map((headerField) => (
29
29
  <View style={styles.tableHeaderTitle}>
30
- <Text>{data[headerField]}</Text>
30
+ <Text style={styles.tableContect}>{data[headerField]}</Text>
31
31
  </View>
32
32
  ))}
33
33
  </View>
@@ -1,5 +1,4 @@
1
1
  import { StyleSheet } from 'react-native';
2
-
3
2
  export const tableStyles = ({ COLORS }) => StyleSheet.create({
4
3
  container: {
5
4
  flexDirection: 'row',
@@ -15,6 +14,7 @@ export const tableStyles = ({ COLORS }) => StyleSheet.create({
15
14
  justifyContent: 'center',
16
15
  borderWidth: 0.5,
17
16
  borderColor: COLORS.BRAND_4,
17
+ color: COLORS.BRAND_4,
18
18
  },
19
19
  tableBody: {
20
20
  flexDirection: 'column',
@@ -22,4 +22,7 @@ export const tableStyles = ({ COLORS }) => StyleSheet.create({
22
22
  tableRow: {
23
23
  flexDirection: 'row',
24
24
  },
25
- });
25
+ tableContect: {
26
+ color: COLORS.BRAND_BLACK,
27
+ },
28
+ });
@@ -8,13 +8,13 @@ export const textQandAStyles = (COLORS, FONT_SIZE) => StyleSheet.create({
8
8
  fontSize: FONT_SIZE.h2,
9
9
  fontWeight: '600',
10
10
  lineHeight: FONT_SIZE.h2 * 1.3,
11
- color: COLORS.BRAND_8,
12
- opacity: 0.8
11
+ color: COLORS.BRAND_BLACK,
12
+ opacity: 0.8,
13
13
  },
14
14
  answerText: {
15
15
  fontSize: FONT_SIZE.h2,
16
16
  lineHeight: FONT_SIZE.h2 * 1.3,
17
17
  color: COLORS.BRAND_BLACK,
18
- opacity: 0.8
18
+ opacity: 0.8,
19
19
  },
20
20
  });
@@ -1,7 +1,9 @@
1
1
  export const COMP_CONTENT_CONSTANTS = {
2
- storyTitle: 'COMP_STORY_TITLE',
3
- storySubTitle: 'COMP_STORY_SUBTITLE',
4
- sectionName: 'COMP_STORY_SECTION_NAME',
5
- publishedDate: 'COMP_STORY_PUBLISHED_DATE',
6
- relatedStoriesLabel: 'COMP_STORY_RELATEDSTORIES_LABEL',
2
+ storyTitle: "COMP_STORY_TITLE",
3
+ storySubTitle: "COMP_STORY_SUBTITLE",
4
+ sectionName: "COMP_STORY_SECTION_NAME",
5
+ publishedDate: "COMP_STORY_PUBLISHED_DATE",
6
+ relatedStoriesLabel: "COMP_STORY_RELATEDSTORIES_LABEL",
7
+ authorName: "COMP_STORY_AUTHOR_NAME",
8
+ authorImage: "COMP_STORY_AUTHOR_IMAGE",
7
9
  };
@@ -1,16 +1,24 @@
1
1
  export const COMP_GENERAL_CONSTANTS = {
2
- secondaryStoryCard: 'COMP_GENERAL_SECONDARY_STORY',
3
- primaryStoryCard: 'COMP_GENERAL_PRIMARY_STORY',
4
- secondaryStoryAuthor: 'COMP_GENERAL_SECONDARY_STORY_AUTHOR',
5
- secondaryStoryPubishedAt: 'COMP_GENERAL_SECONDARY_STORY_PUBLISHEDATE',
6
- primaryStoryAuthor: 'COMP_GENERAL_PRIMARY_STORY_AUTHOR',
7
- primaryStoryPubishedAt: 'COMP_GENERAL_PRIMARY_STORY_PUBLISHEDATE',
8
- secondaryStoryHeadline: 'COMP_GENERAL_SECONDARY_STORY_HEADLINE',
9
- primaryStoryHeadline: 'COMP_GENERAL_PRIMARY_STORY_HEADLINE',
10
- iconTextTouch: 'COMP_GENERAL_ICON_TEXT_TOUCH',
11
- iconTextLabel: 'COMP_GENERAL_ICON_TEXT_LABEL',
12
- collectionTitleTouch: 'COMP_GENERAL_COLLECTION_TITLE',
13
- collectionTitleText: 'COMP_GENERAL_COLLECTION_TITLE_TEXT',
14
- backNavigatorText: 'COMP_GENERAL_BACK_NAVIGATOR_TEXT',
15
- backNavigatorTouch: 'COMP_GENERAL_BACK_NAVIGATOR_TOUCH',
2
+ secondaryStoryCard: "COMP_GENERAL_SECONDARY_STORY",
3
+ primaryStoryCard: "COMP_GENERAL_PRIMARY_STORY",
4
+ secondaryStoryAuthor: "COMP_GENERAL_SECONDARY_STORY_AUTHOR",
5
+ secondaryStoryPubishedAt: "COMP_GENERAL_SECONDARY_STORY_PUBLISHEDATE",
6
+ primaryStoryAuthor: "COMP_GENERAL_PRIMARY_STORY_AUTHOR",
7
+ primaryStoryPubishedAt: "COMP_GENERAL_PRIMARY_STORY_PUBLISHEDATE",
8
+ secondaryStoryHeadline: "COMP_GENERAL_SECONDARY_STORY_HEADLINE",
9
+ primaryStoryHeadline: "COMP_GENERAL_PRIMARY_STORY_HEADLINE",
10
+ iconTextTouch: "COMP_GENERAL_ICON_TEXT_TOUCH",
11
+ iconTextLabel: "COMP_GENERAL_ICON_TEXT_LABEL",
12
+ collectionTitleTouch: "COMP_GENERAL_COLLECTION_TITLE",
13
+ collectionTitleText: "COMP_GENERAL_COLLECTION_TITLE_TEXT",
14
+ backNavigatorText: "COMP_GENERAL_BACK_NAVIGATOR_TEXT",
15
+ backNavigatorTouch: "COMP_GENERAL_BACK_NAVIGATOR_TOUCH",
16
+ customSwitch: "COMP_GENERAL_CUSTOM_SWITCH",
17
+ primaryStoryReadTime: "COMP_GENERAL_PRIMARY_STORY_READTIME",
18
+ secondaryStoryReadTime: "COMP_GENERAL_SECONDARY_STORY_READTIME",
19
+ actionTextTouch: "COMP_GENERAL_ACTION_TEXT_TOUCH",
20
+ buttonTouch: "COMP_GENERAL_BUTTON_TOUCH",
21
+ headerLogoTouch: "COMP_GENERAL_HEADER_LOGO_TOUCH",
22
+ radioButtonTouch: "COMP_GENERAL_RADIO",
23
+ shareButtonTouch: "COMP_GENERAL_SHARE",
16
24
  };
@@ -59,5 +59,15 @@ export const customHTMLStyles = () => {
59
59
  color: COLORS.BRAND_BLACK,
60
60
  opacity: 0.85,
61
61
  },
62
+ sup: {
63
+ marginBottom: 16,
64
+ lineHeight: FONT_SIZE.p1 * 0.3,
65
+ fontSize: FONT_SIZE.p1 * 0.5,
66
+ },
67
+ sub: {
68
+ marginBottom: 16,
69
+ lineHeight: FONT_SIZE.p1 * 0.3,
70
+ fontSize: FONT_SIZE.p1 * 0.5,
71
+ },
62
72
  };
63
73
  };
@@ -15,14 +15,14 @@ export function getTimeInFormat(date, format, localTime) {
15
15
  return '';
16
16
  }
17
17
 
18
- export const getTimeForStoryCards = (date, format, localTime) => {
18
+ export const getTimeForStoryCards = (date, format, localTime, translate) => {
19
19
  if (date) {
20
20
  const currentDate = new Date();
21
21
  const dateToFormat = new Date(date);
22
22
  const locale = dateFNSlocale[localTime];
23
23
  const distanceInMinutes = differenceInMinutes(currentDate, dateToFormat);
24
24
  if (distanceInMinutes <= 1440) {
25
- return `published ${formatDistanceToNow(dateToFormat, { locale })} ago`;
25
+ return `${translate("published")} ${formatDistanceToNow(dateToFormat, { locale })} ${translate("ago")}`;
26
26
  }
27
27
  return dateFormat(dateToFormat, format, { locale });
28
28
  }