Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
clone_excelso
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Prasetya Saputra
clone_excelso
Commits
d5a700a8
Commit
d5a700a8
authored
Feb 08, 2021
by
Prasetya Saputra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update tnc card
parent
ecdf3378
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
123 additions
and
130 deletions
+123
-130
CardPrivacyStatement.js
view/CardPrivacyStatement.js
+123
-130
No files found.
view/CardPrivacyStatement.js
View file @
d5a700a8
...
@@ -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() {
componentDidMount
()
{
//
try {
try
{
//
this.getCardPrivacyStatement()
this
.
getCardPrivacyStatement
()
//
} catch (error) {
}
catch
(
error
)
{
//
Alert.alert('Error', + error)
Alert
.
alert
(
'Error'
,
+
error
)
//
}
}
//
console.log(this.props.language)
console
.
log
(
this
.
props
.
language
)
//
}
}
//
getCardPrivacyStatement() {
getCardPrivacyStatement
()
{
//
try {
try
{
//
Axios.get(this.props.BASE_URL + 'cms/v2/detail/privacy-statement').then(res => {
Axios
.
get
(
this
.
props
.
BASE_URL
+
'cms/v2/detail/privacy-statement'
).
then
(
res
=>
{
//
// console.log('ini res data nya : ' + JSON.stringify(res.data))
// console.log('ini res data nya : ' + JSON.stringify(res.data))
//
const respon = res.data
const
respon
=
res
.
data
//
this.setState({
this
.
setState
({
//
contentID: respon.content,
contentID
:
respon
.
content
,
//
contentEN: respon.content2,
contentEN
:
respon
.
content2
,
//
spinner: false
spinner
:
false
//
})
})
//
})
})
//
} catch (error) {
}
catch
(
error
)
{
//
Alert.alert('Error:' + error)
Alert
.
alert
(
'Error:'
+
error
)
//
}
}
//
}
}
// render() {
render
()
{
// // console.log(this.state.content)
// console.log(this.state.content)
// try {
const
{
card_number
}
=
this
.
props
.
route
.
params
;
// return (
try
{
// <View style={styles.container}>
return
(
// <MyStatusBar />
<
View
style
=
{
styles
.
container
}
>
// <Spinner
<
MyStatusBar
/>
// visible={this.state.spinner}
<
Spinner
// textContent={'Loading...'}
visible
=
{
this
.
state
.
spinner
}
// textStyle={{ color: 'white' }}
textContent
=
{
'Loading...'
}
// animation={'fade'}
textStyle
=
{{
color
:
'white'
}}
// color={'white'}
animation
=
{
'fade'
}
// overlayColor={'#838383'}
color
=
{
'white'
}
// />
overlayColor
=
{
'#838383'
}
// <ScrollView style={styles.body}>
/
>
// {/* <View style={styles.image_container(this.state.image_height)}>
<
ScrollView
style
=
{
styles
.
body
}
>
// <Image style={styles.image(this.state.image_height)} source={this.state.image ? { uri: this.state.image } : null} />
{
/* <View style={styles.image_container(this.state.image_height)}>
// </View> */}
<Image style={styles.image(this.state.image_height)} source={this.state.image ? { uri: this.state.image } : null} />
// <View style={styles.content}>
</View> */
}
// {/* {
// this.props.language == 'en' ? (
<
View
style
=
{
styles
.
content
}
>
// <HTML html={this.state.contentEN} tagsStyles={{
<
Text
>
{
JSON
.
stringify
(
card_number
)}
<
/Text
>
// p: { fontSize: 12, color: '#838383', fontFamily: 'Gotham-Light', marginVertical: 1.5 },
{
// blockquote: { backgroundColor: "#f1f1f1", padding: 12, paddingBottom: 0, marginTop: 0 },
this
.
props
.
language
==
'en'
?
(
// li: { fontSize: 12, color: '#838383', fontFamily: 'Gotham-Light', marginBottom: 0 },
<
HTML
html
=
{
this
.
state
.
contentEN
}
tagsStyles
=
{{
// ul: { fontSize: 12, color: '#838383', fontFamily: 'Gotham-Light', marginVertical: 5, marginBottom: -10 },
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', ' ', '&']} />
ignoredStyles
=
{[
'font-family'
,
' '
,
'&'
]}
/
>
//
) : (
)
:
(
//
<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', ' ', '&']} />
ignoredStyles
=
{[
'font-family'
,
' '
,
'&'
]}
/
>
// )
)
// } */}
}
// <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
)
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment