diff --git a/src/components/MainLayout/MainLayout.js b/src/components/MainLayout/MainLayout.js index 04ecbcc..c1a2042 100644 --- a/src/components/MainLayout/MainLayout.js +++ b/src/components/MainLayout/MainLayout.js @@ -1,36 +1,38 @@ -import { Layout, Menu, Breadcrumb } from "antd"; +import { Layout, Menu, Breadcrumb } from 'antd'; import { SortAscendingOutlined, GlobalOutlined, UserOutlined, IdcardOutlined, - CompassOutlined, -} from "@ant-design/icons"; -import React from "react"; -import { withNavigation } from "../../hoc/withRouterForClass"; -import { Route, Routes } from "react-router-dom"; -import "./MainLayout.css"; -import LandingPage from "../LandingPage/LandingPage"; -import UsersPage from "../Tables/UsersPage/UsersPage"; -import TicketsPage from "../Tables/TicketsPage/TicketsPage"; -import OrdersPage from "../Tables/OrdersPage/OrdersPage"; -import EnterPage from "../Tickets/EnterPage/EnterPage"; -import CheckPage from "../Tickets/CheckPage/CheckPage"; -import AccoutPage from "../AccountPage/AccoutPage"; + CompassOutlined +} from '@ant-design/icons'; +import React from 'react'; +import { withNavigation } from '../../hoc/withRouterForClass'; +import { Route, Routes } from 'react-router-dom'; +import './MainLayout.css'; +import LandingPage from '../LandingPage/LandingPage'; +import UsersPage from '../Tables/UsersPage/UsersPage'; +import TicketsPage from '../Tables/TicketsPage/TicketsPage'; +import OrdersPage from '../Tables/OrdersPage/OrdersPage'; +import EnterPage from '../Tickets/EnterPage/EnterPage'; +import CheckPage from '../Tickets/CheckPage/CheckPage'; +import AccoutPage from '../AccountPage/AccoutPage'; +import ExamplePage from '../Tables/ExamplePage/ExamplePage'; const { Content, Footer, Sider } = Layout; const keyToInfo = { - main1: { text: "랜딩 페이지", link: "/landing" }, - main2: { text: "유저 페이지", link: "/table/users" }, - main3: { text: "주문목록 페이지", link: "/table/orders" }, - main4: { text: "티켓 페이지", link: "/table/tickets" }, - main5: { text: "실시간 티켓 입장확인", link: "/tickets/enter" }, - main6: { text: "카메라 입장 확인", link: "/tickets/check" }, - main7: { text: "계정", link: "/accounts" }, + main1: { text: '랜딩 페이지', link: '/landing' }, + main2: { text: '유저 페이지', link: '/table/users' }, + main3: { text: '주문목록 페이지', link: '/table/orders' }, + main4: { text: '티켓 페이지', link: '/table/tickets' }, + main5: { text: '실시간 티켓 입장확인', link: '/tickets/enter' }, + main6: { text: '카메라 입장 확인', link: '/tickets/check' }, + main7: { text: '계정', link: '/accounts' }, + main8: { text: '예시페이지네이션', link: '/example' } }; -let clickedkeyPath = ["main1"]; +let clickedkeyPath = ['main1']; for (let key in keyToInfo) { if (keyToInfo[key].link === window.location.pathname) clickedkeyPath = [`${key}`]; @@ -39,10 +41,10 @@ for (let key in keyToInfo) { class MainLayout extends React.Component { state = { collapsed: false, - clickedkeyPath: clickedkeyPath, + clickedkeyPath: clickedkeyPath }; - onCollapse = (collapsed) => { + onCollapse = collapsed => { console.log(collapsed); this.setState({ collapsed }); }; @@ -56,18 +58,18 @@ class MainLayout extends React.Component { const { collapsed, clickedkeyPath } = this.state; console.log(window.location.pathname); return ( - +
zetciti
@@ -78,56 +80,63 @@ class MainLayout extends React.Component { style={{ // display: "flex", // flexDirection: "column", - background: "black", + background: 'black', - marginTop: "auto 0", - height: "%100", + marginTop: 'auto 0', + height: '%100' }} onClick={this.menuClick} > }> - {keyToInfo["main1"].text} + {keyToInfo['main1'].text} }> - {keyToInfo["main2"].text} + {keyToInfo['main2'].text} }> - {keyToInfo["main3"].text} + {keyToInfo['main3'].text} } - style={{ marginTop: "auto" }} + style={{ marginTop: 'auto' }} > - {keyToInfo["main4"].text} + {keyToInfo['main4'].text} } - style={{ marginTop: "auto" }} + style={{ marginTop: 'auto' }} > - {keyToInfo["main5"].text} + {keyToInfo['main5'].text} } - style={{ marginTop: "auto" }} + style={{ marginTop: 'auto' }} > - {keyToInfo["main6"].text} + {keyToInfo['main6'].text} } - style={{ marginTop: "auto" }} + style={{ marginTop: 'auto' }} > - {keyToInfo["main7"].text} + {keyToInfo['main7'].text} + + } + style={{ marginTop: 'auto' }} + > + {keyToInfo['main8'].text}
- - - {clickedkeyPath.map((e) => { + + + {clickedkeyPath.map(e => { return ( {keyToInfo[e].text} @@ -147,10 +156,11 @@ class MainLayout extends React.Component { } /> } /> } /> + } /> -