init commit
This commit is contained in:
33
src/App.js
Normal file
33
src/App.js
Normal file
@@ -0,0 +1,33 @@
|
||||
// import "./App.css";
|
||||
import "./global.css";
|
||||
import "./index.css";
|
||||
import Head from "./components/公共组件/顶部公司名称";
|
||||
// import { SocketContextProvider } from "../store/socket-data-provider";
|
||||
import useSlider, { Slider } from "./hooks/useSlider";
|
||||
import NavMenu from "./components/公共组件/导航菜单";
|
||||
import { useState } from "react";
|
||||
import Home from "./pages/总览";
|
||||
import EnergyAnalysis from "./pages/能耗分析";
|
||||
import RulerContainer from "./components/工具组件/Ruler";
|
||||
import { createPortal } from "react-dom";
|
||||
|
||||
function App() {
|
||||
const { styles, value, setValue } = useSlider(100);
|
||||
const [navActive, setNavActive] = useState("窑炉总览");
|
||||
|
||||
return (
|
||||
<>
|
||||
<div id="FullScreen" style={styles}>
|
||||
<NavMenu active={navActive} onChangeActive={(v) => setNavActive(v)} />
|
||||
<Head />
|
||||
|
||||
{navActive == "能耗分析" && <EnergyAnalysis />}
|
||||
{navActive != "能耗分析" && <Home active={navActive} />}
|
||||
</div>
|
||||
<Slider value={value} setValue={setValue} />
|
||||
{createPortal(<RulerContainer />, document.body)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default App;
|
||||
Reference in New Issue
Block a user