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
7c26a0b9
Commit
7c26a0b9
authored
Jun 15, 2020
by
Trisno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
loading bar di reward
parent
5a64c156
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
31 deletions
+34
-31
RewardsList.js
view/RewardsList.js
+34
-31
No files found.
view/RewardsList.js
View file @
7c26a0b9
import
React
from
'react'
;
import
React
from
'react'
;
import
{
View
,
Text
,
Image
,
StyleSheet
,
ScrollView
,
Alert
,
TouchableOpacity
}
from
'react-native'
;
import
{
View
,
Text
,
Image
,
StyleSheet
,
ScrollView
,
Alert
,
TouchableOpacity
,
ActivityIndicator
}
from
'react-native'
;
import
{
Card
}
from
'react-native-shadow-cards'
import
{
Card
}
from
'react-native-shadow-cards'
import
{
connect
}
from
'react-redux'
;
import
{
connect
}
from
'react-redux'
;
import
Axios
from
'axios'
;
import
Axios
from
'axios'
;
...
@@ -9,7 +9,8 @@ class RewardsList extends React.Component {
...
@@ -9,7 +9,8 @@ class RewardsList extends React.Component {
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
)
super
(
props
)
this
.
state
=
{
this
.
state
=
{
rewardsList
:
[]
rewardsList
:
[],
indicator
:
true
}
}
}
}
...
@@ -38,7 +39,8 @@ class RewardsList extends React.Component {
...
@@ -38,7 +39,8 @@ class RewardsList extends React.Component {
})
})
// console.log(data)
// console.log(data)
this
.
setState
({
this
.
setState
({
rewardsList
:
data
rewardsList
:
data
,
indicator
:
false
})
})
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
...
@@ -55,6 +57,7 @@ class RewardsList extends React.Component {
...
@@ -55,6 +57,7 @@ class RewardsList extends React.Component {
<
/View
>
<
/View
>
<
ScrollView
style
=
{
styles
.
body
}
>
<
ScrollView
style
=
{
styles
.
body
}
>
{
{
this
.
state
.
indicator
?
(
<
ActivityIndicator
style
=
{{
top
:
20
,
justifyContent
:
"center"
}}
size
=
"large"
color
=
"#c9af6d"
/>
)
:
(
this
.
state
.
rewardsList
.
length
?
(
this
.
state
.
rewardsList
.
length
?
(
this
.
state
.
rewardsList
.
map
((
item
,
key
)
=>
(
this
.
state
.
rewardsList
.
map
((
item
,
key
)
=>
(
<
TouchableOpacity
key
=
{
key
}
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Reward Detail'
,
{
rewardId
:
item
.
id
})}
>
<
TouchableOpacity
key
=
{
key
}
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Reward Detail'
,
{
rewardId
:
item
.
id
})}
>
...
@@ -67,11 +70,11 @@ class RewardsList extends React.Component {
...
@@ -67,11 +70,11 @@ class RewardsList extends React.Component {
style
=
{{
height
:
100
,
width
:
'100%'
}}
/
>
style
=
{{
height
:
100
,
width
:
'100%'
}}
/
>
<
/View
>
<
/View
>
<
View
style
=
{{
flex
:
1
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
padding
:
10
}}
>
<
View
style
=
{{
flex
:
1
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
padding
:
10
}}
>
<
View
style
=
{{
flex
:
0.6
}}
>
<
View
style
=
{{
flex
:
0.6
}}
>
<
Text
style
=
{{
textAlign
:
'left'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'#838383'
}}
>
{
item
.
reward
.
title
}
<
/Text
>
<
Text
style
=
{{
textAlign
:
'left'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'#838383'
}}
>
{
item
.
reward
.
title
}
<
/Text
>
<
Text
style
=
{{
textAlign
:
'left'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'#838383'
}}
>
{
item
.
reward
.
subtitle
}
<
/Text
>
<
Text
style
=
{{
textAlign
:
'left'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'#838383'
}}
>
{
item
.
reward
.
subtitle
}
<
/Text
>
<
/View
>
<
/View
>
<
View
style
=
{{
flex
:
0.4
}}
>
<
View
style
=
{{
flex
:
0.4
}}
>
<
Text
style
=
{{
textAlign
:
'right'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'#838383'
}}
>
Expired
On
<
/Text
>
<
Text
style
=
{{
textAlign
:
'right'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'#838383'
}}
>
Expired
On
<
/Text
>
<
Text
style
=
{{
textAlign
:
'right'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'#838383'
}}
>
{
item
.
expire_time
}
<
/Text
>
<
Text
style
=
{{
textAlign
:
'right'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'#838383'
}}
>
{
item
.
expire_time
}
<
/Text
>
<
/View
>
<
/View
>
...
@@ -84,7 +87,7 @@ class RewardsList extends React.Component {
...
@@ -84,7 +87,7 @@ class RewardsList extends React.Component {
<
View
style
=
{{
justifyContent
:
'center'
,
alignItems
:
'center'
,
height
:
100
}}
>
<
View
style
=
{{
justifyContent
:
'center'
,
alignItems
:
'center'
,
height
:
100
}}
>
<
Text
style
=
{{
textAlign
:
'left'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
No
E
-
Voucher
Available
<
/Text
>
<
Text
style
=
{{
textAlign
:
'left'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
No
E
-
Voucher
Available
<
/Text
>
<
/View
>
<
/View
>
)
)
)
}
}
<
TouchableOpacity
style
=
{{
marginVertical
:
20
}}
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Reward History'
)}
>
<
TouchableOpacity
style
=
{{
marginVertical
:
20
}}
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Reward History'
)}
>
<
Text
style
=
{{
textAlign
:
'center'
,
color
:
'#CFB368'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
}}
>
REDEEM
E
-
VOUCHER
HISTORY
<
/Text
>
<
Text
style
=
{{
textAlign
:
'center'
,
color
:
'#CFB368'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
}}
>
REDEEM
E
-
VOUCHER
HISTORY
<
/Text
>
...
@@ -103,7 +106,7 @@ const styles = StyleSheet.create({
...
@@ -103,7 +106,7 @@ const styles = StyleSheet.create({
},
},
header
:
{
header
:
{
flex
:
0.1
,
flex
:
0.1
,
marginBottom
:
5
,
marginBottom
:
5
,
backgroundColor
:
'#CFB368'
,
backgroundColor
:
'#CFB368'
,
justifyContent
:
'center'
justifyContent
:
'center'
},
},
...
...
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