-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
33 lines (31 loc) · 774 Bytes
/
App.js
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
import React, { useState } from 'react';
import IndexRoute from "./router/index";
import Header from "./common/component/header"
import Menu from "./common/component/menu";
import "./common/css/common.css";
import "./common/css/reset.css";
function App() {
let [showMenu, setShowMenu] = useState( false);
function changeShowMenu() {
setShowMenu(!showMenu);
}
function menuHide() {
setShowMenu(false);
}
return (
<div>
<Header changeShowMenu={changeShowMenu} />
<Menu menuHide={menuHide} />
<div
className="pageWrap"
style={{
transform: `translateX(${showMenu ? 4.5 : 0}rem)`,
}}
onTouchStart={menuHide}
>
<IndexRoute />
</div>
</div>
);
}
export default App;