mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-01 11:39:28 +08:00
chore: update disabled style
This commit is contained in:
parent
b755dd5050
commit
cf74561ef5
@ -18,6 +18,10 @@
|
||||
|
||||
.sidebar {
|
||||
padding-bottom: 50px;
|
||||
|
||||
a[disabled] {
|
||||
color: #ccc;
|
||||
}
|
||||
}
|
||||
|
||||
.sidebar .chinese {
|
||||
|
@ -9,18 +9,19 @@ export default class MainContent extends React.Component {
|
||||
return props.menuItems.map((item) => {
|
||||
const key = item.english.toLowerCase();
|
||||
const text = item.chinese || item.english;
|
||||
const disabled = item.disabled === 'true';
|
||||
|
||||
const child = !item.link ?
|
||||
<Link to={`/${props.category}/${key}`}>
|
||||
<Link to={`/${props.category}/${key}`} disabled={disabled}>
|
||||
{ text }
|
||||
</Link> :
|
||||
<a href={item.link} target="_blank">
|
||||
<a href={item.link} target="_blank" disabled={disabled}>
|
||||
{ text }
|
||||
</a>;
|
||||
|
||||
return (
|
||||
<Menu.Item key={key} disabled={item.disabled === 'true'}>
|
||||
{ item.disabled ? <span>{text}</span> : child }
|
||||
<Menu.Item key={key} disabled={disabled}>
|
||||
{ child }
|
||||
</Menu.Item>
|
||||
);
|
||||
});
|
||||
@ -34,7 +35,7 @@ export default class MainContent extends React.Component {
|
||||
return (
|
||||
<Row className="main-wrapper">
|
||||
<Col span="4">
|
||||
<Menu mode="inline" selectedKeys={[activeMenuItem]}>
|
||||
<Menu mode="inline" selectedKeys={[activeMenuItem]} className="sidebar">
|
||||
{ menuItems }
|
||||
</Menu>
|
||||
</Col>
|
||||
|
Loading…
Reference in New Issue
Block a user