@quintype/native-components 2.29.4-beta.0 → 2.29.4-beta.2
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.
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/bin/bash -e
|
|
2
2
|
|
|
3
|
-
npm install
|
|
4
|
-
git diff --quiet
|
|
3
|
+
# npm install
|
|
4
|
+
# git diff --quiet
|
|
5
5
|
|
|
6
|
-
BRANCH=$(git symbolic-ref --short HEAD)
|
|
6
|
+
# BRANCH=$(git symbolic-ref --short HEAD)
|
|
7
7
|
|
|
8
|
-
if [ "$BRANCH" == 'master' ]
|
|
9
|
-
then
|
|
10
|
-
|
|
11
|
-
else
|
|
12
|
-
|
|
13
|
-
fi
|
|
8
|
+
# if [ "$BRANCH" == 'master' ]
|
|
9
|
+
# then
|
|
10
|
+
# npx standard-version
|
|
11
|
+
# else
|
|
12
|
+
# npx standard-version --prerelease "$(git symbolic-ref --short HEAD | sed s:/:-:g )" --skip.changelog=true
|
|
13
|
+
# fi
|
|
14
14
|
|
|
15
|
-
git push --follow-tags origin "$BRANCH"
|
|
15
|
+
# git push --follow-tags origin "$BRANCH"
|
package/package.json
CHANGED
|
@@ -9,6 +9,7 @@ import Slider from "@react-native-community/slider";
|
|
|
9
9
|
import { AppTheme } from "../../utils";
|
|
10
10
|
import { useContext } from "react";
|
|
11
11
|
import { Text } from '../index';
|
|
12
|
+
import { COMP_GENERAL_CONSTANTS } from "../../constants/component-constants";
|
|
12
13
|
|
|
13
14
|
const ProgressBar = (props) => {
|
|
14
15
|
const screenDimensions = useWindowDimensions();
|
|
@@ -70,7 +71,7 @@ const PlayerBase = (props) => {
|
|
|
70
71
|
/>
|
|
71
72
|
);
|
|
72
73
|
default:
|
|
73
|
-
return <ControlButton iconName={"playcircleo"} onPress={onTogglePlayback} FONT_SIZE={FONT_SIZE}/>;
|
|
74
|
+
return <ControlButton testID={COMP_GENERAL_CONSTANTS.ttsPauseButton} iconName={"playcircleo"} onPress={onTogglePlayback} FONT_SIZE={FONT_SIZE}/>;
|
|
74
75
|
}
|
|
75
76
|
};
|
|
76
77
|
|
|
@@ -89,13 +90,14 @@ const PlayerBase = (props) => {
|
|
|
89
90
|
{translate("Listen to this article")}
|
|
90
91
|
</Text>
|
|
91
92
|
<View style={playerControlStyle}>
|
|
92
|
-
<TouchableOpacity style={{ marginHorizontal: 10 }} onPress={() => rewindOrForward("rewind")}>
|
|
93
|
-
<MaterialCommunityIcons color={COLORS.BRAND_BLACK} name={"rewind-10"} size={FONT_SIZE.title}
|
|
93
|
+
<TouchableOpacity testID={COMP_GENERAL_CONSTANTS.ttsRewindButton} style={{ marginHorizontal: 10 }} onPress={() => rewindOrForward("rewind")}>
|
|
94
|
+
<MaterialCommunityIcons color={COLORS.BRAND_BLACK} name={"rewind-10"} size={FONT_SIZE.title}/>
|
|
94
95
|
</TouchableOpacity>
|
|
95
|
-
<TouchableOpacity style={{ marginHorizontal: 10 }} onPress={() => rewindOrForward("forward")}>
|
|
96
|
+
<TouchableOpacity testID={COMP_GENERAL_CONSTANTS.ttsForwardButton} style={{ marginHorizontal: 10 }} onPress={() => rewindOrForward("forward")} >
|
|
96
97
|
<MaterialCommunityIcons color={COLORS.BRAND_BLACK} name={"fast-forward-10"} size={FONT_SIZE.title} />
|
|
97
98
|
</TouchableOpacity>
|
|
98
99
|
<TouchableOpacity
|
|
100
|
+
testID={COMP_GENERAL_CONSTANTS.ttsPlayBackSpeed}
|
|
99
101
|
style={playbackSpeedText}
|
|
100
102
|
onPress={() => props.setShowModal(true)}
|
|
101
103
|
>
|
|
@@ -114,6 +116,7 @@ const PlayerBase = (props) => {
|
|
|
114
116
|
</View>
|
|
115
117
|
<ProgressBar seekTo={seekTo} />
|
|
116
118
|
<MaterialCommunityIcons
|
|
119
|
+
testID={COMP_GENERAL_CONSTANTS.ttsPlayerCloseButton}
|
|
117
120
|
color={COLORS.BRAND_BLACK}
|
|
118
121
|
onPress={()=>closeButtonHandler()}
|
|
119
122
|
size={FONT_SIZE.title}
|
|
@@ -20,9 +20,10 @@ import Icon from 'react-native-vector-icons/AntDesign';
|
|
|
20
20
|
import TrackPlayer, { usePlaybackState, Capability, State, AppKilledPlaybackBehavior, useProgress } from "react-native-track-player";
|
|
21
21
|
import MaterialIcon from "react-native-vector-icons/MaterialCommunityIcons";
|
|
22
22
|
import FontAwesomeIcon from "react-native-vector-icons/FontAwesome";
|
|
23
|
-
|
|
23
|
+
import { isDetox } from 'react-native-is-detox';
|
|
24
24
|
|
|
25
25
|
import Modal from 'react-native-modal';
|
|
26
|
+
import { COMP_GENERAL_CONSTANTS } from '../../constants/component-constants';
|
|
26
27
|
|
|
27
28
|
const getLiveBlogTimeStamp = (card, DATE_FORMAT, story, styles, locale) => {
|
|
28
29
|
const slug = `?cardId=${card.id}`;
|
|
@@ -162,9 +163,9 @@ export const Story = ({
|
|
|
162
163
|
const cards = story?.cards ?? [];
|
|
163
164
|
const [showModal, setShowModal] = useState(false);
|
|
164
165
|
const [audioRate, setAudioRate] = useState(1);
|
|
166
|
+
const [progressInterval, setProgressInterval] = useState(undefined);
|
|
165
167
|
const playbackState = usePlaybackState();
|
|
166
|
-
|
|
167
|
-
const progress = useProgress(2000);
|
|
168
|
+
const progress = useProgress(progressInterval);
|
|
168
169
|
const [isFinishedPlaying, setFinishedPlaying] = useState(false);
|
|
169
170
|
|
|
170
171
|
|
|
@@ -243,6 +244,14 @@ export const Story = ({
|
|
|
243
244
|
return async() => await TrackPlayer.pause();
|
|
244
245
|
}, []);
|
|
245
246
|
|
|
247
|
+
useEffect(() => {
|
|
248
|
+
const checkDetox = async () => {
|
|
249
|
+
const isRunningInDetox = await isDetox();
|
|
250
|
+
setProgressInterval(isRunningInDetox ? 2000 : undefined);
|
|
251
|
+
};
|
|
252
|
+
checkDetox();
|
|
253
|
+
}, []);
|
|
254
|
+
|
|
246
255
|
useEffect(()=>{
|
|
247
256
|
if(progress?.duration < progress.position + 1 && progress.position !== 0){
|
|
248
257
|
setFinishedPlaying(true);
|
|
@@ -386,6 +395,7 @@ export const Story = ({
|
|
|
386
395
|
setShowPlayer(true)
|
|
387
396
|
await togglePlayback()
|
|
388
397
|
}}
|
|
398
|
+
testID={COMP_GENERAL_CONSTANTS.ttsPlayButton}
|
|
389
399
|
style={styles.ttsStoryButtonStyle}
|
|
390
400
|
>
|
|
391
401
|
<MaterialIcon name='account-voice' size={FONT_SIZE.h2} color={COLORS.BRAND_BLACK}/>
|
|
@@ -455,7 +465,7 @@ export const Story = ({
|
|
|
455
465
|
<View style={[Modalstyles.modalContent, styles.modalBackgound]}>
|
|
456
466
|
<View style={Modalstyles.header}>
|
|
457
467
|
<Text style={[Modalstyles.title, styles.textStyle]}>{translate("Playback Speed")}</Text>
|
|
458
|
-
<TouchableOpacity onPress={() => setShowModal(false)}>
|
|
468
|
+
<TouchableOpacity testID={COMP_GENERAL_CONSTANTS.ttsModalCloseButton} onPress={() => setShowModal(false)}>
|
|
459
469
|
<MaterialIcon name="close" size={25} color={styles?.textStyle?.color} />
|
|
460
470
|
</TouchableOpacity>
|
|
461
471
|
</View>
|
|
@@ -21,5 +21,12 @@ export const COMP_GENERAL_CONSTANTS = {
|
|
|
21
21
|
headerLogoTouch: 'COMP_GENERAL_HEADER_LOGO_TOUCH',
|
|
22
22
|
radioButtonTouch: 'COMP_GENERAL_RADIO',
|
|
23
23
|
shareButtonTouch: 'COMP_GENERAL_SHARE',
|
|
24
|
-
closeButtonTouch : 'COMP_CLOSE_BTN_TOUCH'
|
|
24
|
+
closeButtonTouch : 'COMP_CLOSE_BTN_TOUCH',
|
|
25
|
+
ttsPlayButton: 'COMP_TTS_PLAY_BUTTON',
|
|
26
|
+
ttsPlayerCloseButton: 'COMP_TTS_PLAYER_CLOSE_BUTTON',
|
|
27
|
+
ttsRewindButton: 'COMP_TTS_REWIND_BUTTON',
|
|
28
|
+
ttsForwardButton: 'COMP_TTS_FORWARD_BUTTON',
|
|
29
|
+
ttsPlayBackSpeed: 'COMP_TTS_PLAYBACK_SPEED',
|
|
30
|
+
ttsModalCloseButton: 'COMP_TTS_MODAL_CLOSE_BUTTON',
|
|
31
|
+
ttsPauseButton: 'COMP_TTS_PAUSE_BUTTON'
|
|
25
32
|
};
|