Commit d5a700a8 authored by Prasetya Saputra's avatar Prasetya Saputra

update tnc card

parent ecdf3378
...@@ -7,151 +7,144 @@ import HTML from 'react-native-render-html'; ...@@ -7,151 +7,144 @@ import HTML from 'react-native-render-html';
import MyStatusBar from './MyStatusBar'; import MyStatusBar from './MyStatusBar';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
function CardPrivacyStatement({route, navigation}) { class CardPrivacyStatement extends React.Component {
const { card_number } = route.params; constructor(props) {
return ( super(props);
<View style={styles.content}> this.state = {
<Text>{JSON.stringify(card_number)}</Text> contentID: '',
</View> contentEN: '',
) card_number: "",
} img_card: "",
spinner: true,
// class CardPrivacyStatement extends React.Component { }
// constructor(props) { }
// super(props);
// this.state = {
// contentID: '',
// contentEN: '',
// card_number: "",
// img_card: "",
// spinner: true,
// } componentDidMount() {
// } try {
this.getCardPrivacyStatement()
} catch (error) {
Alert.alert('Error', + error)
}
console.log(this.props.language)
// componentDidMount() { }
// try {
// this.getCardPrivacyStatement()
// } catch (error) {
// Alert.alert('Error', + error)
// }
// console.log(this.props.language)
// } getCardPrivacyStatement() {
try {
Axios.get(this.props.BASE_URL + 'cms/v2/detail/privacy-statement').then(res => {
// console.log('ini res data nya : ' + JSON.stringify(res.data))
const respon = res.data
this.setState({
contentID: respon.content,
contentEN: respon.content2,
spinner: false
})
})
} catch (error) {
Alert.alert('Error:' + error)
}
}
// getCardPrivacyStatement() { render() {
// try { // console.log(this.state.content)
// Axios.get(this.props.BASE_URL + 'cms/v2/detail/privacy-statement').then(res => { const { card_number } = this.props.route.params;
// // console.log('ini res data nya : ' + JSON.stringify(res.data)) try {
// const respon = res.data return (
// this.setState({ <View style={styles.container}>
// contentID: respon.content, <MyStatusBar />
// contentEN: respon.content2, <Spinner
// spinner: false visible={this.state.spinner}
// }) textContent={'Loading...'}
// }) textStyle={{ color: 'white' }}
// } catch (error) { animation={'fade'}
// Alert.alert('Error:' + error) color={'white'}
// } overlayColor={'#838383'}
// } />
<ScrollView style={styles.body}>
{/* <View style={styles.image_container(this.state.image_height)}>
<Image style={styles.image(this.state.image_height)} source={this.state.image ? { uri: this.state.image } : null} />
</View> */}
// render() { <View style={styles.content}>
// // console.log(this.state.content) <Text>{JSON.stringify(card_number)}</Text>
// try { {
// return ( this.props.language == 'en' ? (
// <View style={styles.container}> <HTML html={this.state.contentEN} tagsStyles={{
// <MyStatusBar /> p: { fontSize: 12, color: '#838383', fontFamily: 'Gotham-Light', marginVertical: 1.5 },
// <Spinner blockquote: { backgroundColor: "#f1f1f1", padding: 12, paddingBottom: 0, marginTop: 0 },
// visible={this.state.spinner} li: { fontSize: 12, color: '#838383', fontFamily: 'Gotham-Light', marginBottom: 0 },
// textContent={'Loading...'} ul: { fontSize: 12, color: '#838383', fontFamily: 'Gotham-Light', marginVertical: 5, marginBottom: -10 },
// textStyle={{ color: 'white' }}
// animation={'fade'}
// color={'white'}
// overlayColor={'#838383'}
// />
// <ScrollView style={styles.body}>
// {/* <View style={styles.image_container(this.state.image_height)}>
// <Image style={styles.image(this.state.image_height)} source={this.state.image ? { uri: this.state.image } : null} />
// </View> */}
// <View style={styles.content}>
// {/* {
// 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 },
// ul: { fontSize: 12, color: '#838383', fontFamily: 'Gotham-Light', marginVertical: 5, marginBottom: -10 },
// }} }}
// ignoredTags={['br']} ignoredTags={['br']}
// ignoredStyles={['font-family', '&nbsp;', '&amp;']} /> ignoredStyles={['font-family', '&nbsp;', '&amp;']} />
// ) : ( ) : (
// <HTML html={this.state.contentID} tagsStyles={{ <HTML html={this.state.contentID} 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 },
// ul: { fontSize: 12, color: '#838383', fontFamily: 'Gotham-Light', marginVertical: 5, marginBottom: -10 }, ul: { fontSize: 12, color: '#838383', fontFamily: 'Gotham-Light', marginVertical: 5, marginBottom: -10 },
// }} }}
// ignoredTags={['br']} ignoredTags={['br']}
// ignoredStyles={['font-family', '&nbsp;', '&amp;']} /> ignoredStyles={['font-family', '&nbsp;', '&amp;']} />
// ) )
// } */} }
// <Text>Kartu</Text> </View>
// </View> </ScrollView>
// </ScrollView> </View>
// </View> )
// ) } catch (error) {
// } catch (error) { Alert.alert('Error' + error)
// Alert.alert('Error' + error) }
// }
// } }
// } }
const styles = StyleSheet.create({ const styles = StyleSheet.create({
// container: { container: {
// flex: 1, flex: 1,
// backgroundColor: 'white', backgroundColor: 'white',
// }, },
// header: { header: {
// height: 60, height: 60,
// paddingHorizontal: 5, paddingHorizontal: 5,
// flexDirection: 'row', flexDirection: 'row',
// backgroundColor: '#CFB368', backgroundColor: '#CFB368',
// alignItems: 'center' alignItems: 'center'
// }, },
// headerTitle: { headerTitle: {
// flex: 1, flex: 1,
// textAlign: 'center', textAlign: 'center',
// margin: 20, margin: 20,
// fontSize: 23, fontSize: 23,
// alignSelf: 'center', alignSelf: 'center',
// color: 'white', color: 'white',
// fontFamily: 'Gotham-Black' fontFamily: 'Gotham-Black'
// }, },
// image_container: (height) => ({ image_container: (height) => ({
// height: height, height: height,
// backgroundColor: 'gray' backgroundColor: 'gray'
// }), }),
// image: (height) => ({ image: (height) => ({
// width: '100%', width: '100%',
// height: height height: height
// }), }),
// title: { title: {
// textAlign: 'center', textAlign: 'center',
// fontFamily: 'Gotham-Black', fontFamily: 'Gotham-Black',
// fontSize: 22, fontSize: 22,
// marginBottom: 10, marginBottom: 10,
// color: '#CFB368' color: '#CFB368'
// }, },
content: { content: {
paddingHorizontal: 25, paddingHorizontal: 25,
paddingVertical: 30 paddingVertical: 30
}, },
// body: { body: {
// } }
}) })
const mapStateToProps = (state) => { const mapStateToProps = (state) => {
......
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