mirror of
https://github.com/zuiidea/antd-admin
synced 2026-10-24 17:24:04 +00:00
29 lines
778 B
JavaScript
29 lines
778 B
JavaScript
import React from 'react'
|
|
import { Icon, Switch } from 'antd'
|
|
import styles from './main.less'
|
|
import { config } from '../../utils'
|
|
import Menus from './menu'
|
|
|
|
function Sider ({ siderFold, darkTheme, location, changeTheme }) {
|
|
const menusProps = {
|
|
siderFold,
|
|
darkTheme,
|
|
location
|
|
}
|
|
return (
|
|
<div>
|
|
<div className={styles.logo}>
|
|
<img src={config.logoSrc} />
|
|
{siderFold ? '' : <span>{config.logoText}</span>}
|
|
</div>
|
|
<Menus {...menusProps} />
|
|
{!siderFold ? <div className={styles.switchtheme}>
|
|
<span><Icon type='bulb' />切换主题</span>
|
|
<Switch onChange={changeTheme} defaultChecked={darkTheme} checkedChildren='黑' unCheckedChildren='白' />
|
|
</div> : ''}
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default Sider
|