Commit 186a6fff authored by Halvor Horge's avatar Halvor Horge

Attempt at hamburgermenu

parent 4a82a05b
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
"devToolsPort": 19002, "devToolsPort": 19002,
"expoServerPort": 19000, "expoServerPort": 19000,
"packagerPort": 19001, "packagerPort": 19001,
"packagerPid": 2212, "packagerPid": 16820,
"expoServerNgrokUrl": "https://5v-9za.anonymous.p4.exp.direct", "expoServerNgrokUrl": "https://5v-9za.hhorge.p4.exp.direct",
"packagerNgrokUrl": "https://packager.5v-9za.anonymous.p4.exp.direct", "packagerNgrokUrl": "https://packager.5v-9za.hhorge.p4.exp.direct",
"ngrokPid": 1260 "ngrokPid": 14216
} }
...@@ -8,7 +8,6 @@ import SideMenuComp from './SideMenu' ...@@ -8,7 +8,6 @@ import SideMenuComp from './SideMenu'
//import Content from '../Content/Content.js'; //import Content from '../Content/Content.js';
//import Wordcloud from '../Wordcloud/Wordcloud.js'; //import Wordcloud from '../Wordcloud/Wordcloud.js';
//hello
const Body = () => { const Body = () => {
return( return(
<ScrollView> <ScrollView>
......
import { SideMenu, List, ListItem } from 'react-native-elements'; //import { SideMenu, List, ListItem } from 'react-native-elements';
import { useSelector } from "react-redux"; import { useSelector } from "react-redux";
import Filtering from './Filtering' import Filtering from './Filtering'
import React from 'react'; import React from 'react';
import { View, Text } from 'react-native'; import { View, Text } from 'react-native';
import { toggleSideMenu } from "../actions";
import Drawer from 'react-native-drawer'
import { useDispatch } from "react-redux";
const SideMenuComp = () => {
const SideMenu = () => {
const dispatch = useDispatch();
onHamburgerClick = () =>{
dispatch(toggleSideMenu())
}
const stateSideMenu = useSelector(state => state.sideMenu); const stateSideMenu = useSelector(state => state.sideMenu);
return( return(
<SideMenu <View styles={styles.container}>
isOpen={false} <Drawer
menu={stateSideMenu} open={stateSideMenu}
> type="static"
tapToClose={true}
</SideMenu> openDrawerOffset={0.5}
closedDrawerOffset={0}
content={<Filtering/>}
styles={styles.drawerStyle}
tweenHandler={Drawer.tweenPresets.parallax}
tweenEasing={"easeInQuad"}
tweenDuration={400}
onClose={onHamburgerClick}
/>
</View>
) )
} }
export default SideMenuComp; export default SideMenu;
\ No newline at end of file \ No newline at end of file
...@@ -7,10 +7,14 @@ import { toggleSideMenu } from "../actions"; ...@@ -7,10 +7,14 @@ import { toggleSideMenu } from "../actions";
const Top = () =>{ const Top = () =>{
const dispatch = useDispatch(); const dispatch = useDispatch();
onHamburgerClick = () =>{
dispatch(toggleSideMenu())
}
return( return(
<Header style={styles.container} <Header style={styles.container}
leftComponent={{ icon: 'menu', color: '#fff'}} leftComponent={{ icon: 'menu', color: '#fff', onPress: () => onHamburgerClick()}}
centerComponent={{ text: 'MY TITLE', style: { color: '#fff' } }} centerComponent={{ text: 'MY TITLE', style: { color: '#fff' } }}
rightComponent={{ icon: 'home', color: '#fff' }} rightComponent={{ icon: 'home', color: '#fff' }}
/> />
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment