@quintype/native-components 2.29.1-beta.0 → 2.29.1-beta.4
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 +3 -2
- package/src/components/Html/index.js +5 -2
- package/src/components/JSEmbedElement/index.js +29 -10
- package/src/components/PDFReader/index.js +3 -1
- package/src/components/PDFReader/styles.js +4 -0
- package/src/components/Pagination/index.js +112 -0
- package/src/components/Story/index.js +3 -3
- package/src/components/StoryContent/index.js +6 -6
- package/src/components/StoryGallery/index.js +1 -1
- package/src/components/StoryGallery/styles.js +5 -3
- package/src/components/Table/index.js +21 -4
- package/src/components/TextA/index.js +2 -2
- package/src/components/TextBigFact/index.js +1 -1
- package/src/components/TextBlockQuote/index.js +1 -1
- package/src/components/TextBlurb/index.js +1 -1
- package/src/components/TextQ/index.js +2 -2
- package/src/components/TextQuote/index.js +2 -2
- package/src/components/TextSummary/index.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quintype/native-components",
|
|
3
|
-
"version": "2.29.1-beta.
|
|
3
|
+
"version": "2.29.1-beta.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"lint-staged": "^10.5.3",
|
|
17
17
|
"prop-types": "15.7.2",
|
|
18
18
|
"quintype-js": "1.2.1",
|
|
19
|
+
"react-csv-reader": "^4.0.0",
|
|
19
20
|
"react-htmltext": "^0.40.2",
|
|
20
21
|
"react-native-fast-image": ">=8.3.2",
|
|
21
22
|
"react-native-image-pan-zoom": "^2.1.12",
|
|
@@ -32,11 +33,11 @@
|
|
|
32
33
|
"react": ">=17.0.2",
|
|
33
34
|
"react-native": ">=0.67.5",
|
|
34
35
|
"react-native-blob-util": ">=6.7.4",
|
|
36
|
+
"react-native-device-info": "^11.1.0",
|
|
35
37
|
"react-native-fast-image": ">=8.3.2",
|
|
36
38
|
"react-native-linear-gradient": "^2.8.3",
|
|
37
39
|
"react-native-pdf": ">=6.7.4",
|
|
38
40
|
"react-native-vector-icons": "^10.0.0",
|
|
39
|
-
"react-native-device-info": "^11.1.0",
|
|
40
41
|
"react-native-webview": ">=11.0.0"
|
|
41
42
|
},
|
|
42
43
|
"devDependencies": {
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { Text } from "@quintype/native-components/src/components/Text";
|
|
2
2
|
import isHTML from "is-html";
|
|
3
|
-
import React from
|
|
3
|
+
import React, { useContext } from 'react';
|
|
4
4
|
import { I18nManager, Linking, StyleSheet } from "react-native";
|
|
5
5
|
import HTML from "react-native-render-html";
|
|
6
|
+
import { AppTheme } from "../../utils";
|
|
7
|
+
|
|
6
8
|
|
|
7
9
|
const CustomHtmlParser = ({ text, textStyle={}, containerStyle={} }) => {
|
|
10
|
+
const { useDeeplinkHandler } = useContext(AppTheme);
|
|
8
11
|
const textStyles = StyleSheet.flatten([
|
|
9
12
|
textStyle,
|
|
10
13
|
{
|
|
@@ -18,7 +21,7 @@ const CustomHtmlParser = ({ text, textStyle={}, containerStyle={} }) => {
|
|
|
18
21
|
key={Math.random()}
|
|
19
22
|
baseFontStyle={textStyles}
|
|
20
23
|
onLinkPress={(evt, href) => {
|
|
21
|
-
|
|
24
|
+
useDeeplinkHandler(href);
|
|
22
25
|
}}
|
|
23
26
|
containerStyle={containerStyle}
|
|
24
27
|
/>
|
|
@@ -40,7 +40,7 @@ const getHTMLContent = (embedJs) => {
|
|
|
40
40
|
const width = useWindowDimensions().width;
|
|
41
41
|
const decodedContent = getDecodedContent(embedJs);
|
|
42
42
|
let htmlContent = replaceDefaultProtocol(decodedContent);
|
|
43
|
-
|
|
43
|
+
|
|
44
44
|
const webViewScript = `
|
|
45
45
|
<script type="application/javascript">
|
|
46
46
|
var interValId;
|
|
@@ -78,6 +78,7 @@ export const JSEmbedElement = (props) => {
|
|
|
78
78
|
const [height, setHeight] = useState(-1);
|
|
79
79
|
const webViewRef = useRef(null);
|
|
80
80
|
const screenWidth = useWindowDimensions().width;
|
|
81
|
+
const screenHeight = useWindowDimensions().height;
|
|
81
82
|
const width = get(
|
|
82
83
|
props,
|
|
83
84
|
['currentLayout', 'width'],
|
|
@@ -92,18 +93,34 @@ export const JSEmbedElement = (props) => {
|
|
|
92
93
|
setHeight(parseInt(event.nativeEvent.data));
|
|
93
94
|
};
|
|
94
95
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
96
|
+
// Function to manually extract the base URL from an iframe src
|
|
97
|
+
const extractBaseUrlFromIframe = (iframeHtml) => {
|
|
98
|
+
const regex = /src="([^"]+)"/; // Regex to extract src URL from iframe
|
|
99
|
+
const match = iframeHtml.match(regex);
|
|
100
|
+
|
|
101
|
+
if (match && match[1]) {
|
|
102
|
+
const srcUrl = match[1]; // The full src URL from iframe
|
|
103
|
+
|
|
104
|
+
// Manually extract the base URL (protocol + host + pathname)
|
|
105
|
+
const urlPattern = /^(https?:\/\/[^/]+(?:\/[^?]*)?)/;
|
|
106
|
+
const baseUrlMatch = srcUrl.match(urlPattern);
|
|
101
107
|
|
|
102
|
-
|
|
108
|
+
if (baseUrlMatch) {
|
|
109
|
+
return baseUrlMatch[1]; // Return the base URL
|
|
110
|
+
} else {
|
|
111
|
+
console.error('Invalid URL format.');
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
} else {
|
|
115
|
+
console.error('Iframe src not found.');
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
};
|
|
103
119
|
|
|
120
|
+
const constructSource = () => {
|
|
104
121
|
return {
|
|
105
122
|
html: getHTMLContent(props.element['embed-js']),
|
|
106
|
-
baseUrl,
|
|
123
|
+
baseUrl: extractBaseUrlFromIframe(getDecodedContent(props.element['embed-js'])),
|
|
107
124
|
};
|
|
108
125
|
};
|
|
109
126
|
|
|
@@ -113,7 +130,7 @@ export const JSEmbedElement = (props) => {
|
|
|
113
130
|
ref={webViewRef}
|
|
114
131
|
style={{
|
|
115
132
|
width,
|
|
116
|
-
height: Number(height),
|
|
133
|
+
height: Math.min(Number(height), screenHeight-250),
|
|
117
134
|
flex: 0,
|
|
118
135
|
opacity: 0.99,
|
|
119
136
|
}}
|
|
@@ -132,6 +149,7 @@ export const JSEmbedElement = (props) => {
|
|
|
132
149
|
source={constructSource()}
|
|
133
150
|
mixedContentMode="always"
|
|
134
151
|
mediaPlaybackRequiresUserAction={true}
|
|
152
|
+
nestedScrollEnabled={true}
|
|
135
153
|
/>
|
|
136
154
|
</View>
|
|
137
155
|
}
|
|
@@ -162,6 +180,7 @@ export const JSEmbedElement = (props) => {
|
|
|
162
180
|
mixedContentMode="always"
|
|
163
181
|
mediaPlaybackRequiresUserAction={true}
|
|
164
182
|
injectedJavaScript='window.ReactNativeWebView.postMessage(document.body.scrollHeight)'
|
|
183
|
+
nestedScrollEnabled={true}
|
|
165
184
|
/>
|
|
166
185
|
</View>
|
|
167
186
|
);
|
|
@@ -20,7 +20,7 @@ export const PDFReader = ({ card, story }) => {
|
|
|
20
20
|
const [modalVisible, setModalVisible] = useState(false);
|
|
21
21
|
|
|
22
22
|
const { theme } = useContext(AppTheme);
|
|
23
|
-
const { COLORS, FONT_SIZE, DARK_MODE, lineHeightMultiplier } = theme;
|
|
23
|
+
const { COLORS, FONT_SIZE, DARK_MODE, lineHeightMultiplier, translate } = theme;
|
|
24
24
|
|
|
25
25
|
const showModal = () => {
|
|
26
26
|
setModalVisible(true);
|
|
@@ -58,7 +58,9 @@ export const PDFReader = ({ card, story }) => {
|
|
|
58
58
|
trustAllCerts={Platform.OS === 'ios'}
|
|
59
59
|
/>
|
|
60
60
|
</Modal>
|
|
61
|
+
<Text style={{color:COLORS.BRAND_BLACK, fontSize: 25, fontWeight: 'bold', marginTop:40, marginLeft:15}}>{translate('Attachment')}</Text>
|
|
61
62
|
<View style={styles.pdfContainer}>
|
|
63
|
+
|
|
62
64
|
<View style={styles.pdfFileText}>
|
|
63
65
|
<TouchableOpacity style={styles.pdfButton} onPress={showModal}>
|
|
64
66
|
<Icon name="file-document-outline" size={56} style={styles.fileIcon} />
|
|
@@ -35,6 +35,10 @@ export const pdfStyles = (COLORS, FONT_SIZE, DARK_MODE, lineHeightMultiplier) =>
|
|
|
35
35
|
},
|
|
36
36
|
pdfContainer: {
|
|
37
37
|
flexDirection: 'row',
|
|
38
|
+
marginBottom:40,
|
|
39
|
+
backgroundColor: COLORS.MONO6,
|
|
40
|
+
margin:10,
|
|
41
|
+
borderRadius: 5,
|
|
38
42
|
},
|
|
39
43
|
pdfFileText: {
|
|
40
44
|
width: '80%',
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, Text, TouchableOpacity, StyleSheet } from 'react-native';
|
|
3
|
+
|
|
4
|
+
const Pagination = ({ currentPage, totalPages, onPageChange }) => {
|
|
5
|
+
const range = 2;
|
|
6
|
+
|
|
7
|
+
const getPages = () => {
|
|
8
|
+
const pages = [];
|
|
9
|
+
let start = Math.max(1, currentPage - range);
|
|
10
|
+
let end = Math.min(totalPages, currentPage + range);
|
|
11
|
+
|
|
12
|
+
if (start > 1) pages.push('...');
|
|
13
|
+
for (let i = start; i <= end; i++) {
|
|
14
|
+
pages.push(i);
|
|
15
|
+
}
|
|
16
|
+
if (end < totalPages) pages.push('...');
|
|
17
|
+
|
|
18
|
+
return pages;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
const handlePageChange = (page) => {
|
|
23
|
+
if (page >= 1 && page <= totalPages && page !== currentPage) {
|
|
24
|
+
onPageChange(page);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const pages = getPages();
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<View style={styles.container}>
|
|
32
|
+
<TouchableOpacity
|
|
33
|
+
onPress={() => handlePageChange(currentPage - 1)}
|
|
34
|
+
disabled={currentPage === 1}
|
|
35
|
+
style={[styles.arrow, currentPage === 1 && styles.disabled]}>
|
|
36
|
+
<Text style={styles.arrowText}>{'<'}</Text>
|
|
37
|
+
</TouchableOpacity>
|
|
38
|
+
|
|
39
|
+
{pages.map((page, index) => (
|
|
40
|
+
<TouchableOpacity
|
|
41
|
+
key={index}
|
|
42
|
+
onPress={() => handlePageChange(page)}
|
|
43
|
+
|
|
44
|
+
style={[
|
|
45
|
+
styles.pageButton,
|
|
46
|
+
page === currentPage && styles.activePage,
|
|
47
|
+
|
|
48
|
+
]}
|
|
49
|
+
>
|
|
50
|
+
<Text style={styles.pageText}>
|
|
51
|
+
{page}
|
|
52
|
+
</Text>
|
|
53
|
+
</TouchableOpacity>
|
|
54
|
+
))}
|
|
55
|
+
|
|
56
|
+
<TouchableOpacity
|
|
57
|
+
onPress={() => handlePageChange(currentPage + 1)}
|
|
58
|
+
disabled={currentPage === totalPages}
|
|
59
|
+
style={[styles.arrow, currentPage === totalPages && styles.disabled]}>
|
|
60
|
+
<Text style={styles.arrowText}>{'>'}</Text>
|
|
61
|
+
</TouchableOpacity>
|
|
62
|
+
</View>
|
|
63
|
+
);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const styles = StyleSheet.create({
|
|
67
|
+
container: {
|
|
68
|
+
flexDirection: 'row',
|
|
69
|
+
alignItems: 'center',
|
|
70
|
+
justifyContent: 'center',
|
|
71
|
+
marginVertical: 20,
|
|
72
|
+
|
|
73
|
+
marginHorizontal:20,
|
|
74
|
+
borderRadius:5
|
|
75
|
+
},
|
|
76
|
+
arrow: {
|
|
77
|
+
padding: 5,
|
|
78
|
+
borderRadius: 5,
|
|
79
|
+
backgroundColor: '#f0f0f0',
|
|
80
|
+
height:38,
|
|
81
|
+
paddingHorizontal:10
|
|
82
|
+
},
|
|
83
|
+
arrowText: {
|
|
84
|
+
fontSize: 20,
|
|
85
|
+
color: '#000',
|
|
86
|
+
},
|
|
87
|
+
pageButton: {
|
|
88
|
+
marginHorizontal: 5,
|
|
89
|
+
padding: 10,
|
|
90
|
+
borderRadius: 5,
|
|
91
|
+
backgroundColor: '#f0f0f0',
|
|
92
|
+
height:38,
|
|
93
|
+
paddingHorizontal:12
|
|
94
|
+
},
|
|
95
|
+
pageText: {
|
|
96
|
+
fontSize: 16,
|
|
97
|
+
color: '#000',
|
|
98
|
+
},
|
|
99
|
+
activePage: {
|
|
100
|
+
backgroundColor: '#993366',
|
|
101
|
+
height:38,
|
|
102
|
+
padding: 10,
|
|
103
|
+
},
|
|
104
|
+
disabled: {
|
|
105
|
+
opacity: 0.5,
|
|
106
|
+
},
|
|
107
|
+
disabledText: {
|
|
108
|
+
color: '#ccc',
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
export default Pagination;
|
|
@@ -93,7 +93,7 @@ const getStoryCards = (
|
|
|
93
93
|
|
|
94
94
|
{source.length > (storyType === STORY_TYPES.VIDEO_STORY ? 2 : 1)
|
|
95
95
|
&& isMiddleIndexOfArray(index, source)
|
|
96
|
-
&& getAd(true
|
|
96
|
+
&& getAd(true)}
|
|
97
97
|
{/* ^ Requesting mid-content-ad if there are > 1 card
|
|
98
98
|
(> 2 cards in case of video story since the 1st card gets rendered in header). */}
|
|
99
99
|
|
|
@@ -106,7 +106,7 @@ const getStoryCards = (
|
|
|
106
106
|
{cards.length === 1
|
|
107
107
|
&& source.length > (storyType === STORY_TYPES.VIDEO_STORY ? 2 : 1)
|
|
108
108
|
&& isMiddleIndexOfArray(index, source)
|
|
109
|
-
&& getAd(true
|
|
109
|
+
&& getAd(true)}
|
|
110
110
|
{/* ^ In the case of a story having just 1 card,
|
|
111
111
|
requesting mid-content-Ad if there are > 1 story-elements in that card
|
|
112
112
|
(> 2 story-elements in case of video story since the 1st story-element gets rendered in header). */}
|
|
@@ -407,7 +407,7 @@ export const Story = ({
|
|
|
407
407
|
</View>))}
|
|
408
408
|
|
|
409
409
|
|
|
410
|
-
{getAd(
|
|
410
|
+
{getAd()}
|
|
411
411
|
|
|
412
412
|
{getStoryCards(
|
|
413
413
|
cards,
|
|
@@ -103,12 +103,12 @@ export const StoryContent = ({
|
|
|
103
103
|
return <AllComponents.TitleElement card={storyElement} />;
|
|
104
104
|
}
|
|
105
105
|
case STORY_ELEMENT_TYPES.JS_EMBED: {
|
|
106
|
-
switch (storyElement.subtype) {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
106
|
+
// switch (storyElement.subtype) {
|
|
107
|
+
// case STORY_ELEMENT_SUBTYPES.DAILY_MOTION: {
|
|
108
|
+
// return <DailyMotionPlayer element={storyElement} />;
|
|
109
|
+
// }
|
|
110
|
+
// default: break;
|
|
111
|
+
// }
|
|
112
112
|
return <AllComponents.JSEmbedElement element={storyElement} currentLayout={currentLayout} />;
|
|
113
113
|
}
|
|
114
114
|
default:
|
|
@@ -140,7 +140,7 @@ export const StoryGallery = ({ cdn, card }) => {
|
|
|
140
140
|
|
|
141
141
|
const style = galleryStyles.fullWidth;
|
|
142
142
|
return (
|
|
143
|
-
<TouchableOpacity style={galleryStyles.subContainer}>
|
|
143
|
+
<TouchableOpacity style={[galleryStyles.subContainer,{margin:4}]}>
|
|
144
144
|
<LightBoxImage
|
|
145
145
|
onClickHandler={onPressHandler}
|
|
146
146
|
hero={!!data.metaData['focus-point']}
|
|
@@ -11,20 +11,22 @@ export const styles = ({ FONT_SIZE }, screenDimensions) => {
|
|
|
11
11
|
container: {
|
|
12
12
|
width: '100%',
|
|
13
13
|
paddingHorizontal: 10,
|
|
14
|
+
|
|
14
15
|
},
|
|
15
16
|
imgContainer: {
|
|
16
17
|
width: '100%',
|
|
17
18
|
flexDirection: 'row',
|
|
18
19
|
flexWrap: 'wrap',
|
|
20
|
+
|
|
19
21
|
},
|
|
20
22
|
halfWidth: {
|
|
21
23
|
width: (deviceWidth - 30) / 2,
|
|
22
24
|
height: 124,
|
|
23
25
|
},
|
|
24
26
|
fullWidth: {
|
|
25
|
-
width: (deviceWidth -
|
|
26
|
-
height: (deviceWidth -
|
|
27
|
-
margin:
|
|
27
|
+
width: (deviceWidth - 45) / 3,
|
|
28
|
+
height: (deviceWidth - 45) / 3,
|
|
29
|
+
margin: 0,
|
|
28
30
|
},
|
|
29
31
|
descText: {
|
|
30
32
|
fontSize: FONT_SIZE.h2,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import React, { useContext } from 'react';
|
|
2
|
-
import { View , ScrollView } from 'react-native';
|
|
1
|
+
import React, { useContext, useEffect } from 'react';
|
|
2
|
+
import { View , ScrollView, Button } from 'react-native';
|
|
3
3
|
import get from 'lodash/get';
|
|
4
4
|
import { formatData } from '../../utils/tableUtils';
|
|
5
5
|
import { tableStyles } from './styles';
|
|
6
6
|
import { Text } from '../index';
|
|
7
7
|
import { AppTheme } from '../../utils';
|
|
8
|
+
import Pagination from '@quintype/native-components/src/components/Pagination';
|
|
8
9
|
|
|
9
10
|
export const Table = ({ card }) => {
|
|
10
11
|
const csv = get(card, ['data', 'content'], '');
|
|
@@ -19,10 +20,19 @@ export const Table = ({ card }) => {
|
|
|
19
20
|
);
|
|
20
21
|
|
|
21
22
|
const tableData = [tableHeaderRow].concat(headerData);
|
|
23
|
+
const [filteredData, setFilteredData] = React.useState([]);
|
|
24
|
+
const [activePage, setActivePage] = React.useState(1);
|
|
25
|
+
|
|
26
|
+
useEffect(()=>{
|
|
27
|
+
const nextData = tableData.slice(Math.max(0, (activePage - 1) * 10), activePage * 10);
|
|
28
|
+
if(nextData.length > 0){
|
|
29
|
+
setFilteredData(nextData)
|
|
30
|
+
}
|
|
31
|
+
},[activePage])
|
|
22
32
|
|
|
23
33
|
const renderTableBody = () => (
|
|
24
34
|
<View style={styles.tableBody}>
|
|
25
|
-
{
|
|
35
|
+
{filteredData.map((data) => (
|
|
26
36
|
<View style={styles.tableRow}>
|
|
27
37
|
{headerFields.map((headerField) => (
|
|
28
38
|
<View style={styles.tableHeaderTitle}>
|
|
@@ -34,11 +44,18 @@ export const Table = ({ card }) => {
|
|
|
34
44
|
</View>
|
|
35
45
|
);
|
|
36
46
|
|
|
47
|
+
const onPageChange = (page) => {
|
|
48
|
+
setActivePage(page);
|
|
49
|
+
};
|
|
50
|
+
|
|
37
51
|
return (
|
|
52
|
+
<>
|
|
53
|
+
<Pagination currentPage={activePage} totalPages={tableData.length / 10} onPageChange={onPageChange}/>
|
|
38
54
|
<ScrollView horizontal>
|
|
39
55
|
<View style={styles.tableContainer}>
|
|
40
|
-
<View>{renderTableBody()}</View>
|
|
56
|
+
{filteredData && <View>{renderTableBody()}</View>}
|
|
41
57
|
</View>
|
|
42
58
|
</ScrollView>
|
|
59
|
+
</>
|
|
43
60
|
);
|
|
44
61
|
};
|
|
@@ -8,7 +8,7 @@ import HTML from 'react-native-render-html';
|
|
|
8
8
|
import { customHTMLStyles } from '../../constants/renderHTML';
|
|
9
9
|
|
|
10
10
|
export const TextA = ({ answer }) => {
|
|
11
|
-
const { theme } = useContext(AppTheme);
|
|
11
|
+
const { theme, useDeeplinkHandler } = useContext(AppTheme);
|
|
12
12
|
const { COLORS, FONT_SIZE, lineHeightMultiplier, FONT_FAMILY} = theme;
|
|
13
13
|
const styles = textAnswerStyles(COLORS, FONT_SIZE, lineHeightMultiplier);
|
|
14
14
|
const customTagsStyles = customHTMLStyles();
|
|
@@ -29,7 +29,7 @@ export const TextA = ({ answer }) => {
|
|
|
29
29
|
key={Math.random()}
|
|
30
30
|
baseFontStyle={style}
|
|
31
31
|
onLinkPress={(evt, href) => {
|
|
32
|
-
|
|
32
|
+
useDeeplinkHandler(href);
|
|
33
33
|
}}
|
|
34
34
|
tagsStyles={{
|
|
35
35
|
del: customTagsStyles.del,
|
|
@@ -40,7 +40,7 @@ export const TextBigFact = ({ text, attribution, id }) => {
|
|
|
40
40
|
key={Math.random()}
|
|
41
41
|
baseFontStyle={style}
|
|
42
42
|
onLinkPress={(evt, href) => {
|
|
43
|
-
useDeeplinkHandler(href
|
|
43
|
+
useDeeplinkHandler(href);
|
|
44
44
|
}}
|
|
45
45
|
tagsStyles={{
|
|
46
46
|
del: customTagsStyles.del,
|
|
@@ -36,7 +36,7 @@ export const TextBlockQuote = ({ text, attribution }) => {
|
|
|
36
36
|
key={Math.random()}
|
|
37
37
|
baseFontStyle={style}
|
|
38
38
|
onLinkPress={(evt, href) => {
|
|
39
|
-
useDeeplinkHandler(href
|
|
39
|
+
useDeeplinkHandler(href);
|
|
40
40
|
}}
|
|
41
41
|
tagsStyles={{
|
|
42
42
|
del: customTagsStyles.del,
|
|
@@ -7,7 +7,7 @@ import { AppTheme } from '@quintype/native-components/src/utils/context';
|
|
|
7
7
|
import HTML from 'react-native-render-html';
|
|
8
8
|
import { customHTMLStyles } from '../../constants/renderHTML';
|
|
9
9
|
export const TextQ = ({ question }) => {
|
|
10
|
-
const { theme } = useContext(AppTheme);
|
|
10
|
+
const { theme, useDeeplinkHandler } = useContext(AppTheme);
|
|
11
11
|
const { COLORS, FONT_SIZE, lineHeightMultiplier, FONT_FAMILY } = theme;
|
|
12
12
|
const styles = textQuestionStyles(COLORS, FONT_SIZE, lineHeightMultiplier);
|
|
13
13
|
const customTagsStyles = customHTMLStyles();
|
|
@@ -28,7 +28,7 @@ export const TextQ = ({ question }) => {
|
|
|
28
28
|
key={Math.random()}
|
|
29
29
|
baseFontStyle={style}
|
|
30
30
|
onLinkPress={(evt, href) => {
|
|
31
|
-
|
|
31
|
+
useDeeplinkHandler(href);
|
|
32
32
|
}}
|
|
33
33
|
tagsStyles={{
|
|
34
34
|
del: customTagsStyles.del,
|
|
@@ -11,7 +11,7 @@ import { AppTheme } from '../../utils/context';
|
|
|
11
11
|
import { alterQuoteData } from '../../utils';
|
|
12
12
|
|
|
13
13
|
export const TextQuote = ({ text, attribution }) => {
|
|
14
|
-
const { theme } = useContext(AppTheme);
|
|
14
|
+
const { theme, useDeeplinkHandler } = useContext(AppTheme);
|
|
15
15
|
const {
|
|
16
16
|
FONT_FAMILY, COLORS, FONT_SIZE, CAN_COPY_TEXT, lineHeightMultiplier,
|
|
17
17
|
} = theme;
|
|
@@ -39,7 +39,7 @@ export const TextQuote = ({ text, attribution }) => {
|
|
|
39
39
|
key={Math.random()}
|
|
40
40
|
baseFontStyle={style}
|
|
41
41
|
onLinkPress={(evt, href) => {
|
|
42
|
-
|
|
42
|
+
useDeeplinkHandler(href);
|
|
43
43
|
}}
|
|
44
44
|
tagsStyles={{
|
|
45
45
|
del: customTagsStyles.del,
|
|
@@ -9,7 +9,7 @@ import { textSummaryStyles } from './styles';
|
|
|
9
9
|
import { AppTheme } from '../../utils/context';
|
|
10
10
|
|
|
11
11
|
export const TextSummary = (props) => {
|
|
12
|
-
const { theme } = useContext(AppTheme);
|
|
12
|
+
const { theme, useDeeplinkHandler } = useContext(AppTheme);
|
|
13
13
|
const {
|
|
14
14
|
FONT_FAMILY, FONT_SIZE, COLORS, CAN_COPY_TEXT, lineHeightMultiplier,
|
|
15
15
|
} = theme;
|
|
@@ -34,7 +34,7 @@ export const TextSummary = (props) => {
|
|
|
34
34
|
key={Math.random()}
|
|
35
35
|
baseFontStyle={style}
|
|
36
36
|
onLinkPress={(evt, href) => {
|
|
37
|
-
|
|
37
|
+
useDeeplinkHandler(href);
|
|
38
38
|
}}
|
|
39
39
|
tagsStyles={{
|
|
40
40
|
del: customTagsStyles.del,
|