diff options
-rw-r--r-- | src/client/views/search/IconBar.tsx | 2 | ||||
-rw-r--r-- | src/client/views/search/IconButton.tsx | 38 | ||||
-rw-r--r-- | src/client/views/search/SearchBox.tsx | 5 | ||||
-rw-r--r-- | src/client/views/search/minus.svg | 5 | ||||
-rw-r--r-- | src/client/views/search/plus.svg | 5 |
5 files changed, 44 insertions, 11 deletions
diff --git a/src/client/views/search/IconBar.tsx b/src/client/views/search/IconBar.tsx index bc3b04ef3..abec9a8b5 100644 --- a/src/client/views/search/IconBar.tsx +++ b/src/client/views/search/IconBar.tsx @@ -343,7 +343,7 @@ export class IconBar extends React.Component<IconBarProps> { data-selected={"false"} data-removed={"false"} onClick={() => { this.onClick(DocTypes.NONE); }}> - <FontAwesomeIcon className="fontawesome-icon filter" style={{ order: -2 }} icon={faBan} /> + <FontAwesomeIcon className="fontawesome-icon" style={{ order: -2 }} icon={faBan} /> </div> <div className="filter-description">Clear</div> </div> diff --git a/src/client/views/search/IconButton.tsx b/src/client/views/search/IconButton.tsx new file mode 100644 index 000000000..30dd3676d --- /dev/null +++ b/src/client/views/search/IconButton.tsx @@ -0,0 +1,38 @@ +import * as React from 'react'; +import { observer } from 'mobx-react'; +import { observable, action, runInAction } from 'mobx'; +import "./SearchBox.scss"; +import "./IconBar.scss"; +import { faSearch, faFilePdf, faFilm, faImage, faObjectGroup, faStickyNote, faMusic, faLink, faChartBar, faGlobeAsia, faBan } from '@fortawesome/free-solid-svg-icons'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { library, icon } from '@fortawesome/fontawesome-svg-core'; + +interface IconButtonProps { + ref: React.RefObject<HTMLDivElement>; + isRefSelected(r: any): boolean; + isRemoved(ref: any): boolean; + type: string; + getInitialSelectedStatus(ref: any): string; + getInitialRemovedStatus(ref: any): string; + onClick(t: string): void; + icon: any; +} + +@observer +export class IconButton extends React.Component<IconButtonProps>{ + + render() { + return ( + <div className="type-outer"> + <div className={"type-icon filter " + (this.props.isRefSelected(this.props.ref) ? "selected " + (this.props.isRemoved(this.props.ref) ? "removed" : "add") : "not-selected")} + ref={this.props.ref} + data-selected={this.props.getInitialSelectedStatus(this.props.type)} + data-removed={this.props.getInitialRemovedStatus(this.props.type)} + onClick={() => { this.props.onClick(this.props.type); }}> + <FontAwesomeIcon className="fontawesome-icon" icon={this.props.icon} /> + </div> + <div className="filter-description">{this.props.type}</div> + </div> + ); + } +}
\ No newline at end of file diff --git a/src/client/views/search/SearchBox.tsx b/src/client/views/search/SearchBox.tsx index 4befb99ec..5445f9cb0 100644 --- a/src/client/views/search/SearchBox.tsx +++ b/src/client/views/search/SearchBox.tsx @@ -81,6 +81,8 @@ export class SearchBox extends React.Component { let query = this._searchString; let results: Doc[]; + console.log(query) + //if this._wordstatus is false, all words are required and a + is added before each if (!this._wordStatus) { let oldWords = query.split(" "); @@ -102,6 +104,8 @@ export class SearchBox extends React.Component { results = await this.getResults(query); } + console.log(results) + runInAction(() => { this._resultsOpen = true; this._results = results; @@ -126,6 +130,7 @@ export class SearchBox extends React.Component { docs.push(field); } } + console.log(docs) return this.filterDocs(docs); } diff --git a/src/client/views/search/minus.svg b/src/client/views/search/minus.svg deleted file mode 100644 index 63cd809f6..000000000 --- a/src/client/views/search/minus.svg +++ /dev/null @@ -1,5 +0,0 @@ -<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" version="1.1" style="shape-rendering:geometricPrecision;text-rendering:geometricPrecision;image-rendering:optimizeQuality;" viewBox="0 0 738 922.5" x="0px" y="0px" fill-rule="evenodd" clip-rule="evenodd"><defs><style type="text/css"> - - .fil0 {fill:black} - - </style></defs><g><path class="fil0" d="M369 0c203,0 369,165 369,369 0,203 -166,369 -369,369 -204,0 -369,-166 -369,-369 0,-204 165,-369 369,-369zm-197 305l394 0c35,0 64,29 64,64 0,35 -29,64 -64,64l-394 0c-36,0 -65,-29 -65,-64 0,-36 29,-64 65,-64z"/></g><text x="0" y="753" fill="#000000" font-size="5px" font-weight="bold" font-family="'Helvetica Neue', Helvetica, Arial-Unicode, Arial, Sans-serif">Created by Manaqib S</text><text x="0" y="758" fill="#000000" font-size="5px" font-weight="bold" font-family="'Helvetica Neue', Helvetica, Arial-Unicode, Arial, Sans-serif">from the Noun Project</text></svg>
\ No newline at end of file diff --git a/src/client/views/search/plus.svg b/src/client/views/search/plus.svg deleted file mode 100644 index deb855637..000000000 --- a/src/client/views/search/plus.svg +++ /dev/null @@ -1,5 +0,0 @@ -<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" version="1.1" style="shape-rendering:geometricPrecision;text-rendering:geometricPrecision;image-rendering:optimizeQuality;" viewBox="0 0 443 553.75" x="0px" y="0px" fill-rule="evenodd" clip-rule="evenodd"><defs><style type="text/css"> - - .fil0 {fill:black} - - </style></defs><g><path class="fil0" d="M221 0c123,0 222,99 222,221 0,123 -99,222 -222,222 -122,0 -221,-99 -221,-222 0,-122 99,-221 221,-221zm0 46c18,0 33,15 33,33l0 109 109 0c19,0 34,15 34,33 0,18 -15,33 -34,33l-109 0 0 109c0,19 -15,34 -33,34 -18,0 -33,-15 -33,-34l0 -109 -109 0c-18,0 -33,-15 -33,-33 0,-18 15,-33 33,-33l109 0 0 -109c0,-18 15,-33 33,-33z"/></g><text x="0" y="458" fill="#000000" font-size="5px" font-weight="bold" font-family="'Helvetica Neue', Helvetica, Arial-Unicode, Arial, Sans-serif">Created by mohkamil</text><text x="0" y="463" fill="#000000" font-size="5px" font-weight="bold" font-family="'Helvetica Neue', Helvetica, Arial-Unicode, Arial, Sans-serif">from the Noun Project</text></svg>
\ No newline at end of file |