-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
65 lines (54 loc) · 1.49 KB
/
App.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import React, { useEffect, useReducer, useRef, useState } from 'react';
import type {Node} from 'react';
import {
SafeAreaView,
ScrollView,
StatusBar,
StyleSheet,
Text,
useColorScheme,
View,
} from 'react-native';
import { WebView } from 'react-native-webview';
const INITIAL_STATE = {
rosario: 'https://tracetogether.smsupermalls.com/5f6880356b2d3'
};
function reducer(state, action) {
switch (action.type) {
case 'get':
return {value: state[action.key]};
default:
return {...INITIAL_STATE};
}
}
// document.getElementsByClassName('health-form-link').onclick = function(){
// document.getElementById("symptoms").checked = false;
// document.getElementById("ct_q1").checked = false;
// document.getElementById("ct_q2").checked = false;
// document.getElementById("ct_q3").checked = false;
// document.getElementById("ct_q4").checked = false;
// }
const App = () => {
const webviewRef = useRef(null)
const [state, dispatch] = useReducer(reducer, INITIAL_STATE)
const injectJavascript = `
setTimeout(()=> {
document.getElementById("terms").checked = true;
}, 1500);
`;
return (
<SafeAreaView style={{flex: 1}}>
<WebView
ref={webviewRef}
startInLoadingState={true}
javaScriptEnabled={true}
onMessage={(event) => {}}
source={{ uri: state.rosario }}
injectedJavaScript={injectJavascript}
/>
</SafeAreaView>
);
};
const styles = StyleSheet.create({
});
export default App;