From 2174a691adab93adf0c96afdb6250ecb91b64f3d Mon Sep 17 00:00:00 2001 From: Monika Date: Tue, 25 Jun 2019 17:30:52 -0400 Subject: lol why am i dumb lmk --- src/client/views/search/FilterBox.tsx | 30 ++++----------------------- src/client/views/search/SearchBox.tsx | 39 +++++++++++++++++------------------ 2 files changed, 23 insertions(+), 46 deletions(-) (limited to 'src') diff --git a/src/client/views/search/FilterBox.tsx b/src/client/views/search/FilterBox.tsx index 8bcfda794..cc1feeaf7 100644 --- a/src/client/views/search/FilterBox.tsx +++ b/src/client/views/search/FilterBox.tsx @@ -1,20 +1,13 @@ import * as React from 'react'; import { observer } from 'mobx-react'; -import { observable, action, runInAction } from 'mobx'; +import { observable, action } from 'mobx'; import "./SearchBox.scss"; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faTimes } from '@fortawesome/free-solid-svg-icons'; -import { library, icon } from '@fortawesome/fontawesome-svg-core'; -import * as rp from 'request-promise'; -import { SearchItem } from './SearchItem'; -import { DocServer } from '../../DocServer'; +import { library} from '@fortawesome/fontawesome-svg-core'; import { Doc } from '../../../new_fields/Doc'; import { Id } from '../../../new_fields/FieldSymbols'; -import { SetupDrag } from '../../util/DragManager'; -import { Docs, DocTypes } from '../../documents/Documents'; -import { RouteStore } from '../../../server/RouteStore'; -import { NumCast, Cast, StrCast } from '../../../new_fields/Types'; -import { SearchUtil } from '../../util/SearchUtil'; +import { DocTypes } from '../../documents/Documents'; +import { Cast, StrCast } from '../../../new_fields/Types'; import * as _ from "lodash"; import { ToggleBar } from './ToggleBar'; import { IconBar } from './IconBar'; @@ -24,7 +17,6 @@ import { DocumentView } from '../nodes/DocumentView'; import { CollectionFilters } from './CollectionFilters'; import { NaviconButton } from './NaviconButton'; import * as $ from 'jquery'; -import * as anime from 'animejs'; import "./FilterBox.scss"; import { SearchBox } from './SearchBox'; @@ -63,7 +55,6 @@ export class FilterBox extends React.Component { FilterBox.Instance = this; } - // might need to add to search box componentDidMount = () => { document.addEventListener("pointerdown", (e) => { if (e.timeStamp !== this._pointerTime) { @@ -125,18 +116,6 @@ export class FilterBox extends React.Component { CollectionFilters.Instance.resetCollectionFilters(); } - //-------------------------------------------------------------------------------------------------------------- - // @action.bound - // onChange(e: React.ChangeEvent) { - // this._searchString = e.target.value; - - // if (this._searchString === "") { - // this._results = []; - // this._openNoResults = false; - // } - // } - //-------------------------------------------------------------------------------------------------------------- - basicRequireWords(query: string): string { let oldWords = query.split(" "); let newWords: string[] = []; @@ -343,7 +322,6 @@ export class FilterBox extends React.Component { return (
-
{this._filterOpen ? ( diff --git a/src/client/views/search/SearchBox.tsx b/src/client/views/search/SearchBox.tsx index e9eefa29a..3c401138e 100644 --- a/src/client/views/search/SearchBox.tsx +++ b/src/client/views/search/SearchBox.tsx @@ -25,7 +25,7 @@ export class SearchBox extends React.Component { @observable private _openNoResults: boolean = false; static Instance: SearchBox; - constructor(props: any){ + constructor(props: any) { super(props); SearchBox.Instance = this; @@ -112,8 +112,6 @@ export class SearchBox extends React.Component { docs.push(field); } } - // this.props.setUnfilteredResults(docs); - // return docs; return FilterBox.Instance.filterDocsByType(docs); } @@ -177,25 +175,26 @@ export class SearchBox extends React.Component { } render() { - return( + return (
-
- - - - -
-
- {(this._results.length !== 0) ? ( - this._results.map(result => ) - ) : - this._openNoResults ? (
No Search Results
) : null} - -
+
+ + + + +
- ) +
+ {(this._results.length !== 0) ? ( + this._results.map(result => ) + ) : + this._openNoResults ? (
No Search Results
) : null} + +
+
+ ); } } \ No newline at end of file -- cgit v1.2.3-70-g09d2