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

#6 added sorting buttons, but they dont work yet

parent 1e8493f5
{
"devToolsPort": 19002,
"expoServerPort": 19000,
"packagerPort": 19001,
"packagerPid": 15348,
"expoServerNgrokUrl": "https://av-4mb.hhorge.p4.exp.direct",
"packagerNgrokUrl": "https://packager.av-4mb.hhorge.p4.exp.direct",
"ngrokPid": 18008
"packagerPort": null,
"packagerPid": null,
"expoServerNgrokUrl": "https://cs-j3h.jallakim.p4.exp.direct",
"packagerNgrokUrl": "https://packager.cs-j3h.jallakim.p4.exp.direct",
"ngrokPid": 20464
}
......@@ -3,6 +3,6 @@
"lanType": "ip",
"dev": true,
"minify": false,
"urlRandomness": "av-4mb",
"urlRandomness": "cs-j3h",
"https": false
}
......@@ -3630,8 +3630,7 @@
"ansi-regex": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
"optional": true
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8="
},
"aproba": {
"version": "1.2.0",
......@@ -3652,14 +3651,12 @@
"balanced-match": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
"optional": true
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
},
"brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
......@@ -3674,20 +3671,17 @@
"code-point-at": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
"optional": true
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c="
},
"concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
"optional": true
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
},
"console-control-strings": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
"integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=",
"optional": true
"integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4="
},
"core-util-is": {
"version": "1.0.2",
......@@ -3804,8 +3798,7 @@
"inherits": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
"optional": true
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
},
"ini": {
"version": "1.3.5",
......@@ -3817,7 +3810,6 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
......@@ -3832,7 +3824,6 @@
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
......@@ -3840,14 +3831,12 @@
"minimist": {
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
"optional": true
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0="
},
"minipass": {
"version": "2.3.5",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.5.tgz",
"integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==",
"optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
......@@ -3866,7 +3855,6 @@
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"optional": true,
"requires": {
"minimist": "0.0.8"
}
......@@ -3947,8 +3935,7 @@
"number-is-nan": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
"optional": true
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0="
},
"object-assign": {
"version": "4.1.1",
......@@ -3960,7 +3947,6 @@
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"optional": true,
"requires": {
"wrappy": "1"
}
......@@ -4046,8 +4032,7 @@
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
"optional": true
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
},
"safer-buffer": {
"version": "2.1.2",
......@@ -4083,7 +4068,6 @@
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
......@@ -4103,7 +4087,6 @@
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
......@@ -4147,14 +4130,12 @@
"wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
"optional": true
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
},
"yallist": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz",
"integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==",
"optional": true
"integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A=="
}
}
},
......@@ -5518,6 +5499,11 @@
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A=="
},
"lodash.isequal": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz",
"integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA="
},
"lodash.pad": {
"version": "4.5.1",
"resolved": "https://registry.npmjs.org/lodash.pad/-/lodash.pad-4.5.1.tgz",
......@@ -7943,6 +7929,14 @@
"tween-functions": "^1.0.1"
}
},
"react-native-dropdown-menu": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/react-native-dropdown-menu/-/react-native-dropdown-menu-2.0.0.tgz",
"integrity": "sha1-HZ5mFNw3mbeeMVH4pU+y2Dx9iZ8=",
"requires": {
"prop-types": "^15.6.1"
}
},
"react-native-elements": {
"version": "1.2.7",
"resolved": "https://registry.npmjs.org/react-native-elements/-/react-native-elements-1.2.7.tgz",
......@@ -7979,6 +7973,19 @@
"prop-types": "^15.7.2"
}
},
"react-native-picker": {
"version": "4.3.7",
"resolved": "https://registry.npmjs.org/react-native-picker/-/react-native-picker-4.3.7.tgz",
"integrity": "sha1-mELoxi/w2LZ26VFNn5FyQTwFGKg="
},
"react-native-picker-select": {
"version": "6.3.3",
"resolved": "https://registry.npmjs.org/react-native-picker-select/-/react-native-picker-select-6.3.3.tgz",
"integrity": "sha512-9cSXWonugev+e0EHrV8FhzwkjAhpipLFXsGMv+Ns5xI47T9fyNrOXpSeSfgnmycbuAbWRVlJRhJZ9eDGUaNk7w==",
"requires": {
"lodash.isequal": "^4.5.0"
}
},
"react-native-ratings": {
"version": "6.5.0",
"resolved": "https://registry.npmjs.org/react-native-ratings/-/react-native-ratings-6.5.0.tgz",
......
......@@ -17,8 +17,11 @@
"react-dom": "16.8.3",
"react-native": "0.59.10",
"react-native-drawer": "^2.5.1",
"react-native-dropdown-menu": "^2.0.0",
"react-native-elements": "^1.2.7",
"react-native-gesture-handler": "~1.4.1",
"react-native-picker": "^4.3.7",
"react-native-picker-select": "^6.3.3",
"react-native-reanimated": "~1.3.0",
"react-native-screens": "1.0.0-alpha.23",
"react-native-simple-radio-button": "^2.7.4",
......
......@@ -58,12 +58,19 @@ export const defaultPage = () => {
export const isOverlayVisible = () => {
return{
type : 'VISIBLE',
}
type : 'VISIBLE'
}
}
export const toggleSideMenu = () => {
return{
type : 'SIDEMENU',
type : 'SIDEMENU'
}
}
export const sortingCategory = (a) => {
return {
type : 'SORT',
payload : a
}
}
\ No newline at end of file
......@@ -5,6 +5,7 @@ import Search from './Search';
import Content from './Content'
import Filtering from './Filtering'
import SideMenuComp from './SideMenu'
import Sorting from './Sorting';
//import Content from '../Content/Content.js';
//import Wordcloud from '../Wordcloud/Wordcloud.js';
......@@ -12,6 +13,7 @@ const Body = () => {
return(
<ScrollView>
<Search/>
<Sorting/>
<Content/>
<Filtering/>
</ScrollView>
......
import React from 'react';
import {Text, View } from 'react-native';
// import DropdownMenu from 'react-native-dropdown-menu';
import { useSelector } from "react-redux";
import { useDispatch } from "react-redux";
import { sortingCategory } from "../actions";
const Sorting = () => {
const stateSort = useSelector(state => state.sortingCategory);
const dispatch = useDispatch();
<Picker
selectedValue={this.state.language}
style={{height: 50, width: 100}}
onValueChange={(itemValue, itemIndex) =>
this.setState({language: itemValue})
}>
<Picker.Item label="Java" value="java" />
<Picker.Item label="JavaScript" value="js" />
</Picker>
// var data = [["C", "B"],["milos", "beige", "cadt"], ["C", "B"]];
// return (
// <View>
// <Text>
// Milosssssss
// </Text>
// <DropdownMenu
// style={{flex: 1}}
// bgColor={'white'}
// tintColor={'#666666'}
// activityTintColor={'green'}
// handler={(selection, row) => dispatch(sortingCategory(data[selection][row]))}
// data={data}
// >
// <View style={{flex: 1}}>
// <Text>
// {stateSort} is the best language in the world
// </Text>
// </View>
// </DropdownMenu>
// </View>
// )
}
export default Sorting;
......@@ -7,6 +7,7 @@ import detailsReducer from './details';
import toggleSideMenu from './toggleSideMenu';
import pageReducer from './page';
import isOverlayVisibleReducer from './isOverlayVisible'
import sortingReducer from './sort'
import {combineReducers} from 'redux';
......@@ -18,7 +19,8 @@ const allReducers = combineReducers({
details : detailsReducer,
page : pageReducer,
overlay : isOverlayVisibleReducer,
sideMenu : toggleSideMenu
sideMenu : toggleSideMenu,
sortingCategory : sortingReducer
})
export default allReducers;
......
const sortingReducer = (state = '', action) => {
switch(action.type){
case 'SORT':
state = action.payload;
return state;
default:
return state;
}
}
export default sortingReducer;
\ No newline at end of file
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