@quintype/native-components 2.20.10 → 2.20.11
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 +2 -0
- package/package.json +1 -1
- package/src/components/PrimaryStoryCard/index.js +2 -1
- package/src/components/PrimaryStoryCardNew/index.js +2 -1
- package/src/components/SecondaryStoryCard/index.js +2 -1
- package/src/components/SecondaryStoryCardNew/index.js +2 -1
- package/src/components/StoryHeader/index.js +7 -3
- package/src/themes/theme.js +5 -0
- package/src/utils/context.js +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
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.11](https://github.com/quintype/native-components/compare/v2.20.10...v2.20.11) (2023-08-10)
|
|
6
|
+
|
|
5
7
|
### [2.20.10](https://github.com/quintype/native-components/compare/v2.20.9...v2.20.10) (2023-08-08)
|
|
6
8
|
|
|
7
9
|
|
package/package.json
CHANGED
|
@@ -30,9 +30,10 @@ export const PrimaryStoryCard = (props) => {
|
|
|
30
30
|
locale,
|
|
31
31
|
reverseTimeAdverbPosition,
|
|
32
32
|
enableReadTimeOnStoryCards,
|
|
33
|
+
DATE_TIME_FORMAT,
|
|
33
34
|
} = theme || {};
|
|
34
35
|
|
|
35
|
-
const DATE_FORMAT =
|
|
36
|
+
const DATE_FORMAT = DATE_TIME_FORMAT.dateFormat;
|
|
36
37
|
|
|
37
38
|
const styles = storyStyles(COLORS, FONT_SIZE);
|
|
38
39
|
const containerStyle = StyleSheet.flatten([
|
|
@@ -27,6 +27,7 @@ const PrimaryStoryCardNewBase = (props) => {
|
|
|
27
27
|
DARK_MODE,
|
|
28
28
|
reverseTimeAdverbPosition,
|
|
29
29
|
enableReadTimeOnStoryCards,
|
|
30
|
+
DATE_TIME_FORMAT,
|
|
30
31
|
} = theme || {};
|
|
31
32
|
|
|
32
33
|
const translate = get(theme, ['translate'], (word) => word);
|
|
@@ -45,7 +46,7 @@ const PrimaryStoryCardNewBase = (props) => {
|
|
|
45
46
|
props.timestampStyle,
|
|
46
47
|
]);
|
|
47
48
|
|
|
48
|
-
const DATE_FORMAT =
|
|
49
|
+
const DATE_FORMAT = DATE_TIME_FORMAT.dateFormat;
|
|
49
50
|
const readTime = enableReadTimeOnStoryCards && story['read-time']
|
|
50
51
|
? `${story['read-time']} ${translate('min read')} · `
|
|
51
52
|
: '';
|
|
@@ -34,11 +34,12 @@ export const SecondaryStoryCard = (props) => {
|
|
|
34
34
|
COLORS,
|
|
35
35
|
reverseTimeAdverbPosition,
|
|
36
36
|
enableReadTimeOnStoryCards,
|
|
37
|
+
DATE_TIME_FORMAT,
|
|
37
38
|
} = theme;
|
|
38
39
|
const styles = secStoryCardStyles(theme);
|
|
39
40
|
const { story = {} } = props;
|
|
40
41
|
|
|
41
|
-
const DATE_FORMAT =
|
|
42
|
+
const DATE_FORMAT = DATE_TIME_FORMAT.dateFormat;
|
|
42
43
|
|
|
43
44
|
const containerStyle = StyleSheet.flatten([
|
|
44
45
|
styles.container,
|
|
@@ -32,6 +32,7 @@ const SecondaryStoryCardNewBase = (props) => {
|
|
|
32
32
|
COLORS,
|
|
33
33
|
reverseTimeAdverbPosition,
|
|
34
34
|
enableReadTimeOnStoryCards,
|
|
35
|
+
DATE_TIME_FORMAT,
|
|
35
36
|
} = theme;
|
|
36
37
|
|
|
37
38
|
const translate = get(theme, ['translate'], (word) => word);
|
|
@@ -50,7 +51,7 @@ const SecondaryStoryCardNewBase = (props) => {
|
|
|
50
51
|
props.timestampStyle,
|
|
51
52
|
]);
|
|
52
53
|
|
|
53
|
-
const DATE_FORMAT =
|
|
54
|
+
const DATE_FORMAT = DATE_TIME_FORMAT.dateFormat;
|
|
54
55
|
const readTime = enableReadTimeOnStoryCards && story['read-time']
|
|
55
56
|
? `${story['read-time']} ${translate('min read')} · `
|
|
56
57
|
: '';
|
|
@@ -19,8 +19,6 @@ import { COMP_CONTENT_CONSTANTS } from '../../constants/component-constants/cont
|
|
|
19
19
|
|
|
20
20
|
import { DailyMotionPlayer } from '../DailyMotionPlayer';
|
|
21
21
|
|
|
22
|
-
const DATE_FORMAT = 'd MMMM yyyy h:mm a';
|
|
23
|
-
|
|
24
22
|
const getHeroImage = (cdn, story) => {
|
|
25
23
|
const imageSlug = story['hero-image-s3-key'];
|
|
26
24
|
if (!imageSlug) return null;
|
|
@@ -66,11 +64,17 @@ export const StoryHeader = (props) => {
|
|
|
66
64
|
const { story } = props;
|
|
67
65
|
const sectionData = get(story, ['sections', 0], {});
|
|
68
66
|
const { theme } = useContext(AppTheme);
|
|
69
|
-
|
|
67
|
+
|
|
68
|
+
const {
|
|
69
|
+
COLORS, locale, FONT_FAMILY, DATE_TIME_FORMAT,
|
|
70
|
+
} = theme;
|
|
71
|
+
|
|
72
|
+
const DATE_FORMAT = `${DATE_TIME_FORMAT.dateFormat} ${DATE_TIME_FORMAT.timeFormat}`;
|
|
70
73
|
const styles = storyHeaderStyles(COLORS, FONT_FAMILY);
|
|
71
74
|
const caption = story['hero-image-caption'];
|
|
72
75
|
const attribution = story['hero-image-attribution'];
|
|
73
76
|
|
|
77
|
+
|
|
74
78
|
const showAttribution = () => {
|
|
75
79
|
if (!caption && !attribution) {
|
|
76
80
|
return null;
|
package/src/themes/theme.js
CHANGED
package/src/utils/context.js
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
CAN_COPY_TEXT,
|
|
7
7
|
NETWORK_TYPE,
|
|
8
8
|
IMAGE_QUALITY,
|
|
9
|
+
DATE_TIME_FORMAT,
|
|
9
10
|
} from '../themes/theme';
|
|
10
11
|
|
|
11
12
|
export const THEME_CONFIG = {
|
|
@@ -16,5 +17,6 @@ export const THEME_CONFIG = {
|
|
|
16
17
|
NETWORK_TYPE,
|
|
17
18
|
locale: 'enIN',
|
|
18
19
|
IMAGE_QUALITY,
|
|
20
|
+
DATE_TIME_FORMAT,
|
|
19
21
|
};
|
|
20
22
|
export const AppTheme = createContext(THEME_CONFIG);
|