diff options
| author | Monika <monika_hedman@brown.edu> | 2019-06-21 15:00:16 -0400 |
|---|---|---|
| committer | Monika <monika_hedman@brown.edu> | 2019-06-21 15:00:16 -0400 |
| commit | a70ac0d98f879d2f9b8824e51dcab62b840f0b8a (patch) | |
| tree | 7b8947768d8b638dc9312894be903a7ba1a6fe8c /src/client/views/search/NaviconButton.tsx | |
| parent | f05b323cff1f09c5c84042aa30ad57b2ac74b7cb (diff) | |
mleh end of day 6/21
Diffstat (limited to 'src/client/views/search/NaviconButton.tsx')
| -rw-r--r-- | src/client/views/search/NaviconButton.tsx | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/src/client/views/search/NaviconButton.tsx b/src/client/views/search/NaviconButton.tsx index d89874453..8c022fab6 100644 --- a/src/client/views/search/NaviconButton.tsx +++ b/src/client/views/search/NaviconButton.tsx @@ -4,26 +4,17 @@ import "./NaviconButton.scss"; import * as $ from 'jquery'; import { observable } from 'mobx'; +export interface NaviconProps{ + onClick(): void; +} -export class NaviconButton extends React.Component { + +export class NaviconButton extends React.Component<NaviconProps> { @observable ref: React.RefObject<HTMLAnchorElement> = React.createRef(); componentDidMount = () => { - // this.ref = React.createRef(); - // $(document).ready(function () { - // var hamburger = $('#hamburger-icon'); - // hamburger.click(function () { - // hamburger.toggleClass('active'); - // console.log("toggling 1") - // return false; - // }); - // }); - - // document.addEventListener("click", this.toggle) - let that = this; - if(this.ref.current){this.ref.current.addEventListener("click", function(e) { e.preventDefault(); if(that.ref.current){ @@ -31,16 +22,9 @@ export class NaviconButton extends React.Component { console.log("toggling 2") return false; } - })} - + })}; } - // toggle = (e: MouseEvent) => { - // this.ref.current.toggleClass('active'); - // console.log("toggling 2") - // return false; - // } - render() { return ( <a id="hamburger-icon" href="#" ref = {this.ref} title="Menu"> |
