Skip to content

Commit

Permalink
site: fix color tool, close ant-design#10265
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Apr 27, 2018
1 parent 7f8f89c commit be43e56
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions site/theme/template/Color/ColorPaletteTool.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Component } from 'react';
import { FormattedMessage } from 'react-intl';
import ColorPicker from './ColorPicker';
import ColorPalettes from './ColorPatterns';
import ColorPatterns from './ColorPatterns';

// eslint-disable-next-line
export default class ColorPaletteTool extends Component {
Expand All @@ -24,15 +24,19 @@ export default class ColorPaletteTool extends Component {
<FormattedMessage id="app.docs.color.pick-primary" />
<div className="color-palette-picker">
<span style={{ display: 'inline-block' }}>
<ColorPicker type="chrome" color={this.state.primaryColor} onChange={this.handleChangeColor} />
<ColorPicker
type="chrome"
color={this.state.primaryColor}
onChange={this.handleChangeColor}
/>
</span>
<div className="color-palette-picker-value">
{this.state.primaryColor}
</div>
</div>
</div>
<div className="main-color">
<ColorPalettes color={this.state.primaryColor} />
<ColorPatterns color={this.state.primaryColor} />
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion site/theme/template/Color/ColorPatterns.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import ColorBlock from './ColorBlock';

export default function ColorPatterns({ color }) {
return generate(color).map((colorString, i) => (
<ColorBlock color={colorString} index={i + 1} key={colorString} />
<ColorBlock color={colorString} index={i + 1} key={i} /> // eslint-disable-line
));
}

0 comments on commit be43e56

Please sign in to comment.