From 9a62ca9a315af2c8c551f5c2133d1da0edeb15d1 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 16 Aug 2016 19:20:03 +0800 Subject: [PATCH 01/48] update site Footer --- site/theme/template/Layout/Footer.jsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/site/theme/template/Layout/Footer.jsx b/site/theme/template/Layout/Footer.jsx index 2baf34aa55..dd3dfa82f2 100644 --- a/site/theme/template/Layout/Footer.jsx +++ b/site/theme/template/Layout/Footer.jsx @@ -75,6 +75,9 @@ export default class Footer extends React.Component {
ant-tool - 开发工具
+
+ dva - 应用框架 +
  • 相关站点

    @@ -85,7 +88,12 @@ export default class Footer extends React.Component {
    Ant UX - 页面逻辑素材
  • -

    联系我们

    +

    社区

    +
    + + 更新记录 + +
    反馈和建议 From 1f670b84a9abdd2af70160a7b1c678c9f203fcb8 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 16 Aug 2016 23:13:31 +0800 Subject: [PATCH 02/48] fix Tabs children again (#2559) --- components/tabs/index.jsx | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/components/tabs/index.jsx b/components/tabs/index.jsx index 69fe2a8b90..6e8f361478 100644 --- a/components/tabs/index.jsx +++ b/components/tabs/index.jsx @@ -45,19 +45,19 @@ export default class Tabs extends React.Component { animation = null; } // only card type tabs can be added and closed + let childrenWithCross; if (type === 'editable-card') { - children = Array.isArray(children) ? children : [children]; - children = children.map((child, index) => { - if (Array.isArray(child)) { - return child; - } - return cloneElement(child, { - tab:
    - {child.props.tab} - this.removeTab(child.key, e)} /> -
    , + childrenWithCross = []; + React.Children.forEach(children, (child, index) => { + childrenWithCross.push(cloneElement(child, { + tab: ( +
    + {child.props.tab} + this.removeTab(child.key, e)} /> +
    + ), key: child.key || index, - }); + })); }); // Add new tab handler if (!hideAdd) { @@ -83,7 +83,7 @@ export default class Tabs extends React.Component { onChange={this.handleChange} animation={animation} > - {children} + {childrenWithCross || children} ); } From 4f2c12a64035d5699a0780f0579049578481beea Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Wed, 17 Aug 2016 10:52:56 +0800 Subject: [PATCH 03/48] site: move polyfill to html --- site/theme/static/template.html | 8 +++++++- site/theme/template/Layout/index.jsx | 21 --------------------- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/site/theme/static/template.html b/site/theme/static/template.html index 861d125114..b0b084ca9f 100644 --- a/site/theme/static/template.html +++ b/site/theme/static/template.html @@ -8,7 +8,7 @@ @@ -45,6 +45,12 @@ /* eslint-enable */ } + diff --git a/site/theme/template/Layout/index.jsx b/site/theme/template/Layout/index.jsx index 82dc5e4d9b..e0884360b9 100644 --- a/site/theme/template/Layout/index.jsx +++ b/site/theme/template/Layout/index.jsx @@ -12,27 +12,6 @@ window.react = React; window['react-dom'] = ReactDOM; window.antd = require('antd'); -// Polyfill -const areIntlLocalesSupported = require('intl-locales-supported'); -const localesMyAppSupports = ['zh-CN', 'en-US']; -if (global.Intl) { - // Determine if the built-in `Intl` has the locale data we need. - if (!areIntlLocalesSupported(localesMyAppSupports)) { - // `Intl` exists, but it doesn't have the data we need, so load the - // polyfill and patch the constructors we need with the polyfill's. - /* eslint-disable global-require */ - const IntlPolyfill = require('intl'); - /* eslint-enable global-require */ - Intl.NumberFormat = IntlPolyfill.NumberFormat; - Intl.DateTimeFormat = IntlPolyfill.DateTimeFormat; - } -} else { - // No `Intl`, so use and load the polyfill. - /* eslint-disable global-require */ - global.Intl = require('intl'); - /* eslint-enable global-require */ -} - const isZhCN = (typeof localStorage !== 'undefined' && localStorage.getItem('locale') !== 'en-US'); // (typeof localStorage !== 'undefined' && localStorage.getItem('locale') === 'zh-CN') || // (navigator.language === 'zh-CN'); From 479056364adced2263126e335b0ca95bbfae4e0b Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Wed, 17 Aug 2016 11:00:52 +0800 Subject: [PATCH 04/48] site: update header --- site/theme/template/Layout/Header.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/site/theme/template/Layout/Header.jsx b/site/theme/template/Layout/Header.jsx index ddfe7b1001..71dbd2a6cc 100644 --- a/site/theme/template/Layout/Header.jsx +++ b/site/theme/template/Layout/Header.jsx @@ -116,6 +116,7 @@ export default class Header extends React.Component { 'home-nav-white': !this.state.isFirstFrame, }); + const searchPlaceholder = this.context.intl.locale === 'zh-CN' ? '搜索组件...' : 'Search...'; return (