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

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 (33) 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 +51 -17
  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 +52 -14
  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/Table/index.js +1 -1
  28. package/src/components/Table/styles.js +5 -2
  29. package/src/components/TextQandA/styles.js +3 -3
  30. package/src/constants/component-constants/content-constants/constants.js +7 -5
  31. package/src/constants/component-constants/general-constants/constants.js +22 -14
  32. package/src/constants/renderHTML.js +10 -0
  33. package/src/utils/timeUtils.js +2 -2
@@ -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
  }