-
Notifications
You must be signed in to change notification settings - Fork 1
/
Website.js
35 lines (33 loc) · 1.17 KB
/
Website.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
import React, { Component } from 'react';
import { View} from 'native-base';
import { WebView } from 'react-native-webview';
export default class ThemeExample extends Component {
//data
render() {
//need remove some field first. like data description
let temp = JSON.parse(JSON.stringify(this.props.data))
for(let i of Object.keys(temp)){
for(let k of temp[i]){
delete k['Description'];
}
}
const runFirst = `
window.isNativeApp = true;
localStorage.setItem("budgetingData", '`+JSON.stringify(temp)+`');
localStorage.setItem("budgetingCategory", '`+JSON.stringify(this.props.category)+`')
true; // note: this is required, or you'll sometimes get silent failures
`;
//console.log(runFirst);
return (
<View style={{ flex: 1 }}>
<WebView
source={{
uri:
'https://capitaltwo.ga/tools/Budget/run.html',
}}
injectedJavaScriptBeforeContentLoaded={runFirst}
/>
</View>
);
}
}