chore: update disabled style

This commit is contained in:
Benjy Cui 2016-03-02 12:10:18 +08:00
parent b755dd5050
commit cf74561ef5
2 changed files with 10 additions and 5 deletions

View File

@ -18,6 +18,10 @@
.sidebar {
padding-bottom: 50px;
a[disabled] {
color: #ccc;
}
}
.sidebar .chinese {

View File

@ -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>