@quintype/native-components 2.29.6 → 2.29.8
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 +1 -1
- package/src/Icons/UserIcon/UserIcon.js +33 -0
- package/src/components/Comments/index.js +64 -0
- package/src/components/Comments/styles.js +103 -0
- package/src/components/ShareButton/index.js +8 -5
- package/src/components/Story/index.js +16 -39
- package/src/components/Text/index.js +3 -1
- package/src/components/index.js +2 -0
- package/src/constants/component-constants/general-constants/constants.js +4 -1
- package/src/utils/index.js +1 -0
package/package.json
CHANGED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
|
+
import Svg, { G, Path, Circle } from "react-native-svg";
|
|
3
|
+
import { AppTheme } from "@quintype/native-components";
|
|
4
|
+
|
|
5
|
+
export const DarkModeUserIcon = () => (
|
|
6
|
+
<Svg width="50px" height="50px" viewBox="0 0 64 64">
|
|
7
|
+
<G fill="none" fill-rule="evenodd">
|
|
8
|
+
<Circle cx="32" cy="32" r="32" fill="#383838" />
|
|
9
|
+
<Path
|
|
10
|
+
fill="#D8D8D8"
|
|
11
|
+
d="M32.75 30.5c-1.64 0-3.152-.398-4.535-1.195a8.756 8.756 0 0 1-3.27-3.27c-.797-1.383-1.195-2.894-1.195-4.535 0-1.64.398-3.152 1.195-4.535a8.756 8.756 0 0 1 3.27-3.27c1.383-.796 2.894-1.195 4.535-1.195 1.64 0 3.152.399 4.535 1.195a8.756 8.756 0 0 1 3.27 3.27c.797 1.383 1.195 2.894 1.195 4.535 0 1.64-.398 3.152-1.195 4.535a8.756 8.756 0 0 1-3.27 3.27c-1.383.797-2.894 1.195-4.535 1.195zm6.328 2.25c1.688 0 3.258.422 4.711 1.266a9.344 9.344 0 0 1 3.445 3.445 9.222 9.222 0 0 1 1.266 4.71v2.954c0 .937-.328 1.734-.984 2.39-.657.657-1.454.985-2.391.985h-24.75c-.938 0-1.734-.328-2.39-.984-.657-.657-.985-1.454-.985-2.391v-2.953c0-1.688.422-3.258 1.266-4.711a9.344 9.344 0 0 1 3.445-3.445 9.222 9.222 0 0 1 4.71-1.266h1.196a12.21 12.21 0 0 0 5.133 1.125 12.21 12.21 0 0 0 5.133-1.125h1.195z"
|
|
12
|
+
/>
|
|
13
|
+
</G>
|
|
14
|
+
</Svg>
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
export const UserIconBase = () => (
|
|
18
|
+
<Svg width="50px" height="50px" viewBox="0 0 64 64">
|
|
19
|
+
<G fill="none" fill-rule="evenodd">
|
|
20
|
+
<Circle cx="32" cy="32" r="32" fill="#F4F4F4" />
|
|
21
|
+
<Path
|
|
22
|
+
fill="#D8D8D8"
|
|
23
|
+
d="M32.75 30.5c-1.64 0-3.152-.398-4.535-1.195a8.756 8.756 0 0 1-3.27-3.27c-.797-1.383-1.195-2.894-1.195-4.535 0-1.64.398-3.152 1.195-4.535a8.756 8.756 0 0 1 3.27-3.27c1.383-.796 2.894-1.195 4.535-1.195 1.64 0 3.152.399 4.535 1.195a8.756 8.756 0 0 1 3.27 3.27c.797 1.383 1.195 2.894 1.195 4.535 0 1.64-.398 3.152-1.195 4.535a8.756 8.756 0 0 1-3.27 3.27c-1.383.797-2.894 1.195-4.535 1.195zm6.328 2.25c1.688 0 3.258.422 4.711 1.266a9.344 9.344 0 0 1 3.445 3.445 9.222 9.222 0 0 1 1.266 4.71v2.954c0 .937-.328 1.734-.984 2.39-.657.657-1.454.985-2.391.985h-24.75c-.938 0-1.734-.328-2.39-.984-.657-.657-.985-1.454-.985-2.391v-2.953c0-1.688.422-3.258 1.266-4.711a9.344 9.344 0 0 1 3.445-3.445 9.222 9.222 0 0 1 4.71-1.266h1.196a12.21 12.21 0 0 0 5.133 1.125 12.21 12.21 0 0 0 5.133-1.125h1.195z"
|
|
24
|
+
/>
|
|
25
|
+
</G>
|
|
26
|
+
</Svg>
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
export const UserIcon = (props) => {
|
|
30
|
+
const { theme } = useContext(AppTheme);
|
|
31
|
+
const { DARK_MODE } = theme;
|
|
32
|
+
return DARK_MODE ? <DarkModeUserIcon /> : <UserIconBase />;
|
|
33
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React, { useContext} from "react";
|
|
2
|
+
import { TouchableOpacity, View, Image, useWindowDimensions } from 'react-native';
|
|
3
|
+
import {Text} from '../Text';
|
|
4
|
+
import { AppTheme, getTimeInFormat } from '../../utils';
|
|
5
|
+
import { commentStyles } from './styles';
|
|
6
|
+
import {UserIcon} from '../../Icons/UserIcon/UserIcon'
|
|
7
|
+
import { COMP_GENERAL_CONSTANTS } from "@quintype/native-components/src/constants/component-constants";
|
|
8
|
+
export const Comments = ({commentData, addCommentHandler, readAllCommentHandler}) => {
|
|
9
|
+
|
|
10
|
+
const comments = commentData?.comments?.[0]
|
|
11
|
+
const comment = comments?.body?.ops?.[0]?.insert;
|
|
12
|
+
const author = comments?.author;
|
|
13
|
+
const created_at = comments?.created_at;
|
|
14
|
+
const totalComments = commentData?.total_count ?? 0;
|
|
15
|
+
const imageUrl = comments?.body?.ops?.[1]?.insert?.image ?? null;
|
|
16
|
+
const isHidden = !!(comments?.hidden);
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
const {avatar, name} = author ?? {}
|
|
20
|
+
const { theme } = useContext(AppTheme);
|
|
21
|
+
const { COLORS, FONT_SIZE,FONT_FAMILY, locale, DARK_MODE,translate } = theme;
|
|
22
|
+
const {width} = useWindowDimensions();
|
|
23
|
+
const styles = commentStyles(COLORS, FONT_SIZE,FONT_FAMILY, width);
|
|
24
|
+
|
|
25
|
+
const Divider = () => {
|
|
26
|
+
return <View style={styles.divider}></View>
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const CommentImage = ({src}) => {
|
|
30
|
+
return <Image
|
|
31
|
+
source={{uri:`https:${src}`}}
|
|
32
|
+
style={styles.commentImage}
|
|
33
|
+
/>
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return <View>
|
|
37
|
+
<Divider />
|
|
38
|
+
<Text testID={COMP_GENERAL_CONSTANTS.commentsText} primary style={styles.commentSectionTitle}>{translate('Comments')}</Text>
|
|
39
|
+
{(comment || isHidden) ? (<View style={styles.container}>
|
|
40
|
+
{(!isHidden && avatar )? <Image
|
|
41
|
+
source={{ uri: avatar }}
|
|
42
|
+
style={styles.avatar}
|
|
43
|
+
/> : <UserIcon />}
|
|
44
|
+
<View style={styles.content}>
|
|
45
|
+
{comment && <Text style={styles.name}>{name}</Text>}
|
|
46
|
+
<Text style={styles.timestamp}>{getTimeInFormat(created_at,`dd MMM yyyy 'at' hh:mm a`,locale)}</Text>
|
|
47
|
+
{comment && comment !== '\n' && <Text style={styles.comment}>{comment}</Text>}
|
|
48
|
+
{isHidden && <Text style={styles.deletedComment}>{translate('This comment has been deleted')}</Text>}
|
|
49
|
+
{imageUrl && <CommentImage src={imageUrl}/>}
|
|
50
|
+
</View>
|
|
51
|
+
|
|
52
|
+
</View>) : (<View style={styles.noCommentContainer}>
|
|
53
|
+
<Text style={{ color:COLORS.BRAND_BLACK}}>{translate('No comments yet. Be the first to share your thoughts!')}</Text>
|
|
54
|
+
</View>)}
|
|
55
|
+
|
|
56
|
+
<View style={styles.actionSection}>
|
|
57
|
+
<TouchableOpacity onPress={addCommentHandler} style={[styles.addCommentButton,(comment || isHidden) ? {width:'43%'} : {width:'94%'}]}><Text testID={COMP_GENERAL_CONSTANTS.addCommentButton} style={{color:COLORS.DYNAMIC_SECONDARY_TEXT_COLOR}}>{translate('Add Comment')}</Text></TouchableOpacity>
|
|
58
|
+
{(comment || isHidden) && <TouchableOpacity onPress={readAllCommentHandler} style={styles.readAllCommentsButton}><Text testID={COMP_GENERAL_CONSTANTS.readAllCommentsButton} style={{color:COLORS.BRAND_BLACK}}>{`${translate('Read All Comments')} ${totalComments ? '('+totalComments+')' : ''}`}</Text></TouchableOpacity>}
|
|
59
|
+
</View>
|
|
60
|
+
<Divider />
|
|
61
|
+
</View>
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
|
|
3
|
+
export const commentStyles = (COLORS, FONT_SIZE, FONT_FAMILY, deviceWidth) => StyleSheet.create({
|
|
4
|
+
container: {
|
|
5
|
+
flexDirection: "row",
|
|
6
|
+
alignItems: "flex-start",
|
|
7
|
+
padding: 10,
|
|
8
|
+
borderRadius: 8,
|
|
9
|
+
marginBottom: 10,
|
|
10
|
+
margin:5,
|
|
11
|
+
marginTop:0
|
|
12
|
+
},
|
|
13
|
+
avatar: {
|
|
14
|
+
width: 50,
|
|
15
|
+
height: 50,
|
|
16
|
+
borderRadius: 25,
|
|
17
|
+
marginRight: 10,
|
|
18
|
+
},
|
|
19
|
+
content: {
|
|
20
|
+
flex: 1,
|
|
21
|
+
marginLeft:5
|
|
22
|
+
},
|
|
23
|
+
header: {
|
|
24
|
+
flexDirection: "row",
|
|
25
|
+
alignItems: "center",
|
|
26
|
+
marginBottom: 4,
|
|
27
|
+
},
|
|
28
|
+
name: {
|
|
29
|
+
fontWeight: "bold",
|
|
30
|
+
fontSize: FONT_SIZE.h4,
|
|
31
|
+
marginRight: 8,
|
|
32
|
+
color:COLORS.BRAND_BLACK
|
|
33
|
+
},
|
|
34
|
+
timestamp: {
|
|
35
|
+
fontSize: FONT_SIZE.h5,
|
|
36
|
+
color: COLORS.MONO4,
|
|
37
|
+
marginTop:5,
|
|
38
|
+
marginBottom:10
|
|
39
|
+
},
|
|
40
|
+
comment: {
|
|
41
|
+
fontSize: FONT_SIZE.h5,
|
|
42
|
+
color:COLORS.BRAND_BLACK
|
|
43
|
+
},
|
|
44
|
+
divider:{
|
|
45
|
+
height:1.0,
|
|
46
|
+
width:'96%',
|
|
47
|
+
backgroundColor:COLORS.MONO5,
|
|
48
|
+
marginTop:30,
|
|
49
|
+
marginBottom:20,
|
|
50
|
+
alignSelf:'center',
|
|
51
|
+
shadowOpacity:0.1,
|
|
52
|
+
shadowRadius:10,
|
|
53
|
+
shadowColor:COLORS.MONO2,
|
|
54
|
+
shadowOffset:
|
|
55
|
+
{width: 0,
|
|
56
|
+
height: 20
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
commentImage:{
|
|
60
|
+
width: deviceWidth * 0.7,
|
|
61
|
+
height: deviceWidth * 0.7,
|
|
62
|
+
marginTop: 10
|
|
63
|
+
},
|
|
64
|
+
commentSectionTitle:{
|
|
65
|
+
alignSelf: 'flex-start',
|
|
66
|
+
fontSize: FONT_SIZE.h3,
|
|
67
|
+
fontFamily:FONT_FAMILY.primaryBold,
|
|
68
|
+
marginBottom:10,
|
|
69
|
+
marginLeft:15,
|
|
70
|
+
color:COLORS.BRAND_BLACK
|
|
71
|
+
},
|
|
72
|
+
noCommentContainer:{
|
|
73
|
+
marginLeft:15,
|
|
74
|
+
marginBottom:20
|
|
75
|
+
},
|
|
76
|
+
actionSection:{
|
|
77
|
+
display:'flex',
|
|
78
|
+
flexDirection:'row',
|
|
79
|
+
justifyContent:'space-around'
|
|
80
|
+
},
|
|
81
|
+
addCommentButton:{
|
|
82
|
+
borderRadius:5,
|
|
83
|
+
backgroundColor:COLORS.BRAND_1,
|
|
84
|
+
height:40,
|
|
85
|
+
display:'flex',
|
|
86
|
+
justifyContent:'center',
|
|
87
|
+
alignItems:'center'
|
|
88
|
+
},
|
|
89
|
+
readAllCommentsButton:{
|
|
90
|
+
borderWidth:1,
|
|
91
|
+
borderColor:COLORS.MONO4,
|
|
92
|
+
width:'50%',
|
|
93
|
+
height:40,
|
|
94
|
+
display:'flex',
|
|
95
|
+
justifyContent:'center',
|
|
96
|
+
alignItems:'center',
|
|
97
|
+
borderRadius:5
|
|
98
|
+
},
|
|
99
|
+
deletedComment:{
|
|
100
|
+
fontStyle:'italic',
|
|
101
|
+
color:COLORS.BRAND_BLACK
|
|
102
|
+
}
|
|
103
|
+
})
|
|
@@ -13,7 +13,7 @@ const ShareButtonBase = (props) => {
|
|
|
13
13
|
const { theme } = useContext(AppTheme);
|
|
14
14
|
const styles = shareButtonStyles(theme);
|
|
15
15
|
const { storyCardOptions = {} } = theme;
|
|
16
|
-
const { story, type = 'story', slug, containerStyle, inListingStoryCard = false } = props;
|
|
16
|
+
const { story, type = 'story', slug, containerStyle, size, inListingStoryCard = false, onShare } = props;
|
|
17
17
|
|
|
18
18
|
const getShareURL = () => {
|
|
19
19
|
const { url } = story || {};
|
|
@@ -52,18 +52,18 @@ const ShareButtonBase = (props) => {
|
|
|
52
52
|
const renderIcon = () => {
|
|
53
53
|
switch (storyCardOptions.shareButtonIcon) {
|
|
54
54
|
case 'right-arrow':
|
|
55
|
-
return <IconAlt style={styles.iconStyle} name="share-outline" size={20} />;
|
|
55
|
+
return <IconAlt style={styles.iconStyle} name="share-outline" size={size ?? 20} />;
|
|
56
56
|
case 'up-arrow':
|
|
57
|
-
return <Icon style={styles.iconStyle} name="share-outline" size={20} />;
|
|
57
|
+
return <Icon style={styles.iconStyle} name="share-outline" size={size ?? 20} />;
|
|
58
58
|
case 'classic':
|
|
59
59
|
default:
|
|
60
|
-
return <Icon style={styles.iconStyle} name="share-social-outline" size={20} />;
|
|
60
|
+
return <Icon style={styles.iconStyle} name="share-social-outline" size={size ?? 20} />;
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
63
|
|
|
64
64
|
return inListingStoryCard && !storyCardOptions.enableShareButton ? null : (
|
|
65
65
|
<TouchableOpacity
|
|
66
|
-
onPress={share}
|
|
66
|
+
onPress={onShare ?? share}
|
|
67
67
|
testID={COMP_GENERAL_CONSTANTS.shareButtonTouch}
|
|
68
68
|
style={containerStyle}
|
|
69
69
|
>
|
|
@@ -76,6 +76,9 @@ ShareButtonBase.propTypes = {
|
|
|
76
76
|
story: PropTypes.any,
|
|
77
77
|
type: PropTypes.string,
|
|
78
78
|
slug: PropTypes.string,
|
|
79
|
+
size: PropTypes.number,
|
|
80
|
+
inListingStoryCard: PropTypes.bool,
|
|
81
|
+
onShare: PropTypes.func,
|
|
79
82
|
};
|
|
80
83
|
|
|
81
84
|
export const ShareButton = memo(ShareButtonBase);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { hexToRgb } from '@quintype/native-components/src/utils/colorUtils';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import React, { useContext, useEffect, useState
|
|
4
|
-
import { I18nManager, TouchableOpacity, View,
|
|
3
|
+
import React, { useContext, useEffect, useState } from 'react';
|
|
4
|
+
import { I18nManager, TouchableOpacity, View, AppState } from 'react-native';
|
|
5
5
|
import LinearGradient from "react-native-linear-gradient";
|
|
6
6
|
import { ClockIcon } from '../../Icons/ClockIcon';
|
|
7
7
|
import { AppTheme, getTimeInFormat } from '../../utils';
|
|
@@ -9,20 +9,18 @@ import { isMiddleIndexOfArray } from '../../utils/arrayUtils';
|
|
|
9
9
|
import { getFirstVideoElement, isStoryFree, getStoryHeadline } from '../../utils/story';
|
|
10
10
|
import { getImageSlug } from '../../utils';
|
|
11
11
|
import { STORY_TYPES } from '../../utils/story-types';
|
|
12
|
-
import { FBCommentsRow } from '../FBCommentsRow';
|
|
13
12
|
import { StoryContent } from '../StoryContent';
|
|
14
13
|
import { StoryHeader } from '../StoryHeader';
|
|
15
14
|
import { TagsRow } from '../TagsRow/TagsRow';
|
|
16
15
|
import { ShareButton, Text } from '../index';
|
|
17
16
|
import { storyStyles, modalStyles } from './styles';
|
|
18
17
|
import { Player } from '../AudioPlayer';
|
|
19
|
-
import
|
|
20
|
-
import TrackPlayer, { usePlaybackState, Capability, State, AppKilledPlaybackBehavior, useProgress } from "react-native-track-player";
|
|
18
|
+
import TrackPlayer, { usePlaybackState, Capability, State, useProgress } from "react-native-track-player";
|
|
21
19
|
import MaterialIcon from "react-native-vector-icons/MaterialCommunityIcons";
|
|
22
|
-
import
|
|
23
|
-
import { isDetox } from 'react-native-is-detox';
|
|
20
|
+
import {Comments} from '../Comments'
|
|
24
21
|
|
|
25
22
|
import Modal from 'react-native-modal';
|
|
23
|
+
import { SCREEN_LIST } from '../../../../../../src/constants/screen-mapping';
|
|
26
24
|
import { COMP_GENERAL_CONSTANTS } from '../../constants/component-constants';
|
|
27
25
|
|
|
28
26
|
const getLiveBlogTimeStamp = (card, DATE_FORMAT, story, styles, locale) => {
|
|
@@ -138,34 +136,32 @@ export const Story = ({
|
|
|
138
136
|
onAuthorPress,
|
|
139
137
|
onTagsPress,
|
|
140
138
|
onSectionPress,
|
|
141
|
-
onFbCommentPress,
|
|
142
139
|
screenList,
|
|
143
140
|
navigation,
|
|
144
141
|
accessComponent,
|
|
145
142
|
checkStoryAccess,
|
|
146
|
-
enableFbComments,
|
|
147
143
|
storyHasAccess = 'loading',
|
|
148
144
|
currentLayout,
|
|
149
145
|
getAd,
|
|
150
146
|
linkedStories,
|
|
151
147
|
showWall,
|
|
152
148
|
userObjectLength,
|
|
153
|
-
numberOfVisibleStoryCard,
|
|
154
149
|
audioS3Key,
|
|
155
150
|
ttsButtonState,
|
|
156
151
|
setShowTTSPlayer,
|
|
157
|
-
gaTrigerredTTS
|
|
152
|
+
gaTrigerredTTS,
|
|
153
|
+
commentData,
|
|
154
|
+
commentLoader
|
|
158
155
|
}) => {
|
|
159
156
|
const { theme } = useContext(AppTheme);
|
|
160
|
-
const { COLORS, FONT_SIZE, locale, DARK_MODE,translate } = theme;
|
|
157
|
+
const { COLORS, FONT_SIZE, locale, DARK_MODE,translate, enableComments } = theme;
|
|
161
158
|
const styles = storyStyles(COLORS, FONT_SIZE, DARK_MODE);
|
|
162
159
|
const Modalstyles = modalStyles(COLORS, FONT_SIZE, DARK_MODE);
|
|
163
160
|
const cards = story?.cards ?? [];
|
|
164
161
|
const [showModal, setShowModal] = useState(false);
|
|
165
162
|
const [audioRate, setAudioRate] = useState(1);
|
|
166
|
-
const [progressInterval, setProgressInterval] = useState(undefined);
|
|
167
163
|
const playbackState = usePlaybackState();
|
|
168
|
-
const progress = useProgress(
|
|
164
|
+
const progress = useProgress();
|
|
169
165
|
const [isFinishedPlaying, setFinishedPlaying] = useState(false);
|
|
170
166
|
|
|
171
167
|
|
|
@@ -244,14 +240,6 @@ export const Story = ({
|
|
|
244
240
|
return async() => await TrackPlayer.pause();
|
|
245
241
|
}, []);
|
|
246
242
|
|
|
247
|
-
useEffect(() => {
|
|
248
|
-
const checkDetox = async () => {
|
|
249
|
-
const isRunningInDetox = await isDetox();
|
|
250
|
-
setProgressInterval(isRunningInDetox ? 2000 : undefined);
|
|
251
|
-
};
|
|
252
|
-
checkDetox();
|
|
253
|
-
}, []);
|
|
254
|
-
|
|
255
243
|
useEffect(()=>{
|
|
256
244
|
if(progress?.duration < progress.position + 1 && progress.position !== 0){
|
|
257
245
|
setFinishedPlaying(true);
|
|
@@ -274,7 +262,6 @@ export const Story = ({
|
|
|
274
262
|
}
|
|
275
263
|
|
|
276
264
|
const togglePlayback = async () => {
|
|
277
|
-
console.log('risi - tts toggle playback', playbackState.state, TrackPlayer)
|
|
278
265
|
if (playbackState?.state === State.Playing) {
|
|
279
266
|
await TrackPlayer.pause();
|
|
280
267
|
} else {
|
|
@@ -318,20 +305,6 @@ export const Story = ({
|
|
|
318
305
|
: 'hh:mm, d MMM yyyy';
|
|
319
306
|
const storyType = story['story-template'];
|
|
320
307
|
|
|
321
|
-
const shouldShowComments = () => {
|
|
322
|
-
if (!enableFbComments) return null;
|
|
323
|
-
if (
|
|
324
|
-
isStoryFree(story) === 0
|
|
325
|
-
|| (storyHasAccess !== 'loading' && storyHasAccess === 'granted')
|
|
326
|
-
) {
|
|
327
|
-
return (
|
|
328
|
-
<View>
|
|
329
|
-
<FBCommentsRow onPress={onFbCommentPress} />
|
|
330
|
-
</View>
|
|
331
|
-
);
|
|
332
|
-
}
|
|
333
|
-
return null;
|
|
334
|
-
};
|
|
335
308
|
|
|
336
309
|
useEffect(() => {
|
|
337
310
|
checkStoryAccess(story);
|
|
@@ -378,6 +351,10 @@ export const Story = ({
|
|
|
378
351
|
</Text>
|
|
379
352
|
}
|
|
380
353
|
|
|
354
|
+
const navigateToComments = () => {
|
|
355
|
+
navigation.navigate(SCREEN_LIST.commentsScreen, {storyUrl: story.url})
|
|
356
|
+
}
|
|
357
|
+
|
|
381
358
|
return (
|
|
382
359
|
<>
|
|
383
360
|
<View>
|
|
@@ -449,11 +426,11 @@ export const Story = ({
|
|
|
449
426
|
{accessComponent(story, storyHasAccess, showWall)}
|
|
450
427
|
|
|
451
428
|
|
|
452
|
-
{shouldShowComments()}
|
|
453
429
|
|
|
454
430
|
<View>
|
|
455
431
|
<TagsRow tags={story.tags} onPress={onTagsPress} />
|
|
456
432
|
</View>
|
|
433
|
+
{enableComments && !commentLoader && <Comments commentData={commentData} addCommentHandler={navigateToComments} readAllCommentHandler={navigateToComments}/>}
|
|
457
434
|
<Modal
|
|
458
435
|
isVisible={showModal}
|
|
459
436
|
transparent={true}
|
|
@@ -465,7 +442,7 @@ export const Story = ({
|
|
|
465
442
|
<View style={[Modalstyles.modalContent, styles.modalBackgound]}>
|
|
466
443
|
<View style={Modalstyles.header}>
|
|
467
444
|
<Text style={[Modalstyles.title, styles.textStyle]}>{translate("Playback Speed")}</Text>
|
|
468
|
-
<TouchableOpacity
|
|
445
|
+
<TouchableOpacity onPress={() => setShowModal(false)}>
|
|
469
446
|
<MaterialIcon name="close" size={25} color={styles?.textStyle?.color} />
|
|
470
447
|
</TouchableOpacity>
|
|
471
448
|
</View>
|
|
@@ -16,7 +16,7 @@ export const Text = (props) => {
|
|
|
16
16
|
};
|
|
17
17
|
const flattenedStyle = StyleSheet.flatten([RNStyle, props.style]);
|
|
18
18
|
|
|
19
|
-
const { ellipsizeMode, numberOfLines, testID } = props;
|
|
19
|
+
const { ellipsizeMode, numberOfLines, allowFontScaling, testID } = props;
|
|
20
20
|
|
|
21
21
|
const textData = I18nManager.isRTL ? `\u200F${props.children}` : props.children;
|
|
22
22
|
|
|
@@ -31,6 +31,7 @@ export const Text = (props) => {
|
|
|
31
31
|
testID={testID}
|
|
32
32
|
style={flattenedStyle}
|
|
33
33
|
fontFamily={RNStyle.fontFamily}
|
|
34
|
+
allowFontScaling={allowFontScaling}
|
|
34
35
|
>
|
|
35
36
|
{textData}
|
|
36
37
|
</RNText>
|
|
@@ -40,6 +41,7 @@ export const Text = (props) => {
|
|
|
40
41
|
Text.propTypes = TextProps && {
|
|
41
42
|
primary: PropTypes.bool,
|
|
42
43
|
ellipsizeMode: PropTypes.string,
|
|
44
|
+
allowFontScaling: PropTypes.bool,
|
|
43
45
|
testID: PropTypes.string,
|
|
44
46
|
numberOfLines: PropTypes.number,
|
|
45
47
|
};
|
package/src/components/index.js
CHANGED
|
@@ -29,5 +29,8 @@ export const COMP_GENERAL_CONSTANTS = {
|
|
|
29
29
|
ttsPlayBackSpeed: 'COMP_TTS_PLAYBACK_SPEED',
|
|
30
30
|
ttsModalCloseButton: 'COMP_TTS_MODAL_CLOSE_BUTTON',
|
|
31
31
|
ttsPauseButton: 'COMP_TTS_PAUSE_BUTTON',
|
|
32
|
-
ttsPlayButton: 'COMP_TTS_PLAY_BUTTON'
|
|
32
|
+
ttsPlayButton: 'COMP_TTS_PLAY_BUTTON',
|
|
33
|
+
addCommentButton: 'COMP_ADD_COMMENT_BUTTON',
|
|
34
|
+
readAllCommentsButton: 'COMP_READ_ALL_COMMENTS_BUTTON',
|
|
35
|
+
commentsText: 'COMP_COMMENTS_TEXT'
|
|
33
36
|
};
|