mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-11 03:24:16 +00:00
handle disabled sidebar item
This commit is contained in:
parent
7ef5c93564
commit
c8f6a8ddcb
@ -1,5 +1,5 @@
|
|||||||
import React from "react"
|
import React from "react"
|
||||||
import { Menu, Avatar, Button, Dropdown } from "antd"
|
import { Menu, Avatar, Button } from "antd"
|
||||||
import { Translation } from "react-i18next"
|
import { Translation } from "react-i18next"
|
||||||
import classnames from "classnames"
|
import classnames from "classnames"
|
||||||
|
|
||||||
@ -243,12 +243,18 @@ export default class Sidebar extends React.Component {
|
|||||||
</Translation>
|
</Translation>
|
||||||
</span>}
|
</span>}
|
||||||
{...item.props}
|
{...item.props}
|
||||||
|
disabled={item.disabled ?? false}
|
||||||
>
|
>
|
||||||
{this.renderMenuItems(item.children)}
|
{this.renderMenuItems(item.children)}
|
||||||
</Menu.SubMenu>
|
</Menu.SubMenu>
|
||||||
}
|
}
|
||||||
|
|
||||||
return <Menu.Item key={item.id} icon={handleRenderIcon(item.icon)} {...item.props}>
|
return <Menu.Item
|
||||||
|
key={item.id}
|
||||||
|
icon={handleRenderIcon(item.icon)}
|
||||||
|
disabled={item.disabled ?? false}
|
||||||
|
{...item.props}
|
||||||
|
>
|
||||||
<Translation>
|
<Translation>
|
||||||
{t => t(item.title ?? item.id)}
|
{t => t(item.title ?? item.id)}
|
||||||
</Translation>
|
</Translation>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user