@quintype/native-components 2.29.1 → 2.29.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.
- package/bin-dev-scripts/standard-version-release.sh +11 -11
- package/package.json +2 -2
- package/src/components/AuthorRow/styles.js +1 -0
- 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 +76 -0
- package/src/components/Pagination/styles.js +61 -0
- package/src/components/Story/styles.js +1 -0
- 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 +20 -5
- 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
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
#!/bin/bash -e
|
|
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quintype/native-components",
|
|
3
|
-
"version": "2.29.
|
|
3
|
+
"version": "2.29.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
"react": ">=17.0.2",
|
|
33
33
|
"react-native": ">=0.67.5",
|
|
34
34
|
"react-native-blob-util": ">=6.7.4",
|
|
35
|
+
"react-native-device-info": "^11.1.0",
|
|
35
36
|
"react-native-fast-image": ">=8.3.2",
|
|
36
37
|
"react-native-linear-gradient": "^2.8.3",
|
|
37
38
|
"react-native-pdf": ">=6.7.4",
|
|
38
39
|
"react-native-vector-icons": "^10.0.0",
|
|
39
|
-
"react-native-device-info": "^11.1.0",
|
|
40
40
|
"react-native-webview": ">=11.0.0"
|
|
41
41
|
},
|
|
42
42
|
"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,76 @@
|
|
|
1
|
+
import React, {useContext} from 'react';
|
|
2
|
+
import { View, TouchableOpacity, StyleSheet } from 'react-native';
|
|
3
|
+
import {
|
|
4
|
+
AppTheme
|
|
5
|
+
} from "@quintype/native-components";
|
|
6
|
+
import Icon from "react-native-vector-icons/MaterialIcons";
|
|
7
|
+
import { Text } from '@quintype/native-components/src/components/Text';
|
|
8
|
+
import {styles as paginationStyles} from "./styles";
|
|
9
|
+
|
|
10
|
+
const Pagination = ({ currentPage, totalPages, onPageChange }) => {
|
|
11
|
+
const { theme } = useContext(AppTheme);
|
|
12
|
+
const { COLORS, FONT_SIZE } = theme;
|
|
13
|
+
const styles = paginationStyles(COLORS, FONT_SIZE);
|
|
14
|
+
if(totalPages == 1) return null;
|
|
15
|
+
const range = 2;
|
|
16
|
+
|
|
17
|
+
const getPages = () => {
|
|
18
|
+
const pages = [];
|
|
19
|
+
let start = Math.max(1, currentPage - range);
|
|
20
|
+
let end = Math.min(totalPages, currentPage + range);
|
|
21
|
+
|
|
22
|
+
if (start > 1) pages.push('...');
|
|
23
|
+
for (let i = start; i <= end; i++) {
|
|
24
|
+
pages.push(i);
|
|
25
|
+
}
|
|
26
|
+
if (end < totalPages) pages.push('...');
|
|
27
|
+
|
|
28
|
+
return pages;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
const handlePageChange = (page) => {
|
|
33
|
+
if (page >= 1 && page <= totalPages && page !== currentPage) {
|
|
34
|
+
onPageChange(page);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const pages = getPages();
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<View style={styles.container}>
|
|
42
|
+
<TouchableOpacity
|
|
43
|
+
onPress={() => handlePageChange(currentPage - 1)}
|
|
44
|
+
disabled={currentPage === 1}
|
|
45
|
+
style={[styles.arrow, currentPage === 1 && styles.disabled]}>
|
|
46
|
+
<Icon style={styles.iconStyle} name="arrow-back-ios-new" color={COLORS.BRAND_BLACK} size={FONT_SIZE.h5}/>
|
|
47
|
+
</TouchableOpacity>
|
|
48
|
+
|
|
49
|
+
{pages.map((page, index) => (
|
|
50
|
+
<TouchableOpacity
|
|
51
|
+
key={index}
|
|
52
|
+
onPress={() => handlePageChange(page)}
|
|
53
|
+
disabled={page === '...'}
|
|
54
|
+
style={[
|
|
55
|
+
styles.pageButton,
|
|
56
|
+
page === currentPage && styles.activePage,
|
|
57
|
+
]}
|
|
58
|
+
>
|
|
59
|
+
<Text style={styles.pageText}>
|
|
60
|
+
{page}
|
|
61
|
+
</Text>
|
|
62
|
+
</TouchableOpacity>
|
|
63
|
+
))}
|
|
64
|
+
<TouchableOpacity
|
|
65
|
+
onPress={() => handlePageChange(currentPage + 1)}
|
|
66
|
+
disabled={currentPage === totalPages}
|
|
67
|
+
style={[styles.arrow,{backgroundColor:COLORS.BRAND_WHITE}, currentPage === totalPages && styles.disabled]}>
|
|
68
|
+
|
|
69
|
+
<Icon style={styles.iconStyle} name="arrow-forward-ios" color={COLORS.BRAND_BLACK} size={FONT_SIZE.h5}/>
|
|
70
|
+
</TouchableOpacity>
|
|
71
|
+
</View>
|
|
72
|
+
);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
export default Pagination;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
|
|
3
|
+
export const styles = (COLORS, FONT_SIZE) => StyleSheet.create({
|
|
4
|
+
container: {
|
|
5
|
+
flexDirection: 'row',
|
|
6
|
+
alignItems: 'center',
|
|
7
|
+
justifyContent: 'center',
|
|
8
|
+
marginVertical: 20,
|
|
9
|
+
marginHorizontal:20,
|
|
10
|
+
borderRadius:5,
|
|
11
|
+
},
|
|
12
|
+
arrow: {
|
|
13
|
+
padding: 5,
|
|
14
|
+
borderRadius: 5,
|
|
15
|
+
backgroundColor: COLORS.BRAND_WHITE,
|
|
16
|
+
height:38,
|
|
17
|
+
paddingHorizontal:10,
|
|
18
|
+
shadowColor: "rgba(190,190,190,0.3)",
|
|
19
|
+
shadowOffset: { width: 0, height: 2.0 },
|
|
20
|
+
shadowOpacity: 1,
|
|
21
|
+
shadowRadius: 4,
|
|
22
|
+
elevation: 10,
|
|
23
|
+
},
|
|
24
|
+
arrowText: {
|
|
25
|
+
fontSize: 20,
|
|
26
|
+
color: COLORS.BRAND_BLACK,
|
|
27
|
+
},
|
|
28
|
+
pageButton: {
|
|
29
|
+
marginHorizontal: 2,
|
|
30
|
+
padding: 10,
|
|
31
|
+
borderRadius: 5,
|
|
32
|
+
backgroundColor: COLORS.BRAND_WHITE,
|
|
33
|
+
minHeight:38,
|
|
34
|
+
paddingHorizontal:12,
|
|
35
|
+
shadowColor: "rgba(190,190,190,0.3)",
|
|
36
|
+
shadowOffset: { width: 0, height: 2.0 },
|
|
37
|
+
shadowOpacity: 1,
|
|
38
|
+
shadowRadius: 4,
|
|
39
|
+
elevation: 100,
|
|
40
|
+
},
|
|
41
|
+
pageText: {
|
|
42
|
+
color: COLORS.BRAND_BLACK,
|
|
43
|
+
fontSize:FONT_SIZE.h6
|
|
44
|
+
},
|
|
45
|
+
activePage: {
|
|
46
|
+
borderColor: COLORS.BRAND_1,
|
|
47
|
+
minHeight:38,
|
|
48
|
+
padding: 10,
|
|
49
|
+
borderWidth:1
|
|
50
|
+
},
|
|
51
|
+
disabled: {
|
|
52
|
+
opacity: 0.5,
|
|
53
|
+
},
|
|
54
|
+
disabledText: {
|
|
55
|
+
color: COLORS.MONO6,
|
|
56
|
+
},
|
|
57
|
+
iconStyle:{
|
|
58
|
+
alignSelf: 'center',
|
|
59
|
+
marginTop:7
|
|
60
|
+
}
|
|
61
|
+
});
|
|
@@ -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'], '');
|
|
@@ -18,11 +19,18 @@ export const Table = ({ card }) => {
|
|
|
18
19
|
{},
|
|
19
20
|
);
|
|
20
21
|
|
|
21
|
-
const tableData =
|
|
22
|
+
const tableData = 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
|
+
setFilteredData([tableHeaderRow].concat(nextData))
|
|
29
|
+
},[activePage])
|
|
22
30
|
|
|
23
31
|
const renderTableBody = () => (
|
|
24
32
|
<View style={styles.tableBody}>
|
|
25
|
-
{
|
|
33
|
+
{filteredData.map((data) => (
|
|
26
34
|
<View style={styles.tableRow}>
|
|
27
35
|
{headerFields.map((headerField) => (
|
|
28
36
|
<View style={styles.tableHeaderTitle}>
|
|
@@ -34,11 +42,18 @@ export const Table = ({ card }) => {
|
|
|
34
42
|
</View>
|
|
35
43
|
);
|
|
36
44
|
|
|
45
|
+
const onPageChange = (page) => {
|
|
46
|
+
setActivePage(page);
|
|
47
|
+
};
|
|
48
|
+
|
|
37
49
|
return (
|
|
50
|
+
<>
|
|
51
|
+
{filteredData.length > 1 && <Pagination currentPage={activePage} totalPages={parseInt(tableData.length % 10 === 0 ? tableData.length /10 : tableData.length /10+1)} onPageChange={onPageChange}/>}
|
|
38
52
|
<ScrollView horizontal>
|
|
39
53
|
<View style={styles.tableContainer}>
|
|
40
|
-
<View>{renderTableBody()}</View>
|
|
54
|
+
{filteredData && <View>{renderTableBody()}</View>}
|
|
41
55
|
</View>
|
|
42
56
|
</ScrollView>
|
|
57
|
+
</>
|
|
43
58
|
);
|
|
44
59
|
};
|
|
@@ -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,
|