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
e29848c8
Commit
e29848c8
authored
May 27, 2020
by
Trisno
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://repo.cs.co.id:2222/wahyu/bahanoprek
parents
6817782e
54402b9e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
Outlets.js
view/Outlets.js
+12
-5
No files found.
view/Outlets.js
View file @
e29848c8
import
React
from
'react'
;
import
React
from
'react'
;
import
{
View
,
Text
,
StyleSheet
,
FlatList
,
TextInput
,
Alert
,
Linking
}
from
'react-native'
;
import
{
View
,
Text
,
StyleSheet
,
FlatList
,
TextInput
,
Alert
,
Linking
,
ActivityIndicator
}
from
'react-native'
;
import
{
ScrollView
,
TouchableOpacity
}
from
'react-native-gesture-handler'
;
import
{
ScrollView
,
TouchableOpacity
}
from
'react-native-gesture-handler'
;
import
Spinner
from
'react-native-loading-spinner-overlay'
;
import
Spinner
from
'react-native-loading-spinner-overlay'
;
import
{
CheckBox
}
from
'react-native-elements'
;
import
{
CheckBox
}
from
'react-native-elements'
;
...
@@ -31,7 +31,8 @@ class Outlets extends React.Component {
...
@@ -31,7 +31,8 @@ class Outlets extends React.Component {
spinner
:
false
,
spinner
:
false
,
data_outlet
:
[],
data_outlet
:
[],
outlet_selected
:
''
,
outlet_selected
:
''
,
data_name
:
''
data_name
:
''
,
indicator
:
true
}
}
}
}
...
@@ -113,17 +114,18 @@ class Outlets extends React.Component {
...
@@ -113,17 +114,18 @@ class Outlets extends React.Component {
this
.
setState
({
this
.
setState
({
dataOutlets
:
dataOutlets
,
dataOutlets
:
dataOutlets
,
data_before_search
:
dataOutlets
,
data_before_search
:
dataOutlets
,
})
})
this
.
setState
({
this
.
setState
({
spinner
:
false
,
indicator
:
false
})
})
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
let
response
=
error
.
response
.
data
;
let
response
=
error
.
response
.
data
;
Alert
.
alert
(
response
.
msg
);
Alert
.
alert
(
response
.
msg
);
this
.
setState
({
this
.
setState
({
spinner
:
false
,
indicator
:
false
})
})
})
})
}
}
...
@@ -227,7 +229,7 @@ class Outlets extends React.Component {
...
@@ -227,7 +229,7 @@ class Outlets extends React.Component {
return
(
return
(
<
View
style
=
{{
flexDirection
:
'row'
,
flex
:
1
,
marginRight
:
10
,
marginLeft
:
10
,
marginBottom
:
10
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
flex
:
1
,
marginRight
:
10
,
marginLeft
:
10
,
marginBottom
:
10
}}
>
<
View
style
=
{
styles
.
content_list
}
>
<
View
style
=
{
styles
.
content_list
}
>
<
View
style
=
{
styles
.
list_addrees
}
>
<
View
style
=
{
styles
.
list_addrees
}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'#ccb46c'
,
fontSize
:
18
,
margin
:
1
}}
>
{
item
.
name
}
<
/Text
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'#ccb46c'
,
fontSize
:
18
,
margin
:
1
}}
>
{
item
.
name
}
<
/Text
>
<
Text
style
=
{{
flexWrap
:
'wrap'
,
fontFamily
:
'Gotham-Light'
,
color
:
'#b1b1b2'
}}
>
{
item
.
full_address
}
<
/Text
>
<
Text
style
=
{{
flexWrap
:
'wrap'
,
fontFamily
:
'Gotham-Light'
,
color
:
'#b1b1b2'
}}
>
{
item
.
full_address
}
<
/Text
>
...
@@ -258,6 +260,7 @@ class Outlets extends React.Component {
...
@@ -258,6 +260,7 @@ class Outlets extends React.Component {
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
);
);
}
}
...
@@ -312,6 +315,9 @@ class Outlets extends React.Component {
...
@@ -312,6 +315,9 @@ class Outlets extends React.Component {
</View>
</View>
</View> */
}
</View> */
}
<
View
style
=
{
styles
.
body
}
>
<
View
style
=
{
styles
.
body
}
>
{
this
.
state
.
indicator
==
true
?
(
<
ActivityIndicator
size
=
"large"
color
=
"#c9af6d"
style
=
{{
margin
:
20
}}
/
>
)
:
(
<
FlatList
<
FlatList
data
=
{
_
.
orderBy
(
this
.
state
.
dataOutlets
,
[
'distance'
],
[
'asc'
])}
data
=
{
_
.
orderBy
(
this
.
state
.
dataOutlets
,
[
'distance'
],
[
'asc'
])}
renderItem
=
{
this
.
RenderItem
}
renderItem
=
{
this
.
RenderItem
}
...
@@ -321,6 +327,7 @@ class Outlets extends React.Component {
...
@@ -321,6 +327,7 @@ class Outlets extends React.Component {
maxToRenderPerBatch
=
{
2
}
maxToRenderPerBatch
=
{
2
}
onEndReachedThreshold
=
{
0.5
}
onEndReachedThreshold
=
{
0.5
}
/
>
/
>
)}
<
/View
>
<
/View
>
<
/View
>
<
/View
>
)
)
...
...
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