-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathMobileView.jsx
More file actions
42 lines (38 loc) · 1.22 KB
/
MobileView.jsx
File metadata and controls
42 lines (38 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import React , {Component} from "react";
import LeftNav from "../components/LeftNav";
class MobileView extends React.Component{
state = {
divcontainer:false,
}
render() {
const handleChange = (e) => {
this.setState({divcontainer:!this.state.divcontainer});
}
const x = this.state.divcontainer;
return (
<div className="hamburger" onClick={handleChange}>
<button>{x?"X":""}</button>
{
x &&(<LeftNav />)
}
<svg viewBox="0 0 100 80" width="25" height="25">
<rect width="100" height="20"></rect>
<rect y="30" width="100" height="20"></rect>
<rect y="60" width="100" height="20"></rect>
</svg>
</div>
)
}
}
// function MobileView() {
// const [showText, setShowText] = useState(false);
// const onClick = () => setShowText(true);
// return (
// <div>
// <button onClick={onClick}>Click me</button>
// {showText ? <Text /> : null}
// </div>
// );
// }
// const Text = () => <div>You clicked the button!</div>;
export default MobileView;