Commit 1b313880 authored by Trisno's avatar Trisno

update privacy statement

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