Commit d79c0e5f authored by Joakim Hantho Qvale's avatar Joakim Hantho Qvale

Merge branch 'filterstyle' of gitlab.stud.idi.ntnu.no:IT2810-H19/teams/team-8/project4

parents 898a522f 9d849c87
......@@ -2,8 +2,8 @@
"devToolsPort": 19002,
"expoServerPort": 19000,
"packagerPort": 19001,
"packagerPid": 21696,
"expoServerNgrokUrl": "https://eg-zjk.anonymous.p4.exp.direct",
"packagerNgrokUrl": "https://packager.eg-zjk.anonymous.p4.exp.direct",
"ngrokPid": 9704
"packagerPid": 11164,
"expoServerNgrokUrl": "https://sk-rhp.jallakim.p4.exp.direct",
"packagerNgrokUrl": "https://packager.sk-rhp.jallakim.p4.exp.direct",
"ngrokPid": 25936
}
......@@ -3,6 +3,6 @@
"lanType": "ip",
"dev": true,
"minify": false,
"urlRandomness": "eg-zjk",
"urlRandomness": "sk-rhp",
"https": false
}
import React from "react";
import { View } from "react-native";
import { View, Text, StyleSheet } from "react-native";
import RadioForm, {
RadioButton,
RadioButtonInput,
......@@ -27,6 +27,15 @@ const genres = [
const Filtering = () => {
const stateType = useSelector(state => state.filter);
const dispatch = useDispatch();
const styles = StyleSheet.create({
headerText:{
fontSize:20,
fontWeight:'bold',
textAlign:'center',
paddingBottom:30,
}
});
function updateFilter(e) {
dispatch(filter(e));
......@@ -34,12 +43,26 @@ const Filtering = () => {
function onButtonPress(v) {
updateFilter(v);
dispatch(toggleSideMenu());
dispatch(toggleSideMenu());
}
function indexOfGenre(value){
for(let i = 0; i < genres.length; i++){
if (value === genres[i].value){
return i
}
}
return 0;
}
return (
<View>
<RadioForm radio_props={genres} onPress={value => onButtonPress(value)} />
<View style={{paddingTop:10, paddingLeft:30, paddingRight:30, paddingBottom:30}}>
<Text style={styles.headerText}>
Kategorier
</Text>
<RadioForm radio_props={genres}
onPress={(value) => onButtonPress(value)}
initial={indexOfGenre(stateType)}
/>
</View>
);
};
......
......@@ -7,13 +7,8 @@ import { View, Text } from "react-native";
import { toggleSideMenu } from "../actions";
import { useDispatch } from "react-redux";
import {
createDrawerNavigator,
createAppContainer,
DrawerItems,
SafeAreaView
} from "react-navigation";
import { sideMenu } from "../actions";
import { getAutoFocusEnabled } from "expo/build/AR";
const SideMenu = () => {
const dispatch = useDispatch();
......@@ -21,7 +16,7 @@ const SideMenu = () => {
return (
<Overlay
<Overlay height='auto'
isVisible={stateSideMenu}
onBackdropPress={() => dispatch(toggleSideMenu())}
>
......
import React from 'react';
import {StyleSheet} from 'react-native';
// import DropdownMenu from 'react-native-dropdown-menu';
import { useSelector } from "react-redux";
import { useDispatch } from "react-redux";
import { sortingCategory } from "../actions";
import { Chevron } from 'react-native-shapes';
import RNPickerSelect, { defaultStyles } from 'react-native-picker-select';
import { Ionicons } from '@expo/vector-icons';
import { graphqlSync } from 'graphql';
const Sorting = () => {
......@@ -69,10 +66,7 @@ const Sorting = () => {
});
return(
// <RNPickerSelect
// onValueChange={(value) => dispatch(sortingCategory(value))}
// items={sortingAlternatives}
// />
<RNPickerSelect
placeholder={placeholder}
......@@ -85,10 +79,7 @@ const Sorting = () => {
right: 12,
},
}}
// value={this.state.favSport3}
useNativeAndroidPickerStyle={false}
//textInputProps={{ underlineColorAndroid: 'cyan' }}
Icon={() => {return <Chevron size={1.5} color="black" />;
}}
/>
......
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