-
Notifications
You must be signed in to change notification settings - Fork 427
/
Copy pathSearchDrawerFilter.js
61 lines (56 loc) · 2.6 KB
/
SearchDrawerFilter.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import React from 'react';
import PropTypes from 'prop-types';
import {DeviceEventEmitter, Text, View, ViewPropTypes,} from 'react-native';
import {Router, Actions, Scene} from 'react-native-router-flux';
import styles, {statusHeight, drawerWidth} from "../../style"
import * as Constant from '../../style/constant'
import {SortType, SearchFilterType, SearchLanguageType} from '../../utils/filterUtils'
import SelectList from './SearchFilterSelectList'
class SearchDrawerFilter extends React.Component {
static propTypes = {
name: PropTypes.string,
sceneStyle: ViewPropTypes.style,
title: PropTypes.string,
};
static contextTypes = {
drawer: PropTypes.object,
};
render() {
return (
<View style={[styles.flex, {
backgroundColor: 'transparent',
}]}>
<View style={{backgroundColor: "#F0000000", height: statusHeight, width: drawerWidth}}>
<View
style={{backgroundColor: Constant.primaryDarkColor, height: statusHeight, width: drawerWidth}}/>
</View>
<SelectList
listStyle={{flex: 1, backgroundColor: Constant.white, marginTop: Constant.normalMarginEdge * 2}}
selectIndex={{'filerType': 0, 'filterSort': 0, "filterLanguage": 0}}
selectMap={[
{title: 'filerType', data: SearchFilterType},
{title: 'filterSort', data: SortType},
{title: 'filterLanguage', data: SearchLanguageType},
]}
onSelect={(selection, data) => {
switch (selection) {
case "filerType":
Actions.pop({refresh: {selectTypeData: data}});
DeviceEventEmitter.emit("SearchPage", {selectTypeData: data})
break;
case "filterLanguage":
Actions.pop({refresh: {selectLanguageData: data}});
DeviceEventEmitter.emit("SearchPage", {selectLanguageData: data})
break;
case "filterSort":
Actions.pop({refresh: {selectSortData: data}});
DeviceEventEmitter.emit("SearchPage", {selectSortData: data})
break;
}
}}
/>
</View>
);
}
}
export default SearchDrawerFilter;