diff options
| author | Tyler Schicke <tyler_schicke@brown.edu> | 2019-06-27 12:03:23 -0400 |
|---|---|---|
| committer | Tyler Schicke <tyler_schicke@brown.edu> | 2019-06-27 12:03:23 -0400 |
| commit | 185b888f6fb4dae3f814350bbab8030e0ed7c135 (patch) | |
| tree | 7292d7f4b65425dee3328bb95ec45fb46b86e8d2 /src/client/views/search/NaviconButton.tsx | |
| parent | 78261779207a273a7bd9ef35d66b4e787d2bf96f (diff) | |
| parent | cb9a1b6419bd0932ad05bd517efa4be668682540 (diff) | |
Merge branch 'master' of github-tsch-brown:browngraphicslab/Dash-Web into text_box_ab
Diffstat (limited to 'src/client/views/search/NaviconButton.tsx')
| -rw-r--r-- | src/client/views/search/NaviconButton.tsx | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/client/views/search/NaviconButton.tsx b/src/client/views/search/NaviconButton.tsx new file mode 100644 index 000000000..3fa36b163 --- /dev/null +++ b/src/client/views/search/NaviconButton.tsx @@ -0,0 +1,35 @@ +import * as React from 'react'; +import { observer } from 'mobx-react'; +import "./NaviconButton.scss"; +import * as $ from 'jquery'; +import { observable } from 'mobx'; + +export interface NaviconProps{ + onClick(): void; +} + +export class NaviconButton extends React.Component<NaviconProps> { + + @observable private _ref: React.RefObject<HTMLAnchorElement> = React.createRef(); + + componentDidMount = () => { + let that = this; + if(this._ref.current){this._ref.current.addEventListener("click", function(e) { + e.preventDefault(); + if(that._ref.current){ + that._ref.current.classList.toggle('active'); + return false; + } + });} + } + + render() { + return ( + <a id="hamburger-icon" href="#" ref = {this._ref} title="Menu"> + <span className="line line-1"></span> + <span className="line line-2"></span> + <span className="line line-3"></span> + </a> + ); + } +}
\ No newline at end of file |
