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
c06b7f95
Commit
c06b7f95
authored
May 20, 2020
by
Wahyu Adjie Prasetyo
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://repo.cs.co.id:2222/wahyu/bahanoprek
parents
2de43f0a
b7ef3356
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
MenuSelection.js
view/MenuSelection.js
+9
-1
No files found.
view/MenuSelection.js
View file @
c06b7f95
...
@@ -181,7 +181,7 @@ class MenuSelection extends React.Component {
...
@@ -181,7 +181,7 @@ class MenuSelection extends React.Component {
renderTabBar
=
({
item
})
=>
{
renderTabBar
=
({
item
})
=>
{
return
(
return
(
<
View
style
=
{{
flex
:
1
,
height
:
270
}}
>
<
View
style
=
{{
flex
:
1
,
height
:
270
}}
>
<
TouchableOpacity
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
scrollToIndex
(
item
)}
>
<
Image
style
=
{{
height
:
60
,
width
:
60
,
top
:
5
}}
source
=
{{
uri
:
item
.
image
}}
/
>
<
Image
style
=
{{
height
:
60
,
width
:
60
,
top
:
5
}}
source
=
{{
uri
:
item
.
image
}}
/
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
...
@@ -277,6 +277,13 @@ class MenuSelection extends React.Component {
...
@@ -277,6 +277,13 @@ class MenuSelection extends React.Component {
}
}
}
}
scrollToIndex
=
(
item
)
=>
{
index
=
_
.
findIndex
(
this
.
props
.
menu_item
,
[
'name'
,
item
.
name
])
if
(
index
>
-
1
)
{
this
.
flatListRef
.
scrollToIndex
({
animated
:
true
,
index
:
index
});
}
}
render
()
{
render
()
{
return
(
return
(
<
View
style
=
{
styles
.
container
}
>
<
View
style
=
{
styles
.
container
}
>
...
@@ -304,6 +311,7 @@ class MenuSelection extends React.Component {
...
@@ -304,6 +311,7 @@ class MenuSelection extends React.Component {
/
>
/
>
)}
)}
keyExtractor
=
{
item
=>
item
.
id
}
keyExtractor
=
{
item
=>
item
.
id
}
ref
=
{(
ref
)
=>
{
this
.
flatListRef
=
ref
;
}}
/
>
/
>
)}
)}
<
/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