|
|
@@ -16,7 +16,6 @@ class SearchTop extends React.Component {
|
|
|
this.state = {
|
|
|
text: '',
|
|
|
isScopeChildren: false,
|
|
|
- isCollapsed: true,
|
|
|
};
|
|
|
|
|
|
this.onInputChange = this.onInputChange.bind(this);
|
|
|
@@ -25,16 +24,6 @@ class SearchTop extends React.Component {
|
|
|
this.search = this.search.bind(this);
|
|
|
}
|
|
|
|
|
|
- componentWillMount() {
|
|
|
- this.initBreakpointEvents();
|
|
|
- }
|
|
|
-
|
|
|
- initBreakpointEvents() {
|
|
|
- this.props.appContainer.addBreakpointListener('md', (mql) => {
|
|
|
- this.setState({ isCollapsed: !mql.matches });
|
|
|
- }, true);
|
|
|
- }
|
|
|
-
|
|
|
onInputChange(text) {
|
|
|
this.setState({ text });
|
|
|
}
|
|
|
@@ -62,7 +51,7 @@ class SearchTop extends React.Component {
|
|
|
}
|
|
|
|
|
|
Root = ({ children }) => {
|
|
|
- const { isCollapsed } = this.state;
|
|
|
+ const { isDeviceSmallThanMd: isCollapsed } = this.props.appContainer.state;
|
|
|
|
|
|
return isCollapsed
|
|
|
? (
|