site: solve rebase problems

This commit is contained in:
Benjy Cui 2016-05-11 12:06:13 +08:00
parent be2bac4b25
commit 665a4aa3b2
3 changed files with 23 additions and 19 deletions

View File

@ -92,21 +92,24 @@ export default class Header extends React.Component {
activeMenuItem = activeMenuItem === 'components' ? 'docs/react' : activeMenuItem;
const locale = this.context.intl.locale;
const options = Object.keys(componentsList).map((key) => {
const value = componentsList[key];
return value.localized ? value[locale] : value;
}).filter(({ meta }) => {
return /^component/.test(meta.fileName);
}).map(({ meta }) => {
const pathSnippet = meta.fileName.split('/')[1];
const url = `/components/${pathSnippet}`;
return (
<Option value={url} key={url} data-label={`${(meta.title || meta.english).toLowerCase()} ${meta.subtitle || meta.chinese}`}>
<strong>{meta.title || meta.english}</strong>
<span className="ant-component-decs">{meta.subtitle || meta.chinese}</span>
</Option>
);
});
const options = Object.keys(componentsList)
.map((key) => {
const value = componentsList[key];
return value.localized ? value[locale] : value;
})
.filter(({ meta }) => {
return /^component/.test(meta.fileName);
})
.map(({ meta }) => {
const pathSnippet = meta.fileName.split('/')[1];
const url = `/components/${pathSnippet}`;
return (
<Option value={url} key={url} data-label={`${(meta.title || meta.english).toLowerCase()} ${meta.subtitle || meta.chinese}`}>
<strong>{meta.title || meta.english}</strong>
<span className="ant-component-decs">{meta.subtitle || meta.chinese}</span>
</Option>
);
});
const menuStyle = {
display: this.state.menuVisible ? 'block' : '',

View File

@ -49,7 +49,7 @@ export default class MainContent extends React.Component {
const text = isTop ?
item.chinese || item.english : [
<span key="english">{item.title || item.english}</span>,
<span className="chinese" key="chinese">{item.subtitle || item.chinese}</span>
<span className="chinese" key="chinese">{item.subtitle || item.chinese}</span>,
];
const disabled = item.disabled;
const url = item.fileName.replace(/(\/index)?((\.zh-CN)|(\.en-US))?\.md$/i, '');

View File

@ -99,9 +99,10 @@ ReactDOM.render(
<Route path=":children"
onEnter={utils.getEnterHandler(resource)}
component={utils.getChildrenWrapper(resource)} />
</Route>
<Route path="*" component={NotFound} />
</Router>
</Route>
<Route path="*" component={NotFound} />
</Route>
</Router>
</IntlProvider>
, document.getElementById('react-content')
);