|
@@ -61,9 +61,9 @@ export default class ProximoListScreen extends React.Component<Props, State> {
|
61
|
61
|
this.originalData = this.props.route.params['data']['data'];
|
62
|
62
|
this.shouldFocusSearchBar = this.props.route.params['shouldFocusSearchBar'];
|
63
|
63
|
this.state = {
|
64
|
|
- currentlyDisplayedData: this.originalData,
|
|
64
|
+ currentlyDisplayedData: this.originalData.sort(sortPrice),
|
65
|
65
|
currentSortMode: 1,
|
66
|
|
- modalCurrentDisplayItem: <View/>,
|
|
66
|
+ modalCurrentDisplayItem: null,
|
67
|
67
|
};
|
68
|
68
|
|
69
|
69
|
this.onSearchStringChange = this.onSearchStringChange.bind(this);
|
|
@@ -72,6 +72,20 @@ export default class ProximoListScreen extends React.Component<Props, State> {
|
72
|
72
|
this.onModalRef = this.onModalRef.bind(this);
|
73
|
73
|
}
|
74
|
74
|
|
|
75
|
+
|
|
76
|
+ /**
|
|
77
|
+ * Set the sort mode from state when components are ready
|
|
78
|
+ */
|
|
79
|
+ componentDidMount() {
|
|
80
|
+ const button = this.getSortMenu.bind(this);
|
|
81
|
+ const title = this.getSearchBar.bind(this);
|
|
82
|
+ this.props.navigation.setOptions({
|
|
83
|
+ headerRight: button,
|
|
84
|
+ headerTitle: title,
|
|
85
|
+ headerTitleContainerStyle: {marginHorizontal: 0, right: 50, left: 50},
|
|
86
|
+ });
|
|
87
|
+ }
|
|
88
|
+
|
75
|
89
|
/**
|
76
|
90
|
* Set the current sort mode.
|
77
|
91
|
*
|
|
@@ -101,20 +115,6 @@ export default class ProximoListScreen extends React.Component<Props, State> {
|
101
|
115
|
}
|
102
|
116
|
}
|
103
|
117
|
|
104
|
|
- /**
|
105
|
|
- * Set the sort mode from state when components are ready
|
106
|
|
- */
|
107
|
|
- componentDidMount() {
|
108
|
|
- const button = this.getSortMenu.bind(this);
|
109
|
|
- const title = this.getSearchBar.bind(this);
|
110
|
|
- this.props.navigation.setOptions({
|
111
|
|
- headerRight: button,
|
112
|
|
- headerTitle: title,
|
113
|
|
- headerTitleContainerStyle: {marginHorizontal: 0, right: 50, left: 50},
|
114
|
|
- });
|
115
|
|
- this.setSortMode(1);
|
116
|
|
- }
|
117
|
|
-
|
118
|
118
|
getSearchBar() {
|
119
|
119
|
return (
|
120
|
120
|
<Searchbar
|