Benjy Cui
9 years ago
23 changed files with 94 additions and 53 deletions
@ -0,0 +1,20 @@ |
|||
module.exports = { |
|||
source: ['./components', './docs'], |
|||
theme: './site/theme', |
|||
webpackConfig(config) { |
|||
config.resolve.alias = { |
|||
antd: process.cwd(), |
|||
}; |
|||
|
|||
config.babel.plugins.push([ |
|||
require.resolve('babel-plugin-antd'), |
|||
{ |
|||
style: true, |
|||
libraryName: 'antd', |
|||
libDir: 'components', |
|||
}, |
|||
]); |
|||
|
|||
return config; |
|||
}, |
|||
}; |
@ -1,13 +0,0 @@ |
|||
import React from 'react'; |
|||
import Header from './Header'; |
|||
import Footer from './Footer'; |
|||
|
|||
export default function App(props) { |
|||
return ( |
|||
<div className="page-wrapper"> |
|||
<Header {...props} /> |
|||
{props.children} |
|||
<Footer /> |
|||
</div> |
|||
); |
|||
} |
@ -0,0 +1,6 @@ |
|||
import './common.less'; |
|||
import './header.less'; |
|||
import './footer.less'; |
|||
import './home.less'; |
|||
|
|||
import './not-found.less'; |
@ -1,7 +1,7 @@ |
|||
import React from 'react'; |
|||
import { Select, Modal } from 'antd'; |
|||
import { version as antdVersion } from '../../../package.json'; |
|||
import { docVersions } from '../../website.config'; |
|||
import { version as antdVersion } from '../../../../package.json'; |
|||
import { docVersions } from '../../'; |
|||
const Option = Select.Option; |
|||
|
|||
function isLocalStorageNameSupported() { |
@ -0,0 +1,26 @@ |
|||
import React from 'react'; |
|||
import { addLocaleData, IntlProvider } from 'react-intl'; |
|||
import Header from './Header'; |
|||
import Footer from './Footer'; |
|||
import enLocale from '../../en-US.js'; |
|||
import cnLocale from '../../zh-CN.js'; |
|||
import '../../static/style'; |
|||
|
|||
const isZhCN = (typeof localStorage !== 'undefined' && localStorage.getItem('locale') !== 'en-US'); |
|||
// (typeof localStorage !== 'undefined' && localStorage.getItem('locale') === 'zh-CN') || |
|||
// (navigator.language === 'zh-CN'); |
|||
|
|||
const appLocale = isZhCN ? cnLocale : enLocale; |
|||
addLocaleData(appLocale.data); |
|||
|
|||
export default (props) => { |
|||
return ( |
|||
<IntlProvider locale={appLocale.locale} messages={appLocale.messages}> |
|||
<div className="page-wrapper"> |
|||
<Header {...props} /> |
|||
{props.children} |
|||
<Footer /> |
|||
</div> |
|||
</IntlProvider> |
|||
); |
|||
}; |
@ -1,6 +1,5 @@ |
|||
import React from 'react'; |
|||
import { Link } from 'react-router'; |
|||
import './index.less'; |
|||
|
|||
export default function NotFound() { |
|||
return ( |
Loading…
Reference in new issue