Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
N
new_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
new_excelso
Commits
c4940e3f
Commit
c4940e3f
authored
Jul 03, 2020
by
Wahyu Adjie Prasetyo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nambahin try cath untuk menangkap error di hp pak benny
parent
0c07d48d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
579 additions
and
484 deletions
+579
-484
Account.js
view/Account.js
+434
-374
NewsDetail.js
view/NewsDetail.js
+55
-40
RewardsList.js
view/RewardsList.js
+90
-70
No files found.
view/Account.js
View file @
c4940e3f
This diff is collapsed.
Click to expand it.
view/NewsDetail.js
View file @
c4940e3f
import
React
from
'react'
;
import
React
from
'react'
;
import
{
View
,
Text
,
StyleSheet
,
Dimensions
}
from
'react-native'
;
import
{
View
,
Text
,
StyleSheet
,
Dimensions
,
Alert
}
from
'react-native'
;
import
{
Image
}
from
'react-native-elements'
;
import
{
Image
}
from
'react-native-elements'
;
import
Axios
from
'axios'
;
import
Axios
from
'axios'
;
import
{
TouchableOpacity
,
ScrollView
}
from
'react-native-gesture-handler'
;
import
{
TouchableOpacity
,
ScrollView
}
from
'react-native-gesture-handler'
;
...
@@ -20,53 +20,68 @@ export default class NewsDetail extends React.Component {
...
@@ -20,53 +20,68 @@ export default class NewsDetail extends React.Component {
}
}
componentDidMount
()
{
componentDidMount
()
{
const
screenWidth
=
Math
.
round
(
Dimensions
.
get
(
'window'
).
width
);
try
{
const
statusBarHeight
=
getStatusBarHeight
();
const
screenWidth
=
Math
.
round
(
Dimensions
.
get
(
'window'
).
width
);
this
.
setState
({
const
statusBarHeight
=
getStatusBarHeight
();
image_height
:
screenWidth
,
this
.
setState
({
statusbar_height
:
statusBarHeight
image_height
:
screenWidth
,
})
statusbar_height
:
statusBarHeight
this
.
get_news_detail
(
this
.
props
.
route
.
params
.
slug
)
})
this
.
get_news_detail
(
this
.
props
.
route
.
params
.
slug
)
}
catch
(
error
)
{
Alert
.
alert
(
'Error'
,
+
error
)
}
}
}
get_news_detail
(
slug
)
{
get_news_detail
(
slug
)
{
Axios
.
get
(
'https://excelsocrm.ravintoladev.com/cms/v2/detail/'
+
slug
).
then
(
res
=>
{
try
{
const
detail
=
res
.
data
;
Axios
.
get
(
'https://excelsocrm.ravintoladev.com/cms/v2/detail/'
+
slug
).
then
(
res
=>
{
this
.
setState
({
const
detail
=
res
.
data
;
title
:
detail
.
title
,
this
.
setState
({
subtitle
:
detail
.
subtitle
,
title
:
detail
.
title
,
image
:
detail
.
content_image
,
subtitle
:
detail
.
subtitle
,
content
:
detail
.
content
,
image
:
detail
.
content_image
,
})
content
:
detail
.
content
,
})
})
})
}
catch
(
error
)
{
Alert
.
alert
(
'Error:'
+
error
)
}
}
}
render
()
{
render
()
{
// console.log(this.state.content)
// console.log(this.state.content)
return
(
try
{
<
View
style
=
{
styles
.
container
}
>
return
(
<
MyStatusBar
/>
<
View
style
=
{
styles
.
container
}
>
<
ScrollView
style
=
{
styles
.
body
}
>
<
MyStatusBar
/>
<
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
>
<
Text
style
=
{
styles
.
title
}
>
{
this
.
state
.
title
}
<
/Text
>
<
View
style
=
{
styles
.
content
}
>
<
View
style
=
{{
backgroundColor
:
'#adadad'
,
height
:
1.5
,
flex
:
1
,
marginBottom
:
5
}}
/
>
<
Text
style
=
{
styles
.
title
}
>
{
this
.
state
.
title
}
<
/Text
>
<
HTML
html
=
{
this
.
state
.
content
}
tagsStyles
=
{{
<
View
style
=
{{
backgroundColor
:
'#adadad'
,
height
:
1.5
,
flex
:
1
,
marginBottom
:
5
}}
/
>
p
:
{
fontSize
:
12
,
color
:
'#838383'
,
fontFamily
:
'Gotham-Light'
},
<
HTML
html
=
{
this
.
state
.
content
}
tagsStyles
=
{{
blockquote
:
{
backgroundColor
:
"#f1f1f1"
,
padding
:
12
,
paddingBottom
:
0
,
marginTop
:
0
},
p
:
{
fontSize
:
12
,
color
:
'#838383'
,
fontFamily
:
'Gotham-Light'
},
li
:
{
fontSize
:
12
,
color
:
'#838383'
,
fontFamily
:
'Gotham-Light'
,
marginBottom
:
0
},
blockquote
:
{
backgroundColor
:
"#f1f1f1"
,
padding
:
12
,
paddingBottom
:
0
,
marginTop
:
0
},
ul
:
{
fontSize
:
12
,
color
:
'#838383'
,
fontFamily
:
'Gotham-Light'
,
marginVertical
:
5
,
marginBottom
:
-
10
},
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'
,
' '
,
'&'
]}
/
>
ignoredTags
=
{[
'br'
]}
<
/View
>
ignoredStyles
=
{[
'font-family'
,
' '
,
'&'
]}
/
>
<
/ScrollView
>
<
/View
>
<
/View
>
<
/ScrollView
>
)
<
/View
>
)
}
catch
(
error
)
{
Alert
.
alert
(
'Error'
+
error
)
}
}
}
}
}
...
...
view/RewardsList.js
View file @
c4940e3f
This diff is collapsed.
Click to expand it.
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