Commit 6430a54b authored by Halvor Horge's avatar Halvor Horge

New overlay for sidemenu

parent a424efea
......@@ -2,8 +2,8 @@
"devToolsPort": 19002,
"expoServerPort": 19000,
"packagerPort": 19001,
"packagerPid": 16820,
"expoServerNgrokUrl": "https://5v-9za.hhorge.p4.exp.direct",
"packagerNgrokUrl": "https://packager.5v-9za.hhorge.p4.exp.direct",
"ngrokPid": 14216
"packagerPid": 17848,
"expoServerNgrokUrl": "https://av-4mb.hhorge.p4.exp.direct",
"packagerNgrokUrl": "https://packager.av-4mb.hhorge.p4.exp.direct",
"ngrokPid": 1920
}
......@@ -7,6 +7,7 @@ import allReducer from "./src/reducers";
import { Provider } from "react-redux";
import ApolloClient from 'apollo-boost';
import { ApolloProvider } from '@apollo/react-hooks'
import SideMenu from './src/components/SideMenu';
const client = new ApolloClient({
uri: 'http://it2810-26.idi.ntnu.no:4000'
......@@ -30,8 +31,9 @@ export default class App extends Component {
<Provider store={ store }>
<ApolloProvider client={ client }>
<Top/>
<Body/>
</ApolloProvider>
<SideMenu/>
<Body/>
</ApolloProvider>
</Provider>
</View>
);
......
This diff is collapsed.
......@@ -13,6 +13,7 @@
"expo": "^35.0.0",
"graphql": "^14.5.8",
"graphql-tag": "^2.10.1",
"native-base": "^2.13.8",
"react": "16.8.3",
"react-dom": "16.8.3",
"react-native": "0.59.10",
......@@ -25,6 +26,8 @@
"react-native-unimodules": "0.6.0",
"react-native-vector-icons": "^6.6.0",
"react-native-web": "^0.11.7",
"react-navigation": "^4.0.10",
"react-navigation-drawer": "^2.3.3",
"react-redux": "^7.1.1",
"redux": "^4.0.4"
},
......
......@@ -32,7 +32,9 @@ const GET_PRODUCTS = gql`
}
`;
const Content = () => {
const dispatch = useDispatch();
const stateAlbums = useSelector(state => state.albums);
const stateSearch = useSelector(state => state.search);
......
......@@ -5,6 +5,7 @@ import { useDispatch } from "react-redux";
import { isOverlayVisible } from "../actions";
import { Text } from 'react-native';
const Details = () => {
......
//import { SideMenu, List, ListItem } from 'react-native-elements';
import { useSelector } from "react-redux";
import Filtering from './Filtering'
import React from 'react';
import { View, Text } from 'react-native';
import { Overlay } from 'react-native-elements';
import Filtering from "./Filtering";
import React from "react";
import { View, Text } from "react-native";
import { toggleSideMenu } from "../actions";
import Drawer from 'react-native-drawer'
import { useDispatch } from "react-redux";
import { useDispatch } from "react-redux";
import {
createDrawerNavigator,
createAppContainer,
DrawerItems,
SafeAreaView
} from "react-navigation";
import { sideMenu } from "../actions";
const SideMenu = () => {
const dispatch = useDispatch();
onHamburgerClick = () =>{
dispatch(toggleSideMenu())
}
const stateSideMenu = useSelector(state => state.sideMenu);
const dispatch = useDispatch();
const stateSideMenu = useSelector(state => state.sideMenu);
return(
<View styles={styles.container}>
<Drawer
open={stateSideMenu}
type="static"
tapToClose={true}
openDrawerOffset={0.5}
closedDrawerOffset={0}
content={<Filtering/>}
styles={styles.drawerStyle}
tweenHandler={Drawer.tweenPresets.parallax}
tweenEasing={"easeInQuad"}
tweenDuration={400}
onClose={onHamburgerClick}
/>
</View>
return (
<Overlay
isVisible={stateSideMenu}
onBackdropPress={() => dispatch(toggleSideMenu())}
>
<Filtering />
</Overlay>
)
}
);
};
export default SideMenu;
\ No newline at end of file
export default SideMenu;
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