Commit 1b313880 authored by Trisno's avatar Trisno

update privacy statement

parent 1f5b3b13
{
"expo": {
"extra" : {
"buildNumber" : "124",
"buildNumber" : "125",
"remarks": ""
},
......
......@@ -5,12 +5,14 @@ import { ScrollView } from 'react-native-gesture-handler';
import Spinner from 'react-native-loading-spinner-overlay';
import HTML from 'react-native-render-html';
import MyStatusBar from './MyStatusBar';
import { connect } from 'react-redux';
export default class PrivacyStatement extends React.Component {
class PrivacyStatement extends React.Component {
constructor(props) {
super(props);
this.state = {
content: '',
contentID: '',
contentEN: '',
spinner: true,
}
}
......@@ -21,16 +23,18 @@ export default class PrivacyStatement extends React.Component {
} catch (error) {
Alert.alert('Error', + error)
}
console.log(this.props.language)
}
getPrivacyStatement() {
try {
Axios.get('https://excelsocrm.ravintoladev.com/cms/v2/detail/privacy-statement').then(res => {
console.log(res.data.content3)
// console.log('ini res data nya : ' + JSON.stringify(res.data))
const respon = res.data
this.setState({
content: respon.content3,
contentID: respon.content,
contentEN: respon.content2,
spinner: false
})
})
......@@ -50,9 +54,9 @@ export default class PrivacyStatement extends React.Component {
<Spinner
visible={this.state.spinner}
textContent={'Loading...'}
textStyle={{color:'#CFB368'}}
textStyle={{ color: 'white' }}
animation={'fade'}
color={'#CFB368'}
color={'white'}
overlayColor={'#838383'}
/>
<ScrollView style={styles.body}>
......@@ -60,7 +64,9 @@ export default class PrivacyStatement extends React.Component {
<Image style={styles.image(this.state.image_height)} source={this.state.image ? { uri: this.state.image } : null} />
</View> */}
<View style={styles.content}>
<HTML html={this.state.content} tagsStyles={{
{
this.props.language == 'en' ? (
<HTML html={this.state.contentEN} tagsStyles={{
p: { fontSize: 12, color: '#838383', fontFamily: 'Gotham-Light', marginVertical: 1.5 },
blockquote: { backgroundColor: "#f1f1f1", padding: 12, paddingBottom: 0, marginTop: 0 },
li: { fontSize: 12, color: '#838383', fontFamily: 'Gotham-Light', marginBottom: 0 },
......@@ -69,6 +75,19 @@ export default class PrivacyStatement extends React.Component {
}}
ignoredTags={['br']}
ignoredStyles={['font-family', '&nbsp;', '&amp;']} />
) : (
<HTML html={this.state.contentID} tagsStyles={{
p: { fontSize: 12, color: '#838383', fontFamily: 'Gotham-Light', marginVertical: 1.5 },
blockquote: { backgroundColor: "#f1f1f1", padding: 12, paddingBottom: 0, marginTop: 0 },
li: { fontSize: 12, color: '#838383', fontFamily: 'Gotham-Light', marginBottom: 0 },
ul: { fontSize: 12, color: '#838383', fontFamily: 'Gotham-Light', marginVertical: 5, marginBottom: -10 },
}}
ignoredTags={['br']}
ignoredStyles={['font-family', '&nbsp;', '&amp;']} />
)
}
</View>
</ScrollView>
</View>
......@@ -125,3 +144,11 @@ const styles = StyleSheet.create({
}
})
const mapStateToProps = (state) => {
return {
language: state.language,
}
}
export default connect(mapStateToProps)(PrivacyStatement);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment