-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
611 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import React from 'react'; | ||
import 'antd/dist/antd.css'; | ||
import { Layout, Menu } from 'antd'; | ||
import { | ||
MenuUnfoldOutlined, | ||
MenuFoldOutlined, | ||
UserOutlined, | ||
VideoCameraOutlined, | ||
UploadOutlined, | ||
} from '@ant-design/icons'; | ||
|
||
const { Header, Sider, Content } = Layout; | ||
|
||
class MainLayout extends React.Component { | ||
state = { | ||
collapsed: false, | ||
}; | ||
|
||
toggle = () => { | ||
this.setState({ | ||
collapsed: !this.state.collapsed, | ||
}); | ||
}; | ||
|
||
render() { | ||
return ( | ||
<Layout> | ||
<Sider trigger={null} collapsible collapsed={this.state.collapsed}> | ||
<div className="logo" /> | ||
<Menu theme="dark" mode="inline" defaultSelectedKeys={['1']}> | ||
<Menu.Item key="1" icon={<UserOutlined />}> | ||
nav 1 | ||
</Menu.Item> | ||
<Menu.Item key="2" icon={<VideoCameraOutlined />}> | ||
nav 2 | ||
</Menu.Item> | ||
<Menu.Item key="3" icon={<UploadOutlined />}> | ||
nav 3 | ||
</Menu.Item> | ||
</Menu> | ||
</Sider> | ||
<Layout className="site-layout"> | ||
<Header className="site-layout-background" style={{ padding: 0 }}> | ||
{React.createElement(this.state.collapsed ? MenuUnfoldOutlined : MenuFoldOutlined, { | ||
className: 'trigger', | ||
onClick: this.toggle, | ||
})} | ||
</Header> | ||
<Content | ||
className="site-layout-background" | ||
style={{ | ||
margin: '24px 16px', | ||
padding: 24, | ||
minHeight: 280, | ||
}} | ||
> | ||
Content | ||
</Content> | ||
</Layout> | ||
</Layout> | ||
); | ||
} | ||
} | ||
|
||
export default MainLayout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.