diff options
| author | Sam Wilkins <samwilkins333@gmail.com> | 2019-07-10 17:40:02 -0400 |
|---|---|---|
| committer | Sam Wilkins <samwilkins333@gmail.com> | 2019-07-10 17:40:02 -0400 |
| commit | 6ca470c067c7620cd9da7d8b8c1d553ee46f5d1c (patch) | |
| tree | 2a2d492e0c07b3a29cc36eb5b144787647410d5a /src/client/views/search/NaviconButton.tsx | |
| parent | 892608273cdfeba4cfb55c5c604bee4361b3be0e (diff) | |
| parent | 2cd8ac79b4731ca98aafe8a92fa6fb132fe9e86f (diff) | |
merged with master and prototype initialization refactor, still in progress and deathly buggy
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 |
