aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/search/IconButton.tsx
diff options
context:
space:
mode:
authormadelinegr <monika_hedman@brown.edu>2019-06-14 15:04:57 -0400
committermadelinegr <monika_hedman@brown.edu>2019-06-14 15:04:57 -0400
commit9b2ea107b5073df0b86b701d743a5c25aa0b1dd6 (patch)
tree81c944470b0e1381a6beac60f2a278688939916a /src/client/views/search/IconButton.tsx
parentc301b53e9ca0a02b1a3ed15b9c0501613c2b8045 (diff)
something is incorrect!
Diffstat (limited to 'src/client/views/search/IconButton.tsx')
-rw-r--r--src/client/views/search/IconButton.tsx38
1 files changed, 38 insertions, 0 deletions
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