55 * This source code is licensed under the license found in the LICENSE file in
66 * the root directory of this source tree.
77 */
8- import * as Filters from 'lib/Filters' ;
9- import { List , Map } from 'immutable' ;
10- import PropTypes from 'lib/PropTypes' ;
11- import React from 'react' ;
12- import stringCompare from 'lib/stringCompare' ;
13- import ParseApp from 'lib/ParseApp ' ;
8+ import * as Filters from 'lib/Filters' ;
9+ import { List , Map } from 'immutable' ;
10+ import PropTypes from 'lib/PropTypes' ;
11+ import React from 'react' ;
12+ import stringCompare from 'lib/stringCompare' ;
13+ import { CurrentApp } from 'context/currentApp ' ;
1414
1515function changeField ( schema , filters , index , newField ) {
1616 let newFilter = new Map ( {
@@ -44,7 +44,8 @@ function deleteRow(filters, index) {
4444 return filters . delete ( index ) ;
4545}
4646
47- let Filter = ( { schema, filters, renderRow, onChange, blacklist, className } , context ) => {
47+ let Filter = ( { schema, filters, renderRow, onChange, blacklist, className } ) => {
48+ const currentApp = React . useContext ( CurrentApp ) ;
4849 blacklist = blacklist || [ ] ;
4950 let available = Filters . availableFilters ( schema , filters ) ;
5051 return (
@@ -60,7 +61,7 @@ let Filter = ({ schema, filters, renderRow, onChange, blacklist, className }, co
6061 }
6162
6263 // Get the column preference of the current class.
63- const currentColumnPreference = context . currentApp . columnPreference [ className ] ;
64+ const currentColumnPreference = currentApp . columnPreference [ className ] ;
6465
6566 // Check if the preference exists.
6667 if ( currentColumnPreference ) {
@@ -137,7 +138,3 @@ Filter.propTypes = {
137138 'A function for rendering a row of a filter.'
138139 )
139140} ;
140-
141- Filter . contextTypes = {
142- currentApp : PropTypes . instanceOf ( ParseApp )
143- } ;
0 commit comments