Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Project4
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
IT2810-H19
T
Teams
Team 8
Project4
Commits
5960b01e
Commit
5960b01e
authored
Nov 14, 2019
by
Halvor Horge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#9
Added filtering to sidemenu
parent
1249ec41
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
37 deletions
+37
-37
p4/.expo/packager-info.json
p4/.expo/packager-info.json
+2
-2
p4/src/components/Filtering.js
p4/src/components/Filtering.js
+35
-35
No files found.
p4/.expo/packager-info.json
View file @
5960b01e
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
"devToolsPort"
:
19002
,
"devToolsPort"
:
19002
,
"expoServerPort"
:
19000
,
"expoServerPort"
:
19000
,
"packagerPort"
:
19001
,
"packagerPort"
:
19001
,
"packagerPid"
:
1
16
56
,
"packagerPid"
:
1
73
56
,
"expoServerNgrokUrl"
:
"https://3u-kzx.hhorge.p4.exp.direct"
,
"expoServerNgrokUrl"
:
"https://3u-kzx.hhorge.p4.exp.direct"
,
"packagerNgrokUrl"
:
"https://packager.3u-kzx.hhorge.p4.exp.direct"
,
"packagerNgrokUrl"
:
"https://packager.3u-kzx.hhorge.p4.exp.direct"
,
"ngrokPid"
:
1
9796
"ngrokPid"
:
1
5624
}
}
p4/src/components/Filtering.js
View file @
5960b01e
import
React
from
'
react
'
;
import
React
from
"
react
"
;
import
{
View
}
from
'
react-native
'
;
import
{
View
}
from
"
react-native
"
;
import
RadioForm
,
{
RadioButton
,
RadioButtonInput
,
RadioButtonLabel
}
from
'
react-native-simple-radio-button
'
;
import
RadioForm
,
{
RadioButton
,
RadioButtonInput
,
RadioButtonLabel
}
from
"
react-native-simple-radio-button
"
;
import
{
useDispatch
}
from
"
react-redux
"
;
import
{
useDispatch
}
from
"
react-redux
"
;
import
{
filter
}
from
"
../actions
"
;
import
{
filter
}
from
"
../actions
"
;
import
{
useSelector
}
from
"
react-redux
"
;
import
{
useSelector
}
from
"
react-redux
"
;
import
{
toggleSideMenu
}
from
"
../actions
"
;
import
{
toggleSideMenu
}
from
"
../actions
"
;
const
genres
=
[
const
genres
=
[
{
label
:
"
All
"
,
value
:
""
},
{
label
:
"
All
"
,
value
:
""
},
{
label
:
"
Akevitt
"
,
value
:
"
Akevitt
"
},
{
label
:
"
Akevitt
"
,
value
:
"
Akevitt
"
},
{
label
:
"
Bitter
"
,
value
:
"
Bitter
"
},
{
label
:
"
Bitter
"
,
value
:
"
Bitter
"
},
{
label
:
"
Druebrennevin
"
,
value
:
"
Druebrennevin
"
},
{
label
:
"
Druebrennevin
"
,
value
:
"
Druebrennevin
"
},
{
label
:
"
Gin
"
,
value
:
"
Gin
"
},
{
label
:
"
Gin
"
,
value
:
"
Gin
"
},
{
label
:
"
Hvitvin
"
,
value
:
"
Hvitvin
"
},
{
label
:
"
Hvitvin
"
,
value
:
"
Hvitvin
"
},
{
label
:
"
Likør
"
,
value
:
"
Likør
"
},
{
label
:
"
Likør
"
,
value
:
"
Likør
"
},
{
label
:
"
Portvin
"
,
value
:
"
Portvin
"
},
{
label
:
"
Portvin
"
,
value
:
"
Portvin
"
},
{
label
:
"
Rødvin
"
,
value
:
"
Rødvin
"
},
{
label
:
"
Rødvin
"
,
value
:
"
Rødvin
"
},
{
label
:
"
Vodka
"
,
value
:
"
Vodka
"
},
{
label
:
"
Vodka
"
,
value
:
"
Vodka
"
},
{
label
:
"
Whisky
"
,
value
:
"
Whisky
"
},
{
label
:
"
Whisky
"
,
value
:
"
Whisky
"
}
]
]
;
const
Filtering
=
()
=>
{
const
Filtering
=
()
=>
{
const
stateType
=
useSelector
(
state
=>
state
.
filter
);
const
dispatch
=
useDispatch
();
const
stateType
=
useSelector
(
state
=>
state
.
filter
);
function
updateFilter
(
e
)
{
const
dispatch
=
useDispatch
();
dispatch
(
filter
(
e
));
}
function
updateFilter
(
e
)
{
dispatch
(
filter
(
e
));
}
function
onButtonPress
(
v
)
{
function
onButtonPress
(
v
)
{
updateFilter
(
v
)
updateFilter
(
v
);
dispatch
(
toggleSideMenu
())
dispatch
(
toggleSideMenu
());
}
}
return
(
return
(
<
View
>
<
View
>
<
RadioForm
<
RadioForm
radio_props
=
{
genres
}
onPress
=
{
value
=>
onButtonPress
(
value
)}
/
>
radio_props
=
{
genres
}
<
/View
>
onPress
=
{(
value
)
=>
onButtonPress
(
value
)}
);
/
>
};
<
/View
>
)
}
export
default
Filtering
;
export
default
Filtering
;
\ No newline at end of file
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