forked from Sefaria/Sefaria-Mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
WebViewPage.js
43 lines (40 loc) · 1.06 KB
/
WebViewPage.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
'use strict';
import PropTypes from 'prop-types';
import React, { useContext } from 'react';
import {
Text,
TouchableOpacity,
View,
Image,
} from 'react-native';
import { WebView } from 'react-native-webview';
import {
CategoryColorLine,
CloseButton,
LoadingView,
} from './Misc.js';
import { GlobalStateContext, getTheme } from './StateManager';
import styles from './Styles';
const WebViewPage = ({ close, uri }) => {
const { themeStr } = useContext(GlobalStateContext);
const theme = getTheme(themeStr);
return (
<View style={{flex:1, flexDirection: "column", alignSelf: 'stretch'}}>
<CategoryColorLine category={"Other"} />
<View style={[styles.header, theme.header]}>
<CloseButton onPress={close} />
<Text>{"sefaria.org"}</Text>
</View>
<WebView
source={{ uri }}
renderLoading={() => (<LoadingView />)}
startInLoadingState={true}
/>
</View>
);
}
WebViewPage.propTypes = {
close: PropTypes.func.isRequired,
uri: PropTypes.string.isRequired,
};
export default WebViewPage;